Is the cli package also included in the web version?
-
I posted a prompt suggesting the addition of some generative ai capabilities. In running the app locally I see that it is system linking the
@jscad/cli
and@jscad/web
packages and running thepostInstall.js
script, but then after successfully bootstrapping it's running thisdemo.js
script.My goal is to create a prompt input area in the editor.js section, but we will need a server side capabilities to keep the api key to which ever ai api we send the prompt commands to.
Fairly easy integration.
-
@Jason-Sprouse hmm...
The website doesn't have a backend service/process. Everything is handled by the browser, including loading designs.
The only trick is for designs provided an a URL parameter. In this case, the URL is posted to a little script that reads the contents, stores the file locally, and returns the URL to the local file.
Of course, some other backend service could be added.
-
@z3dev The only reason I wanted the cli was node.js to access environment variables server side.
-
@Jason-Sprouse what you installed was the WHOLE project, which requires NODEJS, NPM, etc. you will find the code for the CLI and the WEBUI. Once setup, you can change the code, run tests, add new functionality, etc. The packages are linked together.
The CLI can be installed directly from NPM. See the README for the CLI.
https://github.com/jscad/OpenJSCAD.org/tree/master/packages/cli
-
-
It's not node based, and just uses a minified compiled version of jscad.
<body> <noscript> <h1>Please enable JavaScript to use this website</h1> </noscript> <div id='jscad'></div> <script language="javascript" src="./dist/jscad-web.min.js"></script> <script language="javascript"> const el1 = document.getElementById('jscad') const jscadInst1 = jscadWeb(el1, {name: 'jscad1'}) </script> <script language="javascript"> window.addEventListener('beforeunload', (event) => { event.preventDefault() event.returnValue = '' }) </script> </body>