CLI Reference
Every bxAgents verb and its flags.
On this page
CLI Reference
Usage: boxlang module:bxAgents <verb> [options]
(or the shorter bxAgents <verb> [options] form - see Installation.)
Global flags
These are handled before verb dispatch and never reach a verb - they're only meaningful as the very first token, so they never collide with a verb's own same-named flag.
| Flag | Effect |
|---|---|
-h, --help, help | Print usage (every verb + description) and exit 0. Also printed (exit 1) if no verb is given at all. |
-v, --version | Print bxAgents v{version} and exit 0. |
Every verb accepts
--projectRoot=<path> (or a bare positional path as the first non-flag argument) to target a project other than the current directory. Precedence: --projectRoot flag > first positional argument > current working directory.
Argument syntax
Follows BoxLang's own documented CLI conventions:
| Form | Result |
|---|---|
--option | true |
--option=value / --option="quoted value" | value (surrounding quotes stripped) |
-o=value | short form with a value |
-o | short form, true |
-abc | combined shorthand: a, b, c all true |
--!option / --no-option | negation, false |
| anything else | a positional (the first becomes the project-root fallback) |
Repeated options: last one wins.
Verbs
Scaffold a new agent project.
Run the full build pipeline.
Run your project's own tests/specs via TestBox.
Launch a real boxlang-miniserver process.
Interactive REPL against the built agent.
One non-interactive turn - for scripting/CI.
Package a built project into a .bxa.
Ship to a real deployment target.
Hash a plaintext password for a webui users entry.
Pretty-print an existing manifest.json.
Remove a project's .build/ and dist/ output.
new
Scaffold a new agent project.
bxAgents new my-agent --model=openai/gpt-5 [--name=...] [--description=...]
--modelis required - aprovider/modelslug (see Agent.bx).--namedefaults to the target directory's own basename.- Refuses to run if the target already contains an
Agent.bx. - Creates
Agent.bx,instructions.md, every convention folder (empty), a ready-to-runtests/folder (tests/box.json+tests/specs/AgentSpec.bx), a.envdeclaringBOXLANG_HOME=.build/runtime(matchingserve's own scoped runtime home - see known limitations for exactly what this does and doesn't cover), and a.gitignore(.build/,dist/,.env). Never overwrites an existing.env/.gitignore. - Also runs
box installinside the newtests/folder, sobxAgents testworks immediately with no separatecd tests && box installstep. This is best-effort: ifboxisn't onPATHor the install fails,newstill succeeds - the message just tells you to run it yourself. Pass--skipInstallto opt out of this step entirely.
build
Run the full build pipeline.
bxAgents build [--environment=production] [--verbose]
Writes .build/app/ and .build/manifest.json. Fails with every collected validation error if the project is invalid.
--verboseprints one line per build phase live as it runs - what got resolved/discovered/validated, per-phase counts (models, tools, gateways, warnings, etc.), which agents ended up registered inconfig/WireBox.bxand under which names, whether aschedules/Scheduler.bxwas found, and a finalBuild completed in Xmstiming line. Useful for debugging a slow or unexpectedly-behaving build. Silent otherwise ---verbosecosts nothing when not passed.
test
Run your project's own tests/specs via TestBox.
bxAgents test
- Requires
testboxinstalled undertests/testbox(cd tests && box install). - Builds your agent against the
mockprovider by default (Agent.bx'stest()environment override) - no API key or network access needed. - Prints pass/fail/error/skipped counts plus one line per failure, and exits non-zero if anything failed.
serve
Launch a real boxlang-miniserver process pointed at .build/app.
bxAgents serve [--port=8080] [--host=0.0.0.0]
- Requires a prior
build- fails clearly if.build/appdoesn't exist. - Fails clearly if
boxlang-miniserverisn't found onPATH. - Writes
.build/miniserver.json(rewrites enabled,rewriteFileName: "index.bxm", health check on) before launching. - Scopes the server's own BoxLang runtime home to
.build/runtime(viaserverHome) rather than the shared~/.boxlangdefault, so each project's compiled-class cache and config overrides are isolated - andcleansweeps it for free, since it already wipes.buildwholesale.invoke --servergets this too, since it reusesserveinternally. This does not extend tochat/build/test/defaultinvoke- see known limitations.
chat
Interactive REPL against the built agent, using BoxLang's own MiniConsole for line reading.
bxAgents chat
- Requires a prior
build. - Loads
GeneratedAgentFactory.bxdirectly (no ColdBox/WireBox container involved) and callsbuildAgent()once per session - the exact same factoryserve's HTTP routes use, sochatand HTTP never diverge. - Type
exitorquitto leave. - Needs a real interactive TTY (
MiniConsoleshells out tosttyfor raw mode) - it will not work piped/non-interactively.
invoke
A single, non-interactive turn against the built agent: submit one message, print the response, exit. Exists for scripting/CI, where chat's TTY requirement is a hard blocker.
bxAgents invoke --message="What's the weather in Boston?" [--json]
bxAgents invoke --message="..." --server [--port=<port>]
- Requires a prior
build. - Default (no
--server): loadsGeneratedAgentFactory.bxdirectly (no ColdBox container, no HTTP) and calls the agent once - the same in-process pathchatuses internally, just without the REPL loop. Noserve/gateway prerequisite at all. --server: launches a real, throwawayboxlang-miniserverprocess (same asserve), sends the message as a real HTTP request through the project'stoAi()-exposed route, then shuts the server back down. Exercises the actual served path (ColdBox routing, interceptors, gateways) rather than the in-process shortcut. Requires agateways/*.bxentry with{ exposes: "agent", path: "..." }(see gateways) - fails clearly if none exists.--portdefaults to a free ephemeral port so it never collides with an already-runningserve.--jsonprints{"response": "..."}instead of the plain-text response.
package
Package a built project into a .bxa.
bxAgents package [--version=1.0.0]
- Requires a prior
build- reads.build/manifest.json; fails clearly if it's missing. --versiondefaults to1.0.0.- Writes
dist/{agentName}-{version}.bxa, a sibling.sha256, and a redactedmanifest.jsoncopy. See Deployment & Secrets.
deploy
Ship a built/packaged project to a real deployment target via the pluggable deploy/ convention.
bxAgents deploy --name=production
# or, the flag-only shorthand (local only):
bxAgents deploy --destination=/path/to/somewhere [--target=local]
--name=<entry>dispatches to whatever target the nameddeploy/<entry>.bx/.jsonentry declares (local,ssh,ftp,sftp,docker, ordigitalocean).- The flag-only form (
--target=local --destination=..., or no--targetat all) works with nodeploy/folder present - onlylocalsupports it; every other target requires a named entry, since it needs more configuration than a couple of flags can carry. local/ssh/ftp/sftprequire a priorpackage;docker/digitaloceanrequire a priorbuild(they build straight from.build/app).ftp/sftpneed thebx-ftpmodule installed alongside BX Agents (see Installation).
hash-password
Turn a plaintext password into the passwordHash value a webui entry's users block accepts.
bxAgents hash-password --password="correct horse battery staple"
--passwordis required.- Prints the hash to stdout -
pbkdf2$<iterations>$<salt>$<derivedKey>, PBKDF2-HMAC-SHA256, salted per call. Safe to commit: it's one-way, and hashing the same password twice yields two different (both valid) hashes. - Kept deliberately identical to the hasher the generated web UI itself uses to verify a sign-in - a hash produced here always verifies there.
inspect
Pretty-print an existing .build/manifest.json without rebuilding.
bxAgents inspect [--json]
- Requires a prior
build. - Prints agent name, model, environment, manifest version, generator name/version, and file count.
--jsonprints the raw manifest as JSON instead of the human-readable summary - useful for scripting.
clean
Remove a project's .build/ and dist/ output.
bxAgents clean
- Only ever removes
.buildanddist- source conventions (Agent.bx,tools/, etc.) are never touched. - Reports "Nothing to clean" if neither directory exists.