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>

Shortcuts:

ajs m init
ajs m i

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:

OptionDescriptionDefaultShortcut
--gitWhere to get templates fromhttps://github.com/antelopejs/interfaces.git-g

Example:

ajs module init my-module

Managing Imports

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

module imports add

Add interfaces to your module.

ajs module imports add <interfaces...>

Shortcuts:

ajs m imports add
ajs m i add

What it does:

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

Arguments:

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

Options:

OptionDescriptionDefaultShortcut
--gitWhere to get interfaces fromhttps://github.com/antelopejs/interfaces.git-g
--moduleWhich module to modifyCurrent directory-m
--optionalMake imports optionalfalse-o

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...>

Shortcuts:

ajs m imports remove
ajs m i remove

What it does:

Removes interfaces from your module and cleans up related files.

Arguments:

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

Options:

OptionDescriptionDefaultShortcut
--moduleWhich module to modifyCurrent directory-m

Example:

ajs module imports remove database@1

module imports update

Update all your imported interfaces.

ajs module imports update

Shortcuts:

ajs m imports update
ajs m i update

What it does:

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

Options:

OptionDescriptionDefaultShortcut
--moduleWhich module to updateCurrent directory-m

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>

Shortcuts:

ajs m exports set
ajs m e set

What it does:

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

Arguments:

ArgumentDescriptionRequired
<path>Where your interfaces are locatedYes

Options:

OptionDescriptionDefaultShortcut
--moduleWhich module to modifyCurrent directory-m

Example:

ajs module exports set src/interfaces