@astx/cli
v2.0.2
Published
Compile and run ASTX files from your command line
Readme
@astx/cli
Command-line interface for the ASTX toolchain. Compile, run, and inspect .astx binary files.
Installation
npm install -g @astx/cliCommands
astx compile <input> <output>
Compile a JavaScript file to an ASTX binary.
astx compile src/index.js dist/index.astxThe .astx extension is appended automatically if omitted from <output>.
--watch / -w
Watch the input file and recompile automatically on every save.
astx compile --watch src/index.js dist/index.astxEach recompile prints a timestamped line:
Watching src/index.js for changes… (Ctrl+C to stop)
[12:34:56] Compiled src/index.js → dist/index.astx in 12.4ms
[12:35:02] Compiled src/index.js → dist/index.astx in 11.9msCompile errors during watch are printed without stopping the watcher.
astx run <file>
Execute an ASTX binary file.
astx run dist/index.astxThe program runs in vm mode; __dirname and __filename are injected based on the file's location.
astx gen <input> <output>
Decompile an ASTX binary back to JavaScript source. The output is not optimised or human-readable — intended for debugging only.
astx gen dist/index.astx dist/index.debug.jsastx version
Print the installed versions of the CLI and compiler.
astx versionLicense
GPL-3.0 — see the ASTX repository for details.
