AxilJS CLI Configuration and Project Setup
Configure and use the AxilJS CLI within an AxilJS project, including project context, entry points, package management, diagnostics, version management, and development commands.
AxilJS CLI Configuration
The AxilJS CLI is designed to operate within an AxilJS project and use the project's existing source structure, dependencies, and application configuration.
CLI configuration is primarily project-oriented. Application-level configuration, including environment variables and typed configuration, is handled separately in the Environment and Typed Config documentation.
Project Context
Run AxilJS CLI commands from the root directory of your project.
The CLI operates against the current project context, including its source files, installed dependencies, and application configuration.
Running commands from the project root ensures that the CLI can work with the expected AxilJS project structure.
Entry Point
The run command can use the project's default application entry point:
You can also provide a custom entry point:
A custom entry point is useful when your application uses a different source structure or entry module.
Package Management
Install project dependencies from the project root using npm:
AxilJS packages can also be installed through the CLI:
For example:
Standard npm package installation remains available:
Use npm install when you need the standard npm package-management workflow.
Check the CLI Version
Use --version to check the currently installed AxilJS CLI version:
Checking the version is useful when troubleshooting differences between development environments or verifying that the expected CLI release is installed.
Update the CLI
For a globally installed AxilJS CLI, update to the latest published version with:
After updating, verify the installed version:
This provides a simple way to confirm that the CLI update completed successfully.
Project Environment
Application environment configuration is managed at the project level.
Environment variables and typed application configuration should follow the configuration structure used by the project.
See the dedicated configuration documentation:
Diagnose Project Issues
Use the built-in doctor command to inspect the project environment:
If you encounter an unexpected CLI or project issue, run:
before investigating individual configuration files.
The diagnostic command provides a first step for checking the project environment and identifying potential configuration or setup problems.
CLI Help
Display the complete AxilJS CLI command reference with:
You can also request help for a specific command.
For the run command:
For the build command:
For decorator-related commands:
Command-specific help is useful when you need to inspect the available options without leaving the terminal.
Recommended Development Setup
A typical AxilJS project workflow starts by creating the project, installing dependencies, checking the environment, and starting the application:
The sequence provides a straightforward development setup:
Production Build and Deployment
When the application is ready for production, use the AxilJS build and deployment commands:
The build command prepares the application for production, while the deploy command handles the deployment workflow supported by the AxilJS CLI.
CLI Configuration Model
AxilJS keeps project configuration close to the application while providing CLI commands for common development and deployment tasks.
The main CLI workflow can be summarized as:
This project-oriented approach allows the CLI to work with the application's existing source structure and configuration while providing commands for development, diagnostics, building, and deployment.