Publishing

axon publish

Run from the module folder. Publishing inspects your src/ exports, writes module.d.ts, packages the source, and uploads it to the registry. Published versions are immutable.

Registry identity

Your module is published under your account scope:

axon publish   # → @you/discord on the registry

The name and version come from package.json. The scope comes from your Axon account.

What's included

node_modules/ is never included — it is reconstructed by bun install on the installing agent. The registry stores source only.

my-module/
├── node_modules/       # ✗ excluded
├── server/             # ✓ included
├── src/                # ✓ included
├── .env                # ✗ excluded
├── module.config.ts    # ✓ included
├── module.d.ts         # ✓ included (generated by prepare)
└── package.json        # ✓ included

What happens on install

When someone runs axon install @you/my-module, Axon exposes the source as node_modules/@you/my-module, incorporates package.json dependencies, resolves nested module dependencies, scans and plugs its tools into the agent, merges type declarations into the agent's axon.d.ts, and prints the env keys the module needs.

The agent author installs one thing. Everything composes automatically.

Versioning

The registry uses semver, and published versions are immutable — once a version is on the registry it cannot be overwritten. Bump the version before each publish.

Declaring env requirements

Env keys declared in module.config.ts are printed at install time:

discord needs these environment keys:
 DISCORD_BOT_TOKEN Bot token from the Discord developer portal.

Add these to your agent's .env after install.

The declaration drives the install prompt. The module validates at runtime with axon.env.require().