CLI Reference

Module Commands

Reference for AntelopeJS module commands — scaffold new modules and run test suites.

Overview

The ajs module command group provides tools for module development. You use these commands to scaffold new modules from templates and to run module tests.

ajs module init

Create a new module from a template. The command clones a template repository into the specified path and prepares the module structure for development.

ajs module init <path> [options]
ArgumentDescription
pathDirectory path where the module will be created
OptionDescription
--git <repo>URL of a custom template repository

Examples:

# Create a module in the modules directory
ajs module init ./modules/my-module

# Use a custom template repository
ajs module init ./modules/my-module --git https://github.com/your-org/module-template.git

The generated module includes the standard AntelopeJS module structure with source files, configuration, and test scaffolding. After initialization, add the module to your project with ajs project modules add.

ajs module init ./modules/auth
ajs project modules add ./modules/auth --mode local
Keep your modules in a modules/ directory within the project for a clean file structure. Use --mode local when adding them to the project configuration.

ajs module test

Run the test suite for a module. When no path is provided, the command runs tests for the module in the current directory.

ajs module test [path] [options]
ArgumentDescription
pathPath to the module directory (defaults to current dir)
OptionDescription
-f, --file <path>Specific test file to run (can be repeated)

Examples:

# Run all tests for a module
ajs module test ./modules/my-module

# Run tests in the current directory
ajs module test

# Run a specific test file
ajs module test ./modules/my-module -f tests/auth.test.ts

# Run multiple specific test files
ajs module test ./modules/my-module -f tests/auth.test.ts -f tests/session.test.ts
The -f flag can be specified multiple times to run a subset of test files. When omitted, the command discovers and runs all test files in the module.