Project Commands
Project Management
These commands help you work with your Antelopejs projects.
project init
Creates a new project.
ajs project init <project>
What it does:
Walks you through setting up a new project. It creates the antelope.json
file and helps you set up your main module.
Arguments:
Argument | Description | Required |
---|---|---|
<project> | Name of your project | Yes |
Example:
ajs project init my-app
project run
Runs your project.
ajs project run
What it does:
Starts your Antelopejs app by loading all the modules listed in your project.
Options:
Option | Short | Description | Default | Environment variable |
---|---|---|---|---|
--project | -p | Where your project is | . | ANTELOPEJS_PROJECT |
--env | -e | Which environment to run | - | ANTELOPEJS_LAUNCH_ENV |
--watch | -w | Auto-reload when files change | false | - |
--concurrency | -c | Number of modules to load at once | 10 | - |
Example:
ajs project run --watch --env development --concurrency 4
Module Management
These commands help you add, remove, and update modules in your project.
project modules add
Adds modules to your project.
ajs project modules add <modules...>
What it does:
Gets the modules you want and adds them to your project.
Arguments:
Argument | Description | Required |
---|---|---|
<modules...> | Modules to add (list them) | Yes |
Options:
Option | Short | Description | Default | Environment variable |
---|---|---|---|---|
--project | -p | Where your project is | . | ANTELOPEJS_PROJECT |
--env | -e | Which environment to use | - | ANTELOPEJS_LAUNCH_ENV |
--mode | -m | How to get the module (npm/git/local/dir) | npm | - |
Example:
ajs project modules add @ajs/api @ajs/auth-jwt --mode npm
project modules remove
Takes modules out of your project.
ajs project modules remove <modules...>
What it does:
Removes modules you no longer need from your project.
Arguments:
Argument | Description | Required |
---|---|---|
<modules...> | Modules to remove (list them) | Yes |
Options:
Option | Short | Description | Default | Environment variable |
---|---|---|---|---|
--project | -p | Where your project is | . | ANTELOPEJS_PROJECT |
--env | -e | Which environment to use | - | ANTELOPEJS_LAUNCH_ENV |
Example:
ajs project modules remove @ajs/auth-jwt
project modules update
Updates modules to newer versions.
ajs project modules update <modules...>
What it does:
Gets the latest version of modules and updates them in your project.
Arguments:
Argument | Description | Required |
---|---|---|
<modules...> | Modules to update (list them) | Yes |
Options:
Option | Short | Description | Default | Environment variable |
---|---|---|---|---|
--project | -p | Where your project is | . | ANTELOPEJS_PROJECT |
--env | -e | Which environment to use | - | ANTELOPEJS_LAUNCH_ENV |
Example:
ajs project modules update @ajs/api
project modules fix
Helps fix missing dependencies.
ajs project modules fix
What it does:
Analyzes your project modules and attempts to resolve dependency issues automatically.
Options:
Option | Short | Description | Default | Environment variable |
---|---|---|---|---|
--project | -p | Where your project is | . | ANTELOPEJS_PROJECT |
--env | -e | Which environment to use | - | ANTELOPEJS_LAUNCH_ENV |
Example:
ajs project modules fix
Logging Management
These commands help you manage logging for your project.
project logging show
Displays the current logging configuration of your Antelopejs project.
ajs project logging show
Options:
Option | Short | Description | Default | Environment variable |
---|---|---|---|---|
--project | -p | Path to Antelopejs project | . | ANTELOPEJS_PROJECT |
--env | -e | Launch environment | - | ANTELOPEJS_LAUNCH_ENV |
Example:
ajs project logging show
project logging set
Modifies the logging configuration of your Antelopejs project.
ajs project logging set
Description:
This command allows you to modify various settings of the current logging configuration for your Antelopejs project.
Options:
Option | Short | Description | Default | Environment variable |
---|---|---|---|---|
--project | -p | Path to Antelopejs project | . | ANTELOPEJS_PROJECT |
--env | -e | Launch environment | - | ANTELOPEJS_LAUNCH_ENV |
--enable | - | Enable logging | - | - |
--disable | - | Disable logging | - | - |
--enableModuleTracking | - | Enable module tracking | - | - |
--disableModuleTracking | - | Disable module tracking | - | - |
--includeModule | - | Include logging of a specific module | - | - |
--excludeModule | - | Exclude logging of a specific module | - | - |
--removeInclude | - | Remove module from include list | - | - |
--removeExclude | - | Remove module from exclude list | - | - |
--level | - | Set log level formatter | - | - |
--format | - | Format string for the selected level | - | - |
--dateFormat | - | Set date format for logs | - | - |
--interactive | -i | Interactive configuration mode | false | - |
Format Variables:
When setting custom log formats with --level
and --format
, you can use these template variables:
{{DATE}}
- Timestamp formatted according to dateFormat{{LEVEL_NAME}}
- Human-readable log level (ERROR, WARN, etc.){{ARGS}}
- The log message content{{chalk.COLOR}}
- Apply colors using Chalk (supports all Chalk methods)
Examples:
# Enable logging and include only api module
ajs project logging set --enable --includeModule api
# Set a custom format for error logs
ajs project logging set --level error --format "{{chalk.gray}}[{{DATE}}] {{chalk.red}}{{chalk.bold}}[ERROR]{{chalk.reset}} {{ARGS}}"
# Set a custom date format
ajs project logging set --dateFormat "yyyy-MM-dd HH:mm:ss.SSS"
# Use interactive mode to configure all options
ajs project logging set --interactive