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.
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:
Verify the installed CLI:
Display the available commands:
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:
| Command | Description |
|---|---|
axil create <name> | Create a new AxilJS project |
axil run | Start the development server with hot reload |
axil run <entry> | Start the application with a custom entry point |
axil build | Compile the application for production |
axil test [pattern] | Run test files |
axil deploy | Generate Docker and Kubernetes deployment files |
axil install [package] | Install an AxilJS package |
axil doctor | Diagnose project issues |
axil --version | Display 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:
Then enter the generated project directory:
Install the project dependencies:
Run the Development Server
Start an AxilJS application in development mode with:
The development server supports hot reload, making it suitable for iterative application development.
Custom Entry Point
You can provide a custom application entry point:
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:
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:
A test pattern can also be provided:
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:
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:
For example:
Project dependencies can also be managed directly through npm when required.
Diagnose Project Issues
Use axil doctor to diagnose project or environment issues:
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:
Inspect a specific decorator and its metadata:
Search the decorator catalog:
Check decorator composition and conflicts in a source file:
Generate a decorator metadata graph:
Display available 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.
Run tests when needed:
Build the application for production:
Generate deployment files:
The workflow can be summarized as:
Updating the CLI
Update a globally installed AxilJS CLI to the latest published version:
Verify the installed version:
Checking the version after an update confirms which AxilJS CLI release is currently installed.
CLI Help
Display general AxilJS CLI help:
Individual commands provide their own help output.
For example:
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:
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.