Skip to main content

CLI

The AxiSpark CLI scaffolds new AxiSpark.js projects from a set of ready-to-run templates. It creates the project folder, aligns the @axisparkjs/* dependencies with the CLI version, and optionally installs the dependencies for you.

Installation​

Install the CLI globally with npm:

npm install -g @axisparkjs/cli

The CLI requires Node.js version 24 or higher. Once installed, the axispark command is available in your terminal:

axispark --help

create​

Creates a new project in a directory with the given name, relative to the current working directory.

axispark create [name] [options]
Argument / OptionDescription
[name]Project name and directory to create. If omitted, the CLI asks for it. Only letters, numbers, - and _ are allowed.
-t, --template <template>Template to use. If omitted, the CLI shows a list of the available templates.
-i, --installInstall dependencies with npm install after creating the project.
--no-installDo not install dependencies after creating the project.

When neither --install nor --no-install is passed, the CLI asks whether to install the dependencies. The command fails if the target directory already exists.

The following command creates an HTTP project in the my-app directory and installs its dependencies without asking any question:

axispark create my-app --template http --install

Templates​

Templates are downloaded from the templates/ folder of the AxiSpark.js repository, so the command needs network access.

TemplateIncludes
defaultBasic application with a sample plugin.
httpExpress HTTP server with a /api/example controller.
http-securityHTTP server with a demo authenticator, an admin authorization policy, and a protected route. The example credential is Authorization: Demo admin; adapt authentication to your identity provider.
schedulerScheduler plugin with a job that logs every five seconds.
http-openapiHTTP server with a documented greeting response and an OpenAPI schema. The JSON document is available at /api/openapi.json.

Generated Project​

Every template is implemented in TypeScript and shares the same base structure:

my-app/
├── src/
│ ├── app.ts # Application definition and registered plugins
│ ├── index.bootstrap.ts # Entry point that initializes, runs and destroys the app
│ └── ... # Template specific files (plugins, controllers, jobs...)
├── package.json
└── tsconfig.json

The package.json includes the following scripts:

ScriptDescription
npm run devRuns src/index.bootstrap.ts with ts-node and restarts it on changes with nodemon.
npm run buildCompiles the project with tsc into the dist directory.
npm startRuns the compiled application from dist/index.bootstrap.js.

Next Steps​

After creating the project, move into its directory and start it in development mode:

cd my-app
npm run dev

If you created the project with --no-install, run npm install before starting it.

Continue with First Steps to understand the generated files.