CLI

Module Commands

Here's how to create and manage your modules with the CLI - from creating new ones to handling interfaces.

Creating Modules

module init

Creates a new module.

ajs module init <path>

What it does:

Walks you through setting up a new module using templates. The wizard helps you pick the right options so your module follows best practices.

Arguments:

ArgumentDescriptionRequired
<path>Where to create itYes

Options:

OptionShortDescriptionDefault
--git-gWhere to get templates fromhttps://github.com/antelopejs/interfaces.git

Example:

ajs module init my-module
ajs module init my-module --git https://github.com/myorg/interfaces.git

module test

Run tests for a module.

ajs module test <path>

What it does:

Executes the tests defined in your module's test directory to verify functionality.

Arguments:

ArgumentDescriptionRequired
<path>Path to module directoryYes

Example:

ajs module test my-module

Managing Imports

These commands help you work with interfaces that your module uses from other modules.

module imports list

Lists all imported interfaces.

ajs module imports list

What it does:

Shows all required and optional interfaces that your module is using.

Options:

OptionShortDescriptionDefault
--module-mWhich module to checkCurrent directory
--verbose-vShow detailed information including overridesfalse

Example:

ajs module imports list --verbose
ajs module imports list --module /path/to/module

module imports add

Add interfaces to your module.

ajs module imports add <interfaces...>

What it does:

Gets the interfaces you need and adds them to your module.

Arguments:

ArgumentDescriptionRequired
<interfaces...>Interfaces to add (list them)Yes

Options:

OptionShortDescriptionDefault
--git-gWhere to get interfaces fromhttps://github.com/antelopejs/interfaces.git
--module-mWhich module to modifyCurrent directory
--optional-oMake imports optionalfalse
--skip-install-sSkip installation of interface filesfalse

Example:

ajs module imports add database@1 api@2
ajs module imports add database@1 --skip-install  # Add without installing files
ajs module imports add api@2 --optional --skip-install  # Optional import without files

module imports install

Install missing interfaces to your module.

ajs module imports install

What it does:

Installs only the interfaces defined in package.json that are not already present in .antelope/interfaces.d directory. This is useful when you've added interfaces to your package.json but they haven't been downloaded yet, or when working with a fresh clone of a project.

This is typically the first command you'll run when setting up a module to ensure all required interface imports are properly installed.

Options:

OptionShortDescriptionDefault
--module-mWhich module to checkCurrent directory

Example:

# Install interfaces for current directory module
ajs module imports install

# Install interfaces for a specific module by name
ajs module imports install --module my-module

# Install interfaces for a module using absolute path  
ajs module imports install --module /path/to/my-project

module imports remove

Take out interfaces you don't need anymore.

ajs module imports remove <interfaces...>

What it does:

Removes interfaces from your module and cleans up related files.

Arguments:

ArgumentDescriptionRequired
<interfaces...>Interfaces to remove (list them)Yes

Options:

OptionShortDescriptionDefault
--module-mWhich module to modifyCurrent directory

Example:

ajs module imports remove database@1

module imports update

Update all your imported interfaces.

ajs module imports update [interfaces...]

What it does:

Gets the latest version of all interfaces your module is using.

Arguments:

ArgumentDescriptionRequired
[interfaces...]Specific interfaces to update (default: all)No

Options:

OptionShortDescriptionDefault
--module-mWhich module to updateCurrent directory
--dry-runShow what would be updated without making changesfalse
--skip-install-sSkip installation of interface files during updatefalse

Example:

ajs module imports update
ajs module imports update database@1 api@2  # Update specific interfaces
ajs module imports update --skip-install    # Update all but skip installing files
ajs module imports update --dry-run         # See what would be updated

Managing Exports

These commands help you set up the interfaces your module offers to others.

module exports set

Tell Antelopejs where your module's interfaces are.

ajs module exports set <path>

What it does:

Sets which folder contains the interfaces your module shares with others.

Arguments:

ArgumentDescriptionRequired
<path>Where your interfaces are locatedYes

Options:

OptionShortDescriptionDefault
--module-mWhich module to modifyCurrent directory

Example:

ajs module exports set src/interfaces
ajs module exports set src/types --module my-module

module exports generate

Generate TypeScript declaration files for your module's exports.

ajs module exports generate

What it does:

Creates TypeScript definition files for your module's interfaces to be consumed by other modules.

Options:

OptionShortDescriptionDefault
--module-mWhich module to generate exports forCurrent directory

Example:

ajs module exports generate
ajs module exports generate --module my-module