Skip to content

An extension is a directory installed under ~/.m31a/extensions/<name>/ with a manifest named m31a-extension.json. The loader is packages/cli/src/config/extension.ts and extension-manager.ts.

Minimal manifest ​

json
{
  "name": "my-extension",
  "version": "1.0.0"
}

Both name and version are required.

Manifest fields ​

FieldTypePurpose
namestringRequired; validated on load.
versionstringRequired.
mcpServersobjectNamed MCP server definitions contributed by the extension.
contextFileNamestring or arrayAdditional context files.
excludeToolsarrayTools hidden while the extension is active.
settingsarrayUser-configurable settings with ${...} variables.
themesarrayCustom theme definitions.
plan.directorystringPlan artifact directory; must be relative and cannot contain ...
migratedTostringMigration marker.

A setting entry has name, description, envVar, and optional sensitive. Sensitive values go to the OS keychain; other values go to the extension's .env file. Workspace values take precedence over user values.

${...} variables in the manifest are hydrated from extensionPath, workspacePath, the path separator, and /.

Contribution directories ​

These are discovered from the extension folder rather than declared in the manifest:

PathContribution
skills/Agent skills with SKILL.md.
agents/Agent definitions.
hooks/hooks.jsonHook definitions shaped as { "hooks": { "<Event>": [...] } }, loaded only when hooksConfig.enabled is true.
commands/*.tomlCustom slash commands.
policies/*.tomlPolicy rules. Extension rules cannot grant allow or YOLO.

Themes are declared in the manifest's themes array.

Install metadata ​

Installed extensions contain .m31a-extension-install.json:

json
{
  "source": "https://github.com/owner/repo.git",
  "type": "git",
  "ref": "main",
  "autoUpdate": true
}

type is git, local, link, or github-release; GitHub release installs also store releaseTag. Source options include allowPreRelease. A lock file is created as <extensionsDir>/<name>.lock via proper-lockfile.

Managing extensions ​

bash
m31a extensions install <source>
m31a extensions list
m31a extensions link <path>
m31a extensions validate <path>
m31a extensions update [name]
m31a extensions disable <name>
m31a extensions enable <name>

Use m31a -e <list> to limit which extensions load for one invocation and -l to list them. In the TUI, /extensions provides explore, reload, and config in addition to the CLI operations.

Security ​

  • Review hook and MCP definitions as executable code.
  • security.blockGitExtensions blocks Git-based installs; security.allowedExtensions restricts sources by regular expression.
  • Admin settings under admin.extensions can enforce organization policy.

Next steps ​

See Extensions and the bundled examples under packages/cli/src/commands/extensions/examples/.

Built with VitePress. Powered by NVIDIA NIM.