CLI

AxilJS CLI Overview: Create, Run, Build, Test and Deploy

Learn how the AxilJS CLI provides a unified command-line interface for creating, running, building, testing, deploying, installing packages, diagnosing projects, and inspecting semantic decorators.

5 min readDocumentationEdit this page

AxilJS CLI Overview

The @axiljs/cli package is the command-line interface for the AxilJS ecosystem.

It provides a unified command surface for the primary AxilJS project lifecycle, including project creation, development, production builds, testing, deployment preparation, package installation, diagnostics, and semantic decorator inspection.

Installation

Install the AxilJS CLI globally using npm:

Terminal
npm install -g @axiljs/cli

Verify the installed CLI:

Terminal
axil --version

Display the available commands:

Terminal
axil --help

The axil command is the main entry point for AxilJS CLI operations.

Core Commands

The AxilJS CLI provides commands for the main application development lifecycle:

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

These commands cover the common workflow from creating an application through development, testing, production compilation, and deployment preparation.

Create an AxilJS Project

Create a new AxilJS project with axil create:

Terminal
axil create my-api

Then enter the generated project directory:

Terminal
cd my-api

Install the project dependencies:

Terminal
npm install

Run the Development Server

Start an AxilJS application in development mode with:

Terminal
axil run

The development server supports hot reload, making it suitable for iterative application development.

Custom Entry Point

You can provide a custom application entry point:

Terminal
axil run src/mvc/main.ts

This is useful when your project uses a custom application structure or a different entry module.

Build for Production

Compile an AxilJS application for production with:

Terminal
axil build

The build command is part of the AxilJS production workflow and prepares the application for deployment.

Run Tests

Execute the project's test files with:

Terminal
axil test

A test pattern can also be provided:

Terminal
axil test [pattern]

This allows the CLI to run either the project's test suite or a selected group of test files.

Generate Deployment Files

Use the deploy command to generate deployment configuration:

Terminal
axil deploy

The command generates Docker and Kubernetes deployment files for the AxilJS application.

This provides deployment artifacts that can be used as part of a containerized production workflow.

Install Packages

AxilJS packages can be installed through the CLI:

Terminal
axil install [package]

For example:

Terminal
axil install @axiljs/decorator

Project dependencies can also be managed directly through npm when required.

Diagnose Project Issues

Use axil doctor to diagnose project or environment issues:

Terminal
axil doctor

The diagnostic command is useful when troubleshooting an AxilJS project or investigating unexpected development-environment behavior.

Semantic Decorator Commands

The AxilJS CLI includes dedicated tooling for the semantic decorator catalog.

List available decorators:

Terminal
axil decorator list

Inspect a specific decorator and its metadata:

Terminal
axil decorator info <name>

Search the decorator catalog:

Terminal
axil decorator search <query>

Check decorator composition and conflicts in a source file:

Terminal
axil decorator check <file>

Generate a decorator metadata graph:

Terminal
axil decorator graph <file>

Display available decorator categories:

Terminal
axil decorator categories

See Decorator Commands for the complete decorator CLI reference.

Typical AxilJS Workflow

A typical development workflow starts with project creation and continues through dependency installation, development, testing, production compilation, and deployment preparation.

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

Run tests when needed:

Terminal
axil test

Build the application for production:

Terminal
axil build

Generate deployment files:

Terminal
axil deploy

The workflow can be summarized as:

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

Updating the CLI

Update a globally installed AxilJS CLI to the latest published version:

Terminal
npm install -g @axiljs/cli@latest

Verify the installed version:

Terminal
axil --version

Checking the version after an update confirms which AxilJS CLI release is currently installed.

CLI Help

Display general AxilJS CLI help:

Terminal
axil --help

Individual commands provide their own help output.

For example:

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

Command-specific help is useful for inspecting the options and usage supported by an individual CLI command.

AxilJS CLI Lifecycle

The AxilJS CLI brings the primary project lifecycle and semantic framework tooling into a single command-line interface:

text
                    AxilJS CLI
                        │
        ┌───────────────┼────────────────┐
        │               │                │
        ▼               ▼                ▼
   Project         Application      Framework
   Lifecycle        Lifecycle        Tooling
        │               │                │
   ┌────┴────┐     ┌────┴────┐     ┌────┴─────┐
   ▼         ▼     ▼         ▼     ▼          ▼
 create   install  run      test  decorator  doctor
                         │
                         ▼
                       build
                         │
                         ▼
                       deploy

The CLI therefore provides a single interface for creating AxilJS projects, developing and testing applications, preparing production builds and deployment files, diagnosing project issues, managing packages, and working with the AxilJS semantic decorator system.

Help improve the documentation

AxilJS is open source and documentation improvements are welcome.

AxilJS DocumentationMIT License · Built by SyntaxilitY