CLI
ayjnt ships one CLI with five subcommands. This is the per-command reference.
Invocation
Run via bunx ayjnt <subcommand> from any directory,
or through a project package.json script (scaffolded by ayjnt new). The CLI operates on the current working
directory by default; override with --cwd <path>.
Global flags
| Flag | Meaning |
|---|---|
--cwd <path> | Project root (default: process.cwd()) |
--force |
Only meaningful for deploy. Skips git preflight.
|
-h, --help | Print usage. |
Any flag ayjnt doesn't recognize is passed through to wrangler. So ayjnt dev --port 9000 forwards --port 9000
to wrangler dev.
ayjnt new
ayjnt new <directory> [--with-ui]
Scaffolds a new ayjnt project at <directory>.
Fails if the directory already exists.
| Flag | Effect |
|---|---|
--with-ui |
Include react, react-dom, and a
counter app.tsx. Without it, you get a minimal
ChatAgent with no UI.
|
What gets created
my-app/
├── agents/
│ └── chat/agent.ts # (or counter/agent.ts + app.tsx with --with-ui)
├── package.json # with dev/build/deploy/migrate scripts
├── tsconfig.json # path aliases pre-wired
├── .gitignore # .ayjnt/* except migrations.json
└── README.mdExit codes
0— scaffolded successfully.-
1— directory already exists, or argument validation failed.
ayjnt dev
ayjnt dev [wrangler-flags...]
Runs the codegen pipeline then spawns wrangler dev
pointed at .ayjnt/dist/wrangler.jsonc. Watches agents/ for structural changes and re-runs codegen on
the fly.
What gets watched
Any file under agents/ matching **/agent.ts, **/middleware.ts, or **/app.tsx. Structural changes — adding a new agent
folder, renaming, deleting — trigger a 150ms-debounced rebuild.
Wrangler itself picks up changes to the compiled worker and assets. Content-only edits (changing the body of an agent method) are reloaded by wrangler without ayjnt needing to do anything.
Forwarded wrangler flags
Common ones that just pass through:
--port <port>— default 8787--host <host>— default localhost--ip <ip>— bind to a specific interface--remote— run the worker on Cloudflare infrastructure instead of locally
Exit codes
0— wrangler exited cleanly.- wrangler's exit code — propagated if wrangler fails.
ayjnt build
ayjnt buildPure codegen, no deploy. Writes:
.ayjnt/dist/entry.ts(worker entrypoint).ayjnt/dist/wrangler.jsonc.ayjnt/tsconfig.json(path aliases).ayjnt/env.d.ts(GeneratedEnv).ayjnt/client/<route>/index.tsx(typed useAgent hooks).ayjnt/assets/__ayjnt/<route>/{index.html, app.js}(bundled UIs)
Also updates .ayjnt/migrations.json and writes it
to disk if the file tree has diverged from the lockfile. This
is the one command that mutates the committed lockfile — ayjnt dev calls build internally so the
same happens during dev.
Exit codes
0— success.1— codegen failed (scan found duplicates, parser rejected an agent.ts, etc.).
ayjnt migrate
ayjnt migrate
Shows the pending migration — what would be staged on the
next ayjnt build. Writes nothing. Useful for
reviewing renames/deletes before you commit.
$ bun run migrate
Pending migration: v3 (2026-04-14T12:15:00Z)
~ renamed:
ChatAgent -> TalkAgent (agentId: chat)
- deleted (storage will be destroyed):
OldAgent (agentId: old_agent)
Run `ayjnt build` to stage this migration in .ayjnt/migrations.json.ayjnt deploy
ayjnt deploy [--force] [wrangler-flags...]
Git preflight → re-build without writing lockfile changes → wrangler deploy. The one command you should only run
when your working tree is committed and pushed. See
Deployment
for the full walk-through.
Preflight checks
git status --porcelainempty- Local branch not ahead of
origin/<branch> - Origin not ahead of local
- No pending migration that hasn't been committed
Flags
| Flag | Effect |
|---|---|
--force | Skip all preflight. For emergencies. Loud. |
--env <name> |
Pass through to wrangler. Deploys to the named environment
(staging, production, etc.).
|
--dry-run | Pass through to wrangler. Validates the config without uploading. |
Exit codes
0— deployed.1— preflight failure (ayjnt side).- wrangler's exit code — deploy itself failed.
Help
ayjnt -h or ayjnt --help prints the
master usage block:
ayjnt <command> [options]
Commands:
new <dir> Scaffold a new ayjnt project (--with-ui for a React starter)
dev Start a local development server (wraps wrangler dev)
build Generate config + bundle, no deploy
deploy Build and deploy to Cloudflare (wraps wrangler deploy)
migrate Preview pending migrations from file tree vs lockfile
Global options:
-h, --help Show this help
--cwd <path> Project root (default: process.cwd())