CLI

AxilJS CLI Installation and Development Setup

Install the AxilJS CLI with npm, verify your environment, create an AxilJS project, update the CLI, and troubleshoot installation issues.

3 min readDocumentationEdit this page

AxilJS CLI Installation

The AxilJS command-line interface is distributed through the @axiljs/cli npm package.

The CLI provides the axil command for creating and running AxilJS projects, inspecting the development environment, managing packages, and performing other application lifecycle tasks.

Requirements

Before installing the AxilJS CLI, make sure Node.js and npm are available on your system.

Check the installed versions:

Terminal
node --version
npm --version

The AxilJS CLI uses the Node.js runtime to execute CLI commands.

Install the AxilJS CLI

Install @axiljs/cli globally with npm:

Terminal
npm install -g @axiljs/cli

A global installation makes the axil command available from any terminal location.

After installation, verify that the command is available:

Terminal
axil --version

Verify the CLI Installation

Check the installed AxilJS CLI version:

Terminal
axil --version

You should see the version of the installed CLI.

You can also display the available AxilJS CLI commands:

Terminal
axil --help

This is useful for confirming that the CLI is installed correctly and for discovering available commands.

Update the AxilJS CLI

If the CLI is already installed globally, update it to the latest published version:

Terminal
npm install -g @axiljs/cli@latest

Verify the updated installation:

Terminal
axil --version

Checking the version after an update confirms which CLI release is currently available in your terminal.

Create an AxilJS Project

Once the CLI is installed, create a new AxilJS application with:

Terminal
axil create my-api

Move into the generated project directory:

Terminal
cd my-api

Install the project's dependencies:

Terminal
npm install

Start the AxilJS development server:

Terminal
axil run

The complete setup flow is:

text
Install CLI
    │
    ▼
axil create my-api
    │
    ▼
cd my-api
    │
    ▼
npm install
    │
    ▼
axil run

Check the AxilJS Environment

Use the built-in doctor command to inspect your AxilJS project environment:

Terminal
axil doctor

The diagnostic command is particularly useful when troubleshooting project setup or CLI-related issues.

Run it from the root of your AxilJS project.

Global CLI vs Project Dependencies

The AxilJS CLI is installed globally:

Terminal
npm install -g @axiljs/cli

Application dependencies are installed inside the individual AxilJS project:

Terminal
npm install

This separates the system-wide CLI from application-specific dependencies.

text
System
  │
  └── @axiljs/cli
          │
          └── axil command
 
AxilJS Project
  │
  ├── package.json
  ├── node_modules/
  └── Application Dependencies

The global CLI can therefore be used to create and manage projects, while each project maintains its own dependency installation.

Reinstall the AxilJS CLI

If the global CLI installation becomes corrupted or behaves unexpectedly, remove the existing installation:

Terminal
npm uninstall -g @axiljs/cli

Then install it again:

Terminal
npm install -g @axiljs/cli

Verify the installation:

Terminal
axil --version

A reinstall provides a clean global CLI installation while leaving the dependencies inside your existing projects unchanged.

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY