Module Commands
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:
Argument | Description | Required |
---|---|---|
<path> | Where to create it | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--git | -g | Where to get templates from | https://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:
Argument | Description | Required |
---|---|---|
<path> | Path to module directory | Yes |
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:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to check | Current directory |
--verbose | -v | Show detailed information including overrides | false |
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:
Argument | Description | Required |
---|---|---|
<interfaces...> | Interfaces to add (list them) | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--git | -g | Where to get interfaces from | https://github.com/antelopejs/interfaces.git |
--module | -m | Which module to modify | Current directory |
--optional | -o | Make imports optional | false |
--skip-install | -s | Skip installation of interface files | false |
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:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to check | Current 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:
Argument | Description | Required |
---|---|---|
<interfaces...> | Interfaces to remove (list them) | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to modify | Current 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:
Argument | Description | Required |
---|---|---|
[interfaces...] | Specific interfaces to update (default: all) | No |
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to update | Current directory |
--dry-run | Show what would be updated without making changes | false | |
--skip-install | -s | Skip installation of interface files during update | false |
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:
Argument | Description | Required |
---|---|---|
<path> | Where your interfaces are located | Yes |
Options:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to modify | Current 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:
Option | Short | Description | Default |
---|---|---|---|
--module | -m | Which module to generate exports for | Current directory |
Example:
ajs module exports generate
ajs module exports generate --module my-module