CLI

Project Commands

Here's how to create and manage your Antelopejs projects using the CLI - from starting new projects to running them and managing modules.

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:

ArgumentDescriptionRequired
<project>Name of your projectYes

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:

OptionShortDescriptionDefaultEnvironment variable
--project-pWhere your project is.ANTELOPEJS_PROJECT
--env-eWhich environment to run-ANTELOPEJS_LAUNCH_ENV
--watch-wAuto-reload when files changefalse-
--concurrency-cNumber of modules to load at once10-

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:

ArgumentDescriptionRequired
<modules...>Modules to add (list them)Yes

Options:

OptionShortDescriptionDefaultEnvironment variable
--project-pWhere your project is.ANTELOPEJS_PROJECT
--env-eWhich environment to use-ANTELOPEJS_LAUNCH_ENV
--mode-mHow 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:

ArgumentDescriptionRequired
<modules...>Modules to remove (list them)Yes

Options:

OptionShortDescriptionDefaultEnvironment variable
--project-pWhere your project is.ANTELOPEJS_PROJECT
--env-eWhich 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:

ArgumentDescriptionRequired
<modules...>Modules to update (list them)Yes

Options:

OptionShortDescriptionDefaultEnvironment variable
--project-pWhere your project is.ANTELOPEJS_PROJECT
--env-eWhich 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:

OptionShortDescriptionDefaultEnvironment variable
--project-pWhere your project is.ANTELOPEJS_PROJECT
--env-eWhich 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:

OptionShortDescriptionDefaultEnvironment variable
--project-pPath to Antelopejs project.ANTELOPEJS_PROJECT
--env-eLaunch 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:

OptionShortDescriptionDefaultEnvironment variable
--project-pPath to Antelopejs project.ANTELOPEJS_PROJECT
--env-eLaunch 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-iInteractive configuration modefalse-

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