The botnexus command-line tool provides quick access to configuration and agent management without editing config.json manually.
There is no globally installed botnexus binary yet. To use the CLI, create a shell alias that runs dotnet run against the CLI project and forwards your arguments.
Add this to your PowerShell profile ($PROFILE):
function botnexus { dotnet run --project D:\repos\botnexus\src\gateway\BotNexus.Cli -- @args }Replace
D:\repos\botnexuswith the path where you cloned the repository.
Reload the profile:
. $PROFILEAdd this to ~/.bashrc, ~/.zshrc, or equivalent:
alias botnexus='dotnet run --project ~/repos/botnexus/src/gateway/BotNexus.Cli --'Reload:
source ~/.bashrc # or source ~/.zshrcbotnexus --helpYou should see the root command help listing all available subcommands.
Tip: The
--separator is required so that arguments like--verboseare passed to the CLI app and not interpreted bydotnet run.
- Global Options
- install — Clone the repository
- build — Build the solution
- serve — Start a service (gateway or probe)
- validate — Validate configuration
- init — Initialize home directory
- agent list — List configured agents
- agent add — Add an agent
- agent remove — Remove an agent
- config get — Read a config value
- config set — Set a config value
- config schema — Generate JSON schema
- provider — Show or set up providers
- provider setup — Interactive provider setup wizard
- provider list — List configured providers
- provider add — Add or update a provider non-interactively (scripts and CI)
- provider remove — Remove a provider non-interactively
- prompt — Manage prompt templates
- prompt list — List available prompt templates
- prompt render — Render a prompt template
- prompt run — Render and execute a prompt template
- Examples
All commands support these options:
Show additional command output, including file paths and full JSON responses.
botnexus init --verbose
botnexus agent list --verboseClone the BotNexus repository and optionally build it. There is no separate install process — BotNexus runs directly from a cloned repository.
botnexus install [OPTIONS]| Option | Default | Description |
|---|---|---|
--path <DIR> |
%USERPROFILE%\botnexus |
Target directory for the clone. |
--repo <URL> |
GitHub repo URL | Git repository URL to clone. |
--build |
off | Build the solution in Release configuration after cloning. |
--verbose |
— | Show detailed output from git and build. |
Clone to the default location:
botnexus installClone and build in one step:
botnexus install --buildClone to a custom directory:
botnexus install --path D:\projects\botnexusIf the repository already exists at the target path, the command prints a message and skips the clone.
Build the BotNexus source projects in Release configuration. Test projects are skipped to keep the build fast. Always produces a Release build so that output assemblies don't conflict with Debug builds used during local development and testing.
botnexus build [OPTIONS]| Option | Default | Description |
|---|---|---|
--path <DIR> |
Install location | Path to the repository root. |
--dev |
off | Use the current working directory as the repo root instead of the install location. |
--verbose |
— | Show full build output. |
The build command resolves the repo root in this order:
--path— explicit path always wins--dev— uses the current working directory (for working in a separate dev clone)- Default —
%USERPROFILE%\botnexus(the install location)
Build from the default install location:
botnexus buildBuild from a dev clone (current directory):
cd D:\repos\botnexus
botnexus build --devBuild a specific repo path:
botnexus build --path D:\repos\botnexusStart a BotNexus service. Defaults to the gateway if no subcommand is specified. The serve command builds the source projects (Release, skipping tests), deploys extensions to ~/.botnexus/extensions/, checks port availability, and starts the process.
If the process exits or crashes, serve waits 5 seconds and restarts automatically. Press q during the countdown to quit instead.
botnexus serve [OPTIONS]
botnexus serve gateway [OPTIONS]
botnexus serve probe [OPTIONS]Start the BotNexus Gateway.
| Option | Default | Description |
|---|---|---|
--port <PORT> |
5005 |
Port to listen on. |
--path <DIR> |
Install location | Path to the repository root. |
--dev |
off | Use the current working directory as the repo root. |
--verbose |
— | Show detailed output. |
Start the BotNexus Probe diagnostic tool.
| Option | Default | Description |
|---|---|---|
--port <PORT> |
5050 |
Port for the Probe web UI. |
--path <DIR> |
Install location | Path to the repository root. |
--dev |
off | Use the current working directory as the repo root. |
--gateway-url <URL> |
http://localhost:5005 |
URL of a running BotNexus Gateway. |
--verbose |
— | Show detailed output. |
Start the gateway from the install location:
botnexus serveStart the gateway from a dev clone:
cd D:\repos\botnexus
botnexus serve --devStart the gateway on a custom port:
botnexus serve gateway --port 8080Start the probe connected to a running gateway:
botnexus serve probe --gateway-url http://localhost:5005| Scenario | Command |
|---|---|
| Run from the default install clone | botnexus serve |
| Run from your active dev repo | botnexus serve --dev |
| Build and serve in one flow | botnexus build --dev && botnexus serve --dev |
Both modes produce Release builds so the gateway DLLs don't collide with Debug builds from your IDE or test runner.
Validate the BotNexus configuration file.
botnexus validate [OPTIONS]| Option | Description |
|---|---|
--remote |
Validate using the running gateway /api/config/validate endpoint instead of local files. |
--gateway-url <URL> |
Override the gateway base URL for remote validation (default: http://localhost:5005). |
--verbose |
Show detailed validation output. |
Local validation (offline):
botnexus validateExpected output (success):
Configuration is valid.
Remote validation (requires running gateway):
botnexus validate --remoteCustom gateway URL:
botnexus validate --remote --gateway-url http://api.example.com:8080Initialize ~/.botnexus/ with a default configuration and required directories.
Creates:
~/.botnexus/config.json— default platform configuration~/.botnexus/agents/— agent workspace directories~/.botnexus/sessions/— session storage~/.botnexus/tokens/— OAuth token storage~/.botnexus/logs/— log directory
botnexus init [OPTIONS]| Option | Description |
|---|---|
--force |
Overwrite existing config.json. Use with caution. |
--verbose |
Show the full default configuration in JSON format. |
First-time initialization:
botnexus initExpected output:
Initialized BotNexus home at: C:\Users\<YourName>\AppData\Local\BotNexus
Created config: C:\Users\<YourName>\AppData\Local\BotNexus\config.json
Next steps:
- botnexus validate
- botnexus agent list
See the default config:
botnexus init --verboseDisplays the JSON configuration that was created (or would be created if --force is used).
Reinitialize (overwrite existing):
botnexus init --forceList all configured agents from config.json.
botnexus agent list [OPTIONS]| Option | Description |
|---|---|
--verbose |
Show the full config file path. |
List agents:
botnexus agent listExpected output:
Agents:
assistant provider=copilot model=gpt-4.1 enabled=true
coder provider=openai model=gpt-4 enabled=true
reviewer provider=anthropic model=claude-3-sonnet enabled=false
Verbose output (shows config file path):
botnexus agent list --verboseAgents:
assistant provider=copilot model=gpt-4.1 enabled=true
Loaded from: C:\Users\<YourName>\AppData\Local\BotNexus\config.json
Add a new agent to the configuration.
botnexus agent add <ID> [OPTIONS]| Argument | Description |
|---|---|
<ID> |
Unique agent identifier (e.g., assistant, coder, reviewer). |
| Option | Default | Description |
|---|---|---|
--provider |
github-copilot |
Agent provider name (must match a configured provider; e.g. github-copilot, openai, anthropic, or any provider added via botnexus provider add). |
--model |
gpt-4.1 |
Model name for this agent (e.g., gpt-4o, claude-3-sonnet). |
--enabled |
true |
Whether the agent is enabled (true or false). |
--verbose |
— | Show the updated configuration. |
Add an agent with defaults:
botnexus agent add coderOutput:
Added agent 'coder'.
Add an agent with custom provider and model:
botnexus agent add researcher --provider openai --model gpt-4oAdd a disabled agent:
botnexus agent add experimental --provider anthropic --model claude-3-sonnet --enabled falseVerbose output (see updated config):
botnexus agent add assistant --verboseShow the resolved configuration for a single agent.
botnexus agent show <ID> [OPTIONS]| Argument | Description |
|---|---|
<ID> |
Agent ID to inspect. |
| Option | Description |
|---|---|
--json |
Emit raw JSON instead of a formatted table. Useful for scripts and CI. |
--target <DIR> |
BotNexus home directory. Defaults to ~/.botnexus. |
--verbose |
Print the source config path under the table. |
Inspect an agent in table form:
botnexus agent show assistantPipe agent config to jq:
botnexus agent show assistant --json | jq .model| Code | Meaning |
|---|---|
0 |
Agent found and printed. |
1 |
Config missing/invalid or agent ID not found. |
Remove an agent from the configuration.
botnexus agent remove <ID> [OPTIONS]| Argument | Description |
|---|---|
<ID> |
Agent identifier to remove. |
| Option | Description |
|---|---|
--verbose |
Show the updated configuration. |
Remove an agent:
botnexus agent remove experimentalOutput:
Removed agent 'experimental'.
Warning if removing the default agent:
botnexus agent remove assistantOutput (warning):
Warning: removing default agent 'assistant'. Update gateway.defaultAgentId if needed.
Removed agent 'assistant'.
Read a configuration value by its dotted key path.
botnexus config get <KEY> [OPTIONS]| Argument | Description |
|---|---|
<KEY> |
Dotted path to config value (e.g., gateway.listenUrl, agents.assistant.model). |
| Option | Description |
|---|---|
--verbose |
Show additional context. |
Get the gateway listen URL:
botnexus config get gateway.listenUrlOutput:
http://localhost:5005
Get an agent's model:
botnexus config get agents.assistant.modelOutput:
gpt-4.1
Get a nested value:
botnexus config get gateway.defaultAgentIdOutput:
assistant
Set a configuration value by its dotted key path.
botnexus config set <KEY> <VALUE> [OPTIONS]| Argument | Description |
|---|---|
<KEY> |
Dotted path to config value (e.g., gateway.listenUrl). |
<VALUE> |
New value (as a string). For booleans, use true or false. |
| Option | Description |
|---|---|
--verbose |
Show the updated value after setting. |
Change the default agent:
botnexus config set gateway.defaultAgentId coderOutput:
Set gateway.defaultAgentId = coder
Change the gateway listen URL:
botnexus config set gateway.listenUrl http://localhost:8080Output:
Set gateway.listenUrl = http://localhost:8080
Enable an agent:
botnexus config set agents.coder.enabled trueOutput:
Set agents.coder.enabled = true
Disable an agent:
botnexus config set agents.reviewer.enabled falseOutput:
Set agents.reviewer.enabled = false
Generate a JSON schema file for the platform configuration model.
botnexus config schema [OPTIONS]| Option | Default | Description |
|---|---|---|
--output |
docs\botnexus-config.schema.json |
Output file path for the generated schema. |
--verbose |
— | Show the generated schema content. |
Generate schema (default path):
botnexus config schemaOutput:
Generated schema: docs\botnexus-config.schema.json
Custom output path:
botnexus config schema --output my-schema.jsonShow provider status or start the setup wizard. When run without a subcommand, shows configured providers if any exist, otherwise launches the setup wizard.
botnexus provider [OPTIONS]| Option | Description |
|---|---|
--verbose |
Show full provider configuration JSON. |
Check provider status:
botnexus providerIf no providers are configured, this automatically starts the setup wizard.
Interactive wizard that walks you through adding and authenticating a new LLM provider.
The wizard:
- Asks which provider to configure (GitHub Copilot, OpenAI, or Anthropic)
- Authenticates — OAuth device code flow for Copilot, API key prompt for others
- Presents available models and lets you pick a default
- Saves the provider to
config.json(and OAuth tokens toauth.json)
botnexus provider setup [OPTIONS]| Option | Description |
|---|---|
--target <DIR> |
BotNexus home directory (config, workspace, extensions). Defaults to ~/.botnexus. |
--provider <NAME> |
Pre-select the provider (github-copilot, openai, or anthropic) and skip the interactive provider-selection prompt. Useful for scripting and integration tests where the rest of the flow (API-key prompt, OAuth device-code flow) is still exercised but the first prompt is suppressed. |
--verbose |
Show the saved provider configuration in JSON. |
Set up GitHub Copilot (OAuth):
botnexus provider setupExample session:
? Which provider do you want to configure?
> GitHub Copilot (OAuth — free with GitHub account)
OpenAI (API key required)
Anthropic (API key required)
Configuring github-copilot...
──────────── GitHub Authorization Required ────────────
1. Open: https://github.com/login/device
2. Enter code: ABCD-1234
────────────────────────────────────────────────────────
✓ OAuth credentials saved to auth.json
? Select a default model:
> gpt-4.1 — GPT-4.1
claude-sonnet-4.5 — Claude Sonnet 4.5
gpt-5.4 — GPT-5.4
...
Default model: gpt-4.1
✓ Provider github-copilot configured successfully.
Config saved to: C:\Users\<YourName>\.botnexus\config.json
Set up OpenAI (API key):
botnexus provider setupSelect "OpenAI" and enter your API key when prompted. The key is stored directly in config.json.
List all configured providers in a table.
botnexus provider list [OPTIONS]| Option | Description |
|---|---|
--verbose |
Show additional detail. |
List providers:
botnexus provider listExample output:
┌─────────────────┬─────────┬───────┬───────────────┬─────────┐
│ Provider │ Enabled │ Auth │ Default Model │ Base URL│
├─────────────────┼─────────┼───────┼───────────────┼─────────┤
│ github-copilot │ Yes │ OAuth │ gpt-4.1 │ default │
│ openai │ Yes │ sk-… │ gpt-4o │ default │
└─────────────────┴─────────┴───────┴───────────────┴─────────┘
Add or update a provider entry in config.json non-interactively. Designed for scripts, CI, and integration tests that need to configure providers without the interactive wizard.
When a provider with the given --name already exists, only the flags you pass are updated; unspecified fields preserve their previous values. To clear a previously-set value, pass an empty string explicitly.
botnexus provider add --name <NAME> [OPTIONS]| Option | Description |
|---|---|
--name <NAME> |
Required. Provider name (e.g. openai, integration-mock). |
--api <API> |
API contract this provider handles. One of openai-completions (default), openai-responses, anthropic-messages, integration-mock. |
--api-key <KEY> |
API key value, or auth:<name> to reference an OAuth entry in auth.json. |
--base-url <URL> |
Base URL for OpenAI-compatible endpoints, or catalog file path for integration-mock. |
--default-model <ID> |
Default model id for this provider. |
--model <ID> |
Allowed model id. Repeatable. Omit to allow all models registered for this provider. |
--disabled |
Add the provider in disabled state. Disabled providers are hidden from the API. |
--target <PATH> |
BotNexus home directory. Defaults to ~/.botnexus. |
--verbose |
Print the serialized provider entry after save. |
Add an OpenAI provider:
botnexus provider add --name openai --api-key sk-... --default-model gpt-4oAdd the integration-mock provider for tests (uses built-in HELLO_WORLD catalog):
botnexus provider add --name integration-mock --api integration-mock --default-model integration-mock-echoAdd an OpenAI-compatible local endpoint with a restricted model list:
botnexus provider add --name local-vllm `
--api openai-completions `
--base-url http://localhost:8000/v1 `
--api-key not-needed `
--model llama-3-8b --model llama-3-70b `
--default-model llama-3-8bRemove a provider entry from config.json non-interactively. Returns exit code 0 even if the named provider does not exist (idempotent).
botnexus provider remove --name <NAME> [OPTIONS]| Option | Description |
|---|---|
--name <NAME> |
Required. Provider name to remove. |
--target <PATH> |
BotNexus home directory. Defaults to ~/.botnexus. |
--verbose |
Print remaining provider count after removal. |
botnexus provider remove --name integration-mockManage prompt templates — define reusable, parameterized prompts in configuration and execute them through the CLI or cron scheduler.
Getting Started: Run botnexus prompt create samples to copy bundled sample templates into ~/.botnexus/prompts/, then customize them for your workflows.
Format Guide:
.prompt.md(recommended for multi-line prompts) — YAML front matter + Markdown body for readable, maintainable templates.prompt.json(supported for compatibility and machine-generated) — Single-file JSON format for simple prompts
botnexus prompt [COMMAND] [OPTIONS]list— List available prompt templatesrender— Render a template to stdout (substitute parameters)run— Render and execute a template against the gatewaycreate samples— Copy bundled sample templates into~/.botnexus/prompts/
List all available prompt templates for an agent.
Displays templates from two sources:
- Configuration-based templates — Defined in
config.jsonunderpromptTemplates - File-based templates — Stored in
~/.botnexus/prompts/directory as.prompt.mdor.prompt.jsonfiles
botnexus prompt list [OPTIONS]| Option | Description |
|---|---|
--agent <ID> |
Target agent ID. Falls back to gateway.defaultAgentId if not specified. |
--config <PATH> |
Explicit path to config.json. Defaults to ~/.botnexus/config.json. |
--target <DIR> |
BotNexus home directory (config, workspace, extensions). Defaults to ~/.botnexus/. |
--verbose |
Show full paths and template metadata. |
List templates for the default agent:
botnexus prompt listOutput:
daily-standup
weekly-status
code-review-summary
customer-feedback-analysis
List templates for a specific agent:
botnexus prompt list --agent analystVerbose output with descriptions:
botnexus prompt list --verboseRender a template to stdout, substituting parameters with caller-provided values or defaults.
Use this to preview what a template will produce before executing it through the gateway.
botnexus prompt render <TEMPLATE> [OPTIONS]| Argument | Description |
|---|---|
<TEMPLATE> |
Template name to render. |
| Option | Description |
|---|---|
--param <KEY=VALUE> |
Template parameter as key=value. Repeat for multiple values. |
--agent <ID> |
Target agent ID. Falls back to gateway.defaultAgentId if not specified. |
--config <PATH> |
Explicit path to config.json. Defaults to ~/.botnexus/config.json. |
--target <DIR> |
BotNexus home directory (config, workspace, extensions). Defaults to ~/.botnexus/. |
--verbose |
Show rendering metadata (agent, parameters used). |
Render a template with default parameters:
botnexus prompt render daily-standupOutput:
Provide a brief status update for the engineering team.
Project: BotNexus
Owner: Development Team
Format: Markdown
Render with custom parameter values:
botnexus prompt render weekly-status --param project=Infrastructure --param owner="Leela"Output:
Provide a weekly status update for the Infrastructure team.
Project: Infrastructure
Owner: Leela
Multiple parameters:
botnexus prompt render code-review-summary `
--param repo=botnexus `
--param prNumber=242 `
--param reviewer=HermesCapture rendered template to a file:
botnexus prompt render daily-standup > prompt.txtRender a template and send the result to the gateway for agent execution.
Combines template rendering with agent invocation in a single command. Useful for triggering agent workflows from scripts or cron jobs.
botnexus prompt run <TEMPLATE> [OPTIONS]| Argument | Description |
|---|---|
<TEMPLATE> |
Template name to render and execute. |
| Option | Description |
|---|---|
--param <KEY=VALUE> |
Template parameter as key=value. Repeat for multiple values. |
--agent <ID> |
Target agent ID. Falls back to gateway.defaultAgentId if not specified. |
--session <ID> |
Optional session ID for conversation continuity. If omitted, a new session is created. |
--config <PATH> |
Explicit path to config.json. Defaults to ~/.botnexus/config.json. |
--target <DIR> |
BotNexus home directory (config, workspace, extensions). Defaults to ~/.botnexus/. |
--gateway-url <URL> |
Override gateway URL. Defaults to gateway.listenUrl from config (or http://localhost:5005). |
--verbose |
Show rendering and execution details. |
Execute a template with default parameters:
botnexus prompt run daily-standupOutput:
[Agent response...]
Engineering team is on track with all Q1 deliverables.
Three items in progress, two completed this week.
Execute with custom parameters:
botnexus prompt run weekly-status --param project=Gateway --param owner=BenderExecute within an existing session (conversation continuity):
botnexus prompt run daily-standup --session my-session-123Execute against a non-default gateway:
botnexus prompt run daily-standup --gateway-url http://production.example.com:5005Verbose execution:
botnexus prompt run code-review-summary --param repo=botnexus --verboseOutput includes:
[dim]Rendering template 'code-review-summary' with agent 'assistant'...[/]
[dim]Rendered template and invoked http://localhost:5005/api/chat[/]
[Agent response...]
1. Clone and build:
botnexus install --build2. Initialize home directory:
botnexus init3. Set up a provider:
botnexus provider setup4. List default agents:
botnexus agent list5. Validate configuration:
botnexus validate6. Start the gateway:
botnexus serveChange the listening port:
# Update config
botnexus config set gateway.listenUrl http://localhost:8080
# Validate
botnexus validate
# Restart gateway (required for port changes)
.\scripts\start-gateway.ps1 -Port 8080Manage multiple agents:
# List current agents
botnexus agent list
# Add a new agent
botnexus agent add researcher --provider openai --model gpt-4o
# Switch the default agent
botnexus config set gateway.defaultAgentId researcher
# Verify
botnexus agent list
botnexus validateConfiguration keys use dotted notation: section.subsection.key
# Gateway settings
botnexus config get gateway.listenUrl
botnexus config get gateway.defaultAgentId
# Agent settings
botnexus config get agents.assistant.model
botnexus config get agents.assistant.enabledMost config changes are applied immediately when the Gateway is running:
- Agent properties (enabled, model, provider)
- Provider settings
- Default agent ID
gateway.listenUrl(port binding)
| OS | Default Path |
|---|---|
| Windows | %LOCALAPPDATA%\BotNexus\config.json |
| macOS/Linux | ~/.botnexus/config.json |
| Custom | $env:BOTNEXUS_HOME/config.json |
Override with environment variable:
$env:BOTNEXUS_HOME = "C:\custom\botnexus"
botnexus agent listMost commands return:
0— Success1— Error (check console output for details)
botnexus update check uses status-style exit codes for automation:
0— Up to date1— Updates available2— Check failed (for example, git fetch error)
- Configuration Guide — Complete configuration reference
- Getting Started — Onboarding guide
- Developer Guide — Dev workflow and scripts