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

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

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

Example:

ajs module imports add database@1 api@2

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

What it does:

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

Options:

OptionShortDescriptionDefault
--module-mWhich module to updateCurrent directory

Example:

ajs module imports update

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

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