CLI

AxilJS Project Commands: Create, Run, Build, Test and Deploy

Use the AxilJS CLI to create projects, run the development server, build TypeScript applications, run tests, generate deployment files, install packages, diagnose issues, and manage CLI versions.

5 min readDocumentationEdit this page

AxilJS Project Commands

The AxilJS CLI provides the primary commands for managing the AxilJS application lifecycle. You can create projects, run the development server, build TypeScript applications, execute tests, generate deployment artifacts, install packages, diagnose project issues, and inspect the installed CLI version.

All project commands are available through the axil command.

Create an AxilJS Project

Create a new AxilJS project with:

Terminal
axil create <name>

For example:

Terminal
axil create my-api

Move into the generated project directory:

Terminal
cd my-api

Install the project dependencies:

Terminal
npm install

Start the application:

Terminal
axil run

A basic project creation workflow is:

text
axil create
     │
     ▼
 Project
     │
     ▼
npm install
     │
     ▼
 axil run

Run the Development Server

Start the AxilJS development server with hot reload:

Terminal
axil run

When no entry point is specified, the CLI uses the project's configured entry point.

The development server is intended for iterative development. After modifying application source code, the development environment can reload the application automatically.

Custom Entry Point

You can provide a custom TypeScript entry point:

Terminal
axil run src/mvc/main.ts

This is useful when an application uses a custom source structure or entry module.

For example:

text
src/
└── mvc/
    └── main.ts

The custom entry point can then be started with:

Terminal
axil run src/mvc/main.ts

Build an AxilJS Application

Compile the TypeScript application for production with:

Terminal
axil build

Use axil build when preparing an AxilJS application for production deployment.

A typical build workflow is:

Terminal
npm install
axil build

The build command is intended for the production compilation stage of the AxilJS application lifecycle.

Run Tests

Run the project's test files with:

Terminal
axil test

You can optionally provide a test pattern:

Terminal
axil test <pattern>

For example:

Terminal
axil test user

A pattern can be used to target tests matching a particular name or pattern.

Generate Deployment Artifacts

Generate deployment artifacts with:

Terminal
axil deploy

The deployment command generates Docker and Kubernetes configuration files for preparing an AxilJS application for deployment.

A typical production preparation workflow is:

Terminal
axil build
axil deploy

Review the generated deployment files before using them in your target deployment environment.

Install Packages

Install an AxilJS package with:

Terminal
axil install <package>

For example:

Terminal
axil install @axiljs/decorator

The command provides a package installation workflow directly through the AxilJS CLI.

Packages can also be installed using npm:

Terminal
npm install <package>

Use standard npm installation when you need the normal npm package-management workflow.

Diagnose Project Issues

Use the doctor command to diagnose project and environment issues:

Terminal
axil doctor

The command is useful when investigating problems related to:

  • Project configuration
  • Development environment
  • Dependencies
  • AxilJS CLI setup
  • Application project state

For example:

Terminal
axil doctor

Run axil doctor before investigating individual configuration files when an unexpected project or CLI issue occurs.

Check the CLI Version

Display the currently installed AxilJS CLI version:

Terminal
axil --version

This is useful when verifying which CLI release is being used, particularly when troubleshooting differences between development environments.

Display CLI Help

Display the available AxilJS CLI commands:

Terminal
axil --help

Command-specific help can also be requested where supported.

For example:

Terminal
axil run --help
Terminal
axil build --help
Terminal
axil decorator --help

Command-specific help provides the available options and usage information for an individual command.

Complete AxilJS Project Workflow

A complete project setup and development workflow can start with:

Terminal
axil create my-api
cd my-api
npm install
axil run

After development, run the tests and prepare the production application:

Terminal
axil test
axil build
axil deploy

If a project or environment issue occurs:

Terminal
axil doctor

The complete lifecycle can be represented as:

text
Create
  │
  ▼
Install
  │
  ▼
Run
  │
  ▼
Test
  │
  ▼
Build
  │
  ▼
Deploy

Project Command Reference

CommandDescription
axil create <name>Create a new AxilJS project
axil runStart the development server with hot reload
axil run <entry>Start using a custom entry point
axil buildCompile the TypeScript application for production
axil testRun project test files
axil test <pattern>Run tests matching a pattern
axil deployGenerate Docker and Kubernetes deployment files
axil install <package>Install an AxilJS package
axil doctorDiagnose project and environment issues
axil --versionDisplay the installed CLI version
axil --helpDisplay CLI help

These project commands provide the core AxilJS CLI operations for creating, developing, testing, building, and preparing an application for deployment.

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY