@rnbsolucoes/axion-code 0.1.69 → 0.1.70
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +469 -469
- package/npm/bin/axion.mjs +478 -478
- package/npm/releases/linux-x64/axion-code +0 -0
- package/npm/releases/win32-x64/axion-code.exe +0 -0
- package/package.json +44 -44
package/README.md
CHANGED
|
@@ -1,469 +1,469 @@
|
|
|
1
|
-
# Axion Code
|
|
2
|
-
|
|
3
|
-
Axion Code is the Go-first CLI agent harness for the Axion ecosystem. It brings
|
|
4
|
-
the Axion Agent runtime to the terminal with PREVC + A workflow state, Mythos
|
|
5
|
-
execution discipline, provider/model management, persistent sessions, shared
|
|
6
|
-
Axion Desktop configuration, native dotcontext support, and a Claude Code-style
|
|
7
|
-
TUI focused on agentic coding workflows.
|
|
8
|
-
|
|
9
|
-
This MVP follows the PREVC-P documentation package in `.context/`:
|
|
10
|
-
|
|
11
|
-
- Go core;
|
|
12
|
-
- PREVC + A / Mythos event rail;
|
|
13
|
-
- JSONL protocol for `run --json`;
|
|
14
|
-
- SQLite-first shared user session store;
|
|
15
|
-
- Claude Code-style terminal TUI powered by Bubble Tea;
|
|
16
|
-
- full-width chat layout with initial brand splash;
|
|
17
|
-
- provider catalog/profile foundation with mock and OpenRouter adapters;
|
|
18
|
-
- interactive slash palette and provider/model/permission menus;
|
|
19
|
-
- Axion Desktop fallback provider presets, including OpenAI-compatible and Anthropic-compatible endpoints;
|
|
20
|
-
- shared Axion Desktop/CLI provider, model and permission stores under `%USERPROFILE%\.axion`;
|
|
21
|
-
- Pi Agent assets in inspect/import-only mode;
|
|
22
|
-
- native dotcontext and MCP management posture;
|
|
23
|
-
- plan-scoped PREVC + A learning consolidation through `/learn`;
|
|
24
|
-
- shared plugin and native isolated subagent catalogs.
|
|
25
|
-
|
|
26
|
-
## MVP Commands
|
|
27
|
-
|
|
28
|
-
```powershell
|
|
29
|
-
axion-code
|
|
30
|
-
axion-code ask "Explique este projeto"
|
|
31
|
-
axion-code ask --provider openrouter --model google/gemini-2.5-flash-lite "Responda em uma linha"
|
|
32
|
-
axion-code run --json
|
|
33
|
-
axion-code doctor --json
|
|
34
|
-
axion-code init --json
|
|
35
|
-
axion-code init --project --json
|
|
36
|
-
axion-code session list --json
|
|
37
|
-
axion-code provider list --json
|
|
38
|
-
axion-code provider profile init
|
|
39
|
-
axion-code provider profile list --json
|
|
40
|
-
axion-code provider profile add or-free --catalog openrouter --model openrouter/free --credential-ref env:OPENROUTER_API_KEY
|
|
41
|
-
axion-code provider profile set or-free
|
|
42
|
-
axion-code provider profile delete or-free
|
|
43
|
-
axion-code provider profile active
|
|
44
|
-
axion-code provider model list openrouter --json
|
|
45
|
-
axion-code provider cost set openrouter --model openai/gpt-5-mini --max-usd 0.25 --input-usd-per-1m 0.25 --output-usd-per-1m 2 --max-output-tokens 4000
|
|
46
|
-
axion-code provider cost status --profile openrouter --model openai/gpt-5-mini --json
|
|
47
|
-
axion-code provider test openrouter google/gemini-2.5-flash-lite
|
|
48
|
-
axion-code permission list --json
|
|
49
|
-
axion-code permission set full_permission
|
|
50
|
-
axion-code permission inspect Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --json
|
|
51
|
-
axion-code permission request Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --json
|
|
52
|
-
axion-code permission approvals --decision pending --json
|
|
53
|
-
axion-code permission resolve <approval-id> --approve --reason "reviewed" --json
|
|
54
|
-
axion-code graphics doctor
|
|
55
|
-
axion-code graphics logo
|
|
56
|
-
axion-code graphics logo --mode sixel --width 180
|
|
57
|
-
axion-code mcp list --json
|
|
58
|
-
axion-code mcp add sample --command node --arg server.js
|
|
59
|
-
axion-code mcp enable sample
|
|
60
|
-
axion-code mcp disable sample
|
|
61
|
-
axion-code mcp remove sample
|
|
62
|
-
axion-code mcp import .\mcp-servers.json
|
|
63
|
-
axion-code plugins list --json
|
|
64
|
-
axion-code agents list --json
|
|
65
|
-
axion-code agents run bug-hunter "review this login flow"
|
|
66
|
-
axion-code agents run-many bug-hunter,performance-reviewer "review this login flow" --budget-tokens 2000 --stream
|
|
67
|
-
axion-code learn --json
|
|
68
|
-
axion-code memory status --json
|
|
69
|
-
axion-code memory recall "hooks safety" --json
|
|
70
|
-
axion-code memory curate --title "Pattern" --body "Apply this implementation pattern..." --json
|
|
71
|
-
axion-code hooks status --json
|
|
72
|
-
axion-code hooks add --event UserPromptSubmit --action inject --name Safety --content "Use trusted hook context only." --enabled
|
|
73
|
-
axion-code hooks enable
|
|
74
|
-
axion-code package inspect <path>
|
|
75
|
-
axion-code package self-check --json
|
|
76
|
-
```
|
|
77
|
-
|
|
78
|
-
## Install
|
|
79
|
-
|
|
80
|
-
Official install, after the package is published to the public npm registry:
|
|
81
|
-
|
|
82
|
-
```powershell
|
|
83
|
-
npm install -g @rnbsolucoes/axion-code
|
|
84
|
-
axion
|
|
85
|
-
```
|
|
86
|
-
|
|
87
|
-
The GitHub source repository can remain private. The npm package is intentionally
|
|
88
|
-
published as a small installer/runtime package: it contains the Node wrapper,
|
|
89
|
-
platform binaries under `npm/releases`, and documentation, but it does not ship
|
|
90
|
-
the Go source tree (`cmd/`, `internal/`, `go.mod`, `go.sum`).
|
|
91
|
-
|
|
92
|
-
Private GitHub install is not the recommended distribution path. Commands like
|
|
93
|
-
`npm install -g rnbsolucoes/Axion-CLI` use Git access and may require SSH keys or
|
|
94
|
-
credentials on every machine. Use the scoped npm package instead.
|
|
95
|
-
|
|
96
|
-
Development install from the current local clone:
|
|
97
|
-
|
|
98
|
-
```powershell
|
|
99
|
-
npm install -g .
|
|
100
|
-
axion
|
|
101
|
-
```
|
|
102
|
-
|
|
103
|
-
If an older local `axion.ps1` shim already exists, replace it once:
|
|
104
|
-
|
|
105
|
-
```powershell
|
|
106
|
-
npm install -g . --force
|
|
107
|
-
```
|
|
108
|
-
|
|
109
|
-
The npm package exposes both `axion` and `axion-code`. It does not use a
|
|
110
|
-
`postinstall` hook. On first run, the wrapper copies the packaged binary for the
|
|
111
|
-
current platform into the local Axion Code bin directory and then executes it. In
|
|
112
|
-
a source clone only, if no packaged binary exists, the wrapper can build from Go
|
|
113
|
-
as a development fallback.
|
|
114
|
-
|
|
115
|
-
### Terminal setup (multi-line composer)
|
|
116
|
-
|
|
117
|
-
In the chat composer, **Enter sends** and **Ctrl+J inserts a newline**. Terminals
|
|
118
|
-
do not report Shift+Enter or Ctrl+Enter as distinct keys to the app on Windows,
|
|
119
|
-
so those keys must be mapped to send a newline.
|
|
120
|
-
|
|
121
|
-
On the **first run**, Axion does this automatically for Windows Terminal: it maps
|
|
122
|
-
**Shift+Enter** and **Ctrl+Enter** to send a newline (only when those keys are
|
|
123
|
-
free — it never overwrites an existing binding), writes a `settings.json.axion-bak`
|
|
124
|
-
backup, and prints a one-line notice. Reopen the terminal tab to apply. This runs
|
|
125
|
-
at runtime (not via an npm `postinstall` hook) and only once, tracked by a marker
|
|
126
|
-
in the local bin directory.
|
|
127
|
-
|
|
128
|
-
Opt out with `AXION_SKIP_TERMINAL_SETUP=1`. Re-apply or repair anytime with:
|
|
129
|
-
|
|
130
|
-
```powershell
|
|
131
|
-
axion terminal-setup
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
On other terminals, bind Shift+Enter / Ctrl+Enter to send a newline (`\n`) manually.
|
|
135
|
-
|
|
136
|
-
To classify the currently executed binary for support or security review, run:
|
|
137
|
-
|
|
138
|
-
```powershell
|
|
139
|
-
axion package self-check --json
|
|
140
|
-
```
|
|
141
|
-
|
|
142
|
-
The self-check reports the executable path, real path, runtime version,
|
|
143
|
-
SHA-256, file size, package cache marker when present and a provenance
|
|
144
|
-
classification such as `npm-wrapper-cache`, `npm-package-release`,
|
|
145
|
-
`source-build` or `unknown-local-binary`. It is deterministic local
|
|
146
|
-
provenance, not a replacement for future Authenticode signing.
|
|
147
|
-
|
|
148
|
-
Requirements:
|
|
149
|
-
|
|
150
|
-
- Node.js 18+ for the npm wrapper.
|
|
151
|
-
- End users do not need Go when installing from npm.
|
|
152
|
-
- Development source builds need Go 1.26+ on `PATH`, `AXION_GO`, or the Codex
|
|
153
|
-
bundled Go toolchain at `%USERPROFILE%\.codex\toolchains\go1.26.4\go\bin\go.exe`.
|
|
154
|
-
|
|
155
|
-
For this development machine, if an older PowerShell shim still points directly
|
|
156
|
-
to `%LOCALAPPDATA%\AxionCode\bin\axion-code.exe`, rebuild the local binary:
|
|
157
|
-
|
|
158
|
-
```powershell
|
|
159
|
-
go build -o "$env:LOCALAPPDATA\AxionCode\bin\axion-code.exe" ./cmd/axion-code
|
|
160
|
-
```
|
|
161
|
-
|
|
162
|
-
## Publish
|
|
163
|
-
|
|
164
|
-
Build the npm package binaries before publishing:
|
|
165
|
-
|
|
166
|
-
```powershell
|
|
167
|
-
npm run build:npm-binaries:release
|
|
168
|
-
npm pack --dry-run
|
|
169
|
-
npm publish --access public
|
|
170
|
-
```
|
|
171
|
-
|
|
172
|
-
The npm account or organization must own the `@rnbsolucoes` scope. Scoped public
|
|
173
|
-
packages must be published with public access on the first publish.
|
|
174
|
-
The current release build targets Windows x64 and Linux x64. Add more targets by
|
|
175
|
-
running `node npm/build-package-binaries.mjs --targets=all` or a comma-separated
|
|
176
|
-
target list when those platforms are ready.
|
|
177
|
-
|
|
178
|
-
## Update
|
|
179
|
-
|
|
180
|
-
Check for a newer version:
|
|
181
|
-
|
|
182
|
-
```powershell
|
|
183
|
-
axion update --check
|
|
184
|
-
axion version --check
|
|
185
|
-
```
|
|
186
|
-
|
|
187
|
-
Update the installed CLI. This is the official update alias and must remain the
|
|
188
|
-
single command users run whenever a new Axion Code binary/package is released:
|
|
189
|
-
|
|
190
|
-
```powershell
|
|
191
|
-
axion update
|
|
192
|
-
```
|
|
193
|
-
|
|
194
|
-
The npm wrapper checks the public npm registry first and falls back to the GitHub
|
|
195
|
-
package metadata only when available. If a newer version exists, the initial
|
|
196
|
-
Axion Code splash shows the update notice and hides it after the first
|
|
197
|
-
interaction.
|
|
198
|
-
|
|
199
|
-
Without npm:
|
|
200
|
-
|
|
201
|
-
```powershell
|
|
202
|
-
go build -o "$env:LOCALAPPDATA\AxionCode\bin\axion-code.exe" ./cmd/axion-code
|
|
203
|
-
```
|
|
204
|
-
|
|
205
|
-
Provider catalog/configuration is shared with Axion Desktop, while the active
|
|
206
|
-
Axion Code selection is isolated:
|
|
207
|
-
|
|
208
|
-
```text
|
|
209
|
-
%USERPROFILE%\.axion\harness\providers.json
|
|
210
|
-
%USERPROFILE%\.axion\harness\active_profile # Axion Desktop active profile
|
|
211
|
-
%USERPROFILE%\.axion\harness\active_profile_cli # Axion Code active profile
|
|
212
|
-
%USERPROFILE%\.axion\harness\selection_cli.json # Axion Code active model/params
|
|
213
|
-
%USERPROFILE%\.axion\axion-mode.json
|
|
214
|
-
%USERPROFILE%\.axion\sessions\axion.db
|
|
215
|
-
%USERPROFILE%\.axion\mcp-servers.json
|
|
216
|
-
%USERPROFILE%\.axion\plugins.json
|
|
217
|
-
%USERPROFILE%\.axion\sub-agents.json
|
|
218
|
-
%USERPROFILE%\.axion\harness\cost-policy.json
|
|
219
|
-
```
|
|
220
|
-
|
|
221
|
-
OpenRouter uses `OPENROUTER_API_KEY` from the environment or a `secret:<NAME>` reference stored in `C:\Israel\Pesoal\secrets.env` (override for tests: `AXION_SECRETS_ENV`). Provider profile config stores only references, never the key value.
|
|
222
|
-
|
|
223
|
-
Provider-specific cost ceilings are stored outside the Desktop profile schema in
|
|
224
|
-
`%USERPROFILE%\.axion\harness\cost-policy.json`. Use `provider cost set` to
|
|
225
|
-
bind a ceiling and token prices to a profile or profile/model pair. The runtime
|
|
226
|
-
blocks a request before provider execution when the estimated input or configured
|
|
227
|
-
maximum output cost would exceed the ceiling. After a response, actual
|
|
228
|
-
input/output usage is converted to cost and surfaced in provider/subagent stream
|
|
229
|
-
telemetry; if actual cost exceeds the ceiling, the turn returns an explicit cost
|
|
230
|
-
ceiling error. A ceiling without token prices is not enforced, because Axion Code
|
|
231
|
-
does not infer provider pricing silently.
|
|
232
|
-
|
|
233
|
-
For test/dev isolation, set `AXION_HOME` to a temporary folder. In normal use,
|
|
234
|
-
leave it unset so Desktop and CLI share the same provider catalog while keeping
|
|
235
|
-
their active provider/model selections independent.
|
|
236
|
-
|
|
237
|
-
## Project Bootstrap
|
|
238
|
-
|
|
239
|
-
`axion-code init --json` bootstraps the shared user-level Axion home used by
|
|
240
|
-
Axion Desktop and Axion Code. It creates missing files under
|
|
241
|
-
`%USERPROFILE%\.axion` without overwriting Desktop-owned provider/model state.
|
|
242
|
-
|
|
243
|
-
`axion-code init --project --json` bootstraps the current workspace. The same
|
|
244
|
-
operation is available inside the TUI with `/init`. It creates only missing
|
|
245
|
-
project scaffolding:
|
|
246
|
-
|
|
247
|
-
```text
|
|
248
|
-
.brv/ local operational memory and PREVC + A learning buffers
|
|
249
|
-
.context/ workflow, plans, tasks, context snapshots and PREVC evidence
|
|
250
|
-
.docs/ project documents, specs, reports and handoff material
|
|
251
|
-
AGENTS.md project-scoped instructions
|
|
252
|
-
CLAUDE.md Claude-compatible project instructions
|
|
253
|
-
.gitignore ignored local runtime, secrets, cache and build-output patterns
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
If a legacy `docs/` directory exists and `.docs/` does not, project bootstrap
|
|
257
|
-
renames `docs/` to `.docs/`. If both exist, Axion Code leaves both untouched and
|
|
258
|
-
does not attempt an automatic merge.
|
|
259
|
-
|
|
260
|
-
Instruction layering is explicit: shared `%USERPROFILE%\.axion\AGENTS.md`
|
|
261
|
-
contains global Axion Code agent rules, while the workspace root `AGENTS.md`
|
|
262
|
-
contains project-specific rules. Provider runtime prompts read both layers when
|
|
263
|
-
present, plus `CLAUDE.md` as a compatibility surface.
|
|
264
|
-
|
|
265
|
-
The interactive TUI supports:
|
|
266
|
-
|
|
267
|
-
```text
|
|
268
|
-
/ inline slash palette
|
|
269
|
-
/init
|
|
270
|
-
/provider
|
|
271
|
-
/provider set <profile-id>
|
|
272
|
-
/model
|
|
273
|
-
/permission
|
|
274
|
-
/mcp
|
|
275
|
-
/learn
|
|
276
|
-
/memory
|
|
277
|
-
/hooks
|
|
278
|
-
/plugins
|
|
279
|
-
/agents
|
|
280
|
-
/agents run <id> <prompt>
|
|
281
|
-
/agents run-many <id,id,...> <prompt> [--budget-tokens <n>]
|
|
282
|
-
```
|
|
283
|
-
|
|
284
|
-
Slash palette behavior: `↑/↓` selects, `Tab` completes the selected command, `Enter` executes the selected command, `Esc` closes active menus/wizards.
|
|
285
|
-
|
|
286
|
-
`/model` pulls the active provider's `/models` endpoint when credentials are configured. Reasoning and fast-mode steps appear only when the selected model metadata exposes those parameters.
|
|
287
|
-
|
|
288
|
-
`/learn` consolidates plan-scoped learning from `.brv/plans/<plan-id>` and `.context/learning-candidates*.md`, filters low-signal material, deduplicates by content hash/summary and promotes relevant notes into native dotcontext at `<workspace>/.axion/context`.
|
|
289
|
-
|
|
290
|
-
`/memory` exposes the native project memory layer: `status`, `ensure`, `recall <query>` and `curate <text>`. Recall uses the local `.axion/context` note tree plus a SQLite FTS index and injects bounded `## Memoria recuperada` context into provider prompts without changing the visible/stored user message.
|
|
291
|
-
|
|
292
|
-
`/hooks` exposes Phase 1 native hooks. Hooks are stored in shared `%USERPROFILE%\.axion\hooks.json` and controlled by `%USERPROFILE%\.axion\hooks-config.json`, default OFF. `SessionStart` and `UserPromptSubmit` can inject trusted `<hook-context>` prompt context; `PostToolUse` and `Stop` are observe-only. Phase 1 does not execute shell commands or approve tools.
|
|
293
|
-
|
|
294
|
-
When the active plan comes from `.context/plans/*.md`, `/task add`, `/task done`
|
|
295
|
-
and `/task progress` update the Markdown plan file directly. Axion Code rewrites
|
|
296
|
-
only the target task line marker/progress and keeps the rest of the document
|
|
297
|
-
unchanged.
|
|
298
|
-
|
|
299
|
-
`/mcp` opens an inline MCP list. Enabled servers can be disabled, disabled servers can be enabled, and non-native servers can be uninstalled while preserving valid `mcp-servers.json` formatting.
|
|
300
|
-
|
|
301
|
-
`/agents` lists the native isolated subagents. `/agents run <id> <prompt>` calls one with an isolated prompt while inheriting the active provider/model from the main agent. `/agents run-many <id,id,...> <prompt> [--budget-tokens <n>]` runs up to eight isolated subagents in parallel, streams lifecycle/telemetry events into the TUI while the team runs, then returns their individual outputs plus a compact comparison and aggregate token usage. If the estimated isolated prompt input already exceeds the budget, no provider calls are executed.
|
|
302
|
-
|
|
303
|
-
## MCP, Plugins And Subagents
|
|
304
|
-
|
|
305
|
-
MCP import files use the same JSON array shape as `%USERPROFILE%\.axion\mcp-servers.json`:
|
|
306
|
-
|
|
307
|
-
```json
|
|
308
|
-
[
|
|
309
|
-
{
|
|
310
|
-
"id": "context7",
|
|
311
|
-
"name": "Context7",
|
|
312
|
-
"transport": "stdio",
|
|
313
|
-
"command": "npx",
|
|
314
|
-
"args": ["-y", "@upstash/context7-mcp"],
|
|
315
|
-
"enabled": false,
|
|
316
|
-
"read_only": true
|
|
317
|
-
}
|
|
318
|
-
]
|
|
319
|
-
```
|
|
320
|
-
|
|
321
|
-
`axion mcp import <file.json>` merges by `id`, preserves `native` protection for built-ins, writes formatted JSON, and rejects entries without `id` or without the required `command`/`url` for the selected transport. Native MCPs such as `dotcontext` cannot be removed, only disabled.
|
|
322
|
-
|
|
323
|
-
`axion mcp tools <id> [--json]` starts an enabled stdio MCP server, performs the MCP initialize handshake and returns the exact tools advertised by `tools/list`. This is the recommended smoke test for native MCPs before enabling provider tool calls, for example `axion mcp tools axion-dotcontext --json`.
|
|
324
|
-
|
|
325
|
-
The native Dotcontext MCP uses the current official package surface, `npx -y @dotcontext/mcp@latest`. Existing shared Axion homes are migrated from the deprecated `dotcontext` npm package to `@dotcontext/mcp@latest` during bootstrap while preserving local MCP status metadata. Because the native entry points at `@latest`, normal MCP startup pulls upstream Dotcontext server updates; Axion code changes are needed only when Dotcontext changes package names, tool contracts or Axion-specific integration policy.
|
|
326
|
-
|
|
327
|
-
Plugins are read from the same shared Axion Desktop file, `%USERPROFILE%\.axion\plugins.json`. The CLI can list, enable, disable and remove plugin records, but executable plugin installation remains intentionally gated for the next trust-policy cycle.
|
|
328
|
-
|
|
329
|
-
Subagents are stored in `%USERPROFILE%\.axion\sub-agents.json`. The initial catalog has 15 native entries:
|
|
330
|
-
|
|
331
|
-
- Programming: `code-reviewer`, `bug-hunter`, `security-reviewer`, `performance-reviewer`, `frontend-ux-reviewer`.
|
|
332
|
-
- Professional: `product-strategist`, `business-analyst`, `financial-analyst`, `legal-policy-reviewer`, `marketing-strategist`, `sales-ops-analyst`, `customer-success-advisor`, `data-analyst`, `operations-advisor`, `hr-talent-advisor`.
|
|
333
|
-
|
|
334
|
-
Execution contract: subagents inherit the active provider/model, receive an isolated prompt containing only their role and the requested task, do not access the main hidden context unless explicitly included in the prompt, and return findings/evidence/actions back to the main timeline.
|
|
335
|
-
|
|
336
|
-
## Approval And Sandbox Policy
|
|
337
|
-
|
|
338
|
-
`axion permission inspect` exposes the native Go approval policy without running
|
|
339
|
-
the tool. It classifies native tools, shell commands and MCP-proxied tools into
|
|
340
|
-
stable risk classes, reports whether the active permission mode would require
|
|
341
|
-
approval, redacts secret-shaped inputs and returns the sandbox profile that the
|
|
342
|
-
guarded dispatcher must use.
|
|
343
|
-
|
|
344
|
-
`axion permission request|approvals|resolve` adds the auditable approval queue.
|
|
345
|
-
Requests are persisted in the shared session database under
|
|
346
|
-
`%USERPROFILE%\.axion\sessions\axion.db` with the redacted decision, risk class,
|
|
347
|
-
permission mode, impact summary and pending/approved/denied state. This is the
|
|
348
|
-
headless contract used by the TUI approval menu and the future guarded
|
|
349
|
-
dispatcher before mutating filesystem, shell or MCP tools are enabled.
|
|
350
|
-
|
|
351
|
-
Provider stream `tool_call` events now open the TUI approval menu when the
|
|
352
|
-
active permission mode requires review. Approve/Deny records the audited
|
|
353
|
-
decision and returns focus to the chat input. When approved, the TUI executes
|
|
354
|
-
supported guarded-dispatcher tools and prints the bounded result in the
|
|
355
|
-
timeline. Successful supported tool results are then sent back into the active
|
|
356
|
-
provider as a follow-up `tool_result` continuation turn, so the agent can use
|
|
357
|
-
the evidence before answering. Unsupported tools remain explicitly pending until
|
|
358
|
-
a dedicated adapter exists.
|
|
359
|
-
|
|
360
|
-
`axion tool run` exposes the guarded dispatcher surface. The CLI and TUI
|
|
361
|
-
currently support workspace-local `Read`, `Glob`, `Grep`, `Write` and `Edit`,
|
|
362
|
-
governed `Shell`/`Bash`/`PowerShell` commands that run from a workspace
|
|
363
|
-
directory with timeout and bounded output, and enabled stdio MCP tools named as
|
|
364
|
-
`mcp__<server-id>__<tool-name>`. Provider tool aliases such as `read_file`,
|
|
365
|
-
`write_file` and `run_command` are normalized to native tool names before
|
|
366
|
-
approval/execution. When the active permission mode requires approval, execution
|
|
367
|
-
is allowed only if the supplied approval is already approved and matches the
|
|
368
|
-
exact redacted tool request. Remote MCP transports, browser, process and
|
|
369
|
-
unknown tools remain unsupported even when an approval exists.
|
|
370
|
-
|
|
371
|
-
Examples:
|
|
372
|
-
|
|
373
|
-
```powershell
|
|
374
|
-
axion permission inspect Read --mode approved_by_me --json
|
|
375
|
-
axion permission inspect Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --json
|
|
376
|
-
axion permission inspect mcp__serena__replace_symbol_body "{}" --mode full_permission --json
|
|
377
|
-
axion permission request Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --session smoke --turn turn-1 --json
|
|
378
|
-
axion permission approvals --session smoke --decision pending --json
|
|
379
|
-
axion permission resolve <approval-id> --deny --reason "not needed" --json
|
|
380
|
-
axion tool run Read "{\"path\":\"README.md\"}" --mode full_permission --json
|
|
381
|
-
axion tool run Write "{\"path\":\"notes/out.txt\",\"content\":\"approved\"}" --session smoke --turn turn-1 --approval <approval-id> --mode request_permission --json
|
|
382
|
-
axion tool run Shell "{\"command\":\"echo axion-shell\"}" --session smoke --turn turn-1 --approval <approval-id> --mode request_permission --json
|
|
383
|
-
axion mcp tools axion-dotcontext --json
|
|
384
|
-
# Shape: replace server/tool with an enabled MCP tool advertised by tools/list.
|
|
385
|
-
axion tool run mcp__your-server__list_items "{\"query\":\"PREVC\"}" --mode full_permission --json
|
|
386
|
-
```
|
|
387
|
-
|
|
388
|
-
Security invariants:
|
|
389
|
-
|
|
390
|
-
- `Full permission` skips only read and non-destructive write tiers.
|
|
391
|
-
- package install, network download/egress, destructive commands, process
|
|
392
|
-
control, shell commands, paid generation, browser actions, mutating MCP tools
|
|
393
|
-
and unknown tools still require approval under `Full permission`.
|
|
394
|
-
- `YOLO` is the only mode that bypasses every class, and remains explicit user
|
|
395
|
-
opt-in.
|
|
396
|
-
- unknown native tools are default-deny until they are classified.
|
|
397
|
-
- MCP tools are mutating by default; only read-shaped names such as `find_*`,
|
|
398
|
-
`get_*`, `list_*`, `search_*` and `*_overview` are downgraded to read-only.
|
|
399
|
-
The dispatcher validates that enabled stdio MCP servers advertise the target
|
|
400
|
-
tool through `tools/list` before calling `tools/call`.
|
|
401
|
-
|
|
402
|
-
Provider menu actions:
|
|
403
|
-
|
|
404
|
-
```text
|
|
405
|
-
Register provider
|
|
406
|
-
Edit provider
|
|
407
|
-
Set provider
|
|
408
|
-
Delete provider
|
|
409
|
-
```
|
|
410
|
-
|
|
411
|
-
For a profile-backed OpenRouter session:
|
|
412
|
-
|
|
413
|
-
```powershell
|
|
414
|
-
axion provider profile add or-free --catalog openrouter --model openrouter/free --credential-ref env:OPENROUTER_API_KEY
|
|
415
|
-
axion provider profile set or-free
|
|
416
|
-
axion
|
|
417
|
-
```
|
|
418
|
-
|
|
419
|
-
Nexus profiles share the same `%USERPROFILE%\.axion\harness\nexus-config.json`
|
|
420
|
-
used by Axion Desktop. The default `fusion` engine runs the existing
|
|
421
|
-
panel -> judge -> final flow. The `pcp` engine enables the text-only
|
|
422
|
-
Maestro/workers loop from the new Desktop Nexus provider:
|
|
423
|
-
|
|
424
|
-
```powershell
|
|
425
|
-
axion provider nexus status --profile nexus
|
|
426
|
-
axion provider nexus set --profile pcp-nexus --engine pcp --judge-kind sakana --judge sakana:fugu --image-provider imagehub --image-model image-default --video-provider videohub --video-model video-pro --exec3 mock:mock/worker --exec3-instruction "general text worker"
|
|
427
|
-
```
|
|
428
|
-
|
|
429
|
-
PCP in the CLI supports Maestro tool-calling with text workers `exec3` and
|
|
430
|
-
`exec4`, plus image/video slots exposed as internal PCP workers. Nexus streams
|
|
431
|
-
normalized lifecycle telemetry to the TUI for Fusion and PCP phases; internal
|
|
432
|
-
PCP worker dispatches stay private and do not surface as app-level tool
|
|
433
|
-
approvals. Image/video dispatch is refused unless permission mode is `yolo`;
|
|
434
|
-
even in `yolo`, the CLI currently returns a structured "media runtime
|
|
435
|
-
unavailable" tool result until the local media runtime lands. When Axion
|
|
436
|
-
Desktop saves PCP image/video slots as model-only capability references, the CLI
|
|
437
|
-
resolves the provider label from Desktop's `capability_selections` store on a
|
|
438
|
-
best-effort basis for status, audit metadata and worker labels.
|
|
439
|
-
|
|
440
|
-
## Build
|
|
441
|
-
|
|
442
|
-
```powershell
|
|
443
|
-
go test -count=1 ./...
|
|
444
|
-
go build ./cmd/axion-code
|
|
445
|
-
```
|
|
446
|
-
|
|
447
|
-
If Go is not on PATH, use a verified local Go toolchain and keep generated binaries out of git.
|
|
448
|
-
|
|
449
|
-
## Current Limits
|
|
450
|
-
|
|
451
|
-
This is a functional direction MVP, not the full harness:
|
|
452
|
-
|
|
453
|
-
- direct provider streaming exists for OpenAI-compatible chat completions,
|
|
454
|
-
OpenAI Responses and Anthropic Messages;
|
|
455
|
-
- Nexus supports the legacy Fusion engine and the new PCP Maestro/workers
|
|
456
|
-
engine with stream normalization, redacted audit surfacing, TUI Nexus
|
|
457
|
-
configuration, text workers and permission-gated image/video worker
|
|
458
|
-
placeholders; real CLI media generation remains deferred;
|
|
459
|
-
- terminal logo uses Sixel when available and falls back to width-bounded ANSI/block rendering;
|
|
460
|
-
- initial chat splash shows the Axion logo and system name until the first interaction;
|
|
461
|
-
- guarded dispatcher execution is limited to workspace-local `Read`, `Glob`,
|
|
462
|
-
`Grep`, `Write` and `Edit`, governed workspace-scoped shell commands and
|
|
463
|
-
enabled stdio MCP tools;
|
|
464
|
-
the TUI executes these after approval and shows the result, then feeds
|
|
465
|
-
successful supported results back into the provider as an iterative
|
|
466
|
-
`tool_result` continuation turn;
|
|
467
|
-
- remote MCP transports, browser, process and unknown tools remain blocked;
|
|
468
|
-
- no executable Pi RPC bridge yet;
|
|
469
|
-
- native subagent execution is prompt-isolated and provider/model-inherited; `agents run-many` provides parallel fan-out, compact comparison, aggregate usage, a token budget ceiling and streamed lifecycle/telemetry events. Provider/model cost ceilings are enforced by the shared Axion cost policy.
|
|
1
|
+
# Axion Code
|
|
2
|
+
|
|
3
|
+
Axion Code is the Go-first CLI agent harness for the Axion ecosystem. It brings
|
|
4
|
+
the Axion Agent runtime to the terminal with PREVC + A workflow state, Mythos
|
|
5
|
+
execution discipline, provider/model management, persistent sessions, shared
|
|
6
|
+
Axion Desktop configuration, native dotcontext support, and a Claude Code-style
|
|
7
|
+
TUI focused on agentic coding workflows.
|
|
8
|
+
|
|
9
|
+
This MVP follows the PREVC-P documentation package in `.context/`:
|
|
10
|
+
|
|
11
|
+
- Go core;
|
|
12
|
+
- PREVC + A / Mythos event rail;
|
|
13
|
+
- JSONL protocol for `run --json`;
|
|
14
|
+
- SQLite-first shared user session store;
|
|
15
|
+
- Claude Code-style terminal TUI powered by Bubble Tea;
|
|
16
|
+
- full-width chat layout with initial brand splash;
|
|
17
|
+
- provider catalog/profile foundation with mock and OpenRouter adapters;
|
|
18
|
+
- interactive slash palette and provider/model/permission menus;
|
|
19
|
+
- Axion Desktop fallback provider presets, including OpenAI-compatible and Anthropic-compatible endpoints;
|
|
20
|
+
- shared Axion Desktop/CLI provider, model and permission stores under `%USERPROFILE%\.axion`;
|
|
21
|
+
- Pi Agent assets in inspect/import-only mode;
|
|
22
|
+
- native dotcontext and MCP management posture;
|
|
23
|
+
- plan-scoped PREVC + A learning consolidation through `/learn`;
|
|
24
|
+
- shared plugin and native isolated subagent catalogs.
|
|
25
|
+
|
|
26
|
+
## MVP Commands
|
|
27
|
+
|
|
28
|
+
```powershell
|
|
29
|
+
axion-code
|
|
30
|
+
axion-code ask "Explique este projeto"
|
|
31
|
+
axion-code ask --provider openrouter --model google/gemini-2.5-flash-lite "Responda em uma linha"
|
|
32
|
+
axion-code run --json
|
|
33
|
+
axion-code doctor --json
|
|
34
|
+
axion-code init --json
|
|
35
|
+
axion-code init --project --json
|
|
36
|
+
axion-code session list --json
|
|
37
|
+
axion-code provider list --json
|
|
38
|
+
axion-code provider profile init
|
|
39
|
+
axion-code provider profile list --json
|
|
40
|
+
axion-code provider profile add or-free --catalog openrouter --model openrouter/free --credential-ref env:OPENROUTER_API_KEY
|
|
41
|
+
axion-code provider profile set or-free
|
|
42
|
+
axion-code provider profile delete or-free
|
|
43
|
+
axion-code provider profile active
|
|
44
|
+
axion-code provider model list openrouter --json
|
|
45
|
+
axion-code provider cost set openrouter --model openai/gpt-5-mini --max-usd 0.25 --input-usd-per-1m 0.25 --output-usd-per-1m 2 --max-output-tokens 4000
|
|
46
|
+
axion-code provider cost status --profile openrouter --model openai/gpt-5-mini --json
|
|
47
|
+
axion-code provider test openrouter google/gemini-2.5-flash-lite
|
|
48
|
+
axion-code permission list --json
|
|
49
|
+
axion-code permission set full_permission
|
|
50
|
+
axion-code permission inspect Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --json
|
|
51
|
+
axion-code permission request Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --json
|
|
52
|
+
axion-code permission approvals --decision pending --json
|
|
53
|
+
axion-code permission resolve <approval-id> --approve --reason "reviewed" --json
|
|
54
|
+
axion-code graphics doctor
|
|
55
|
+
axion-code graphics logo
|
|
56
|
+
axion-code graphics logo --mode sixel --width 180
|
|
57
|
+
axion-code mcp list --json
|
|
58
|
+
axion-code mcp add sample --command node --arg server.js
|
|
59
|
+
axion-code mcp enable sample
|
|
60
|
+
axion-code mcp disable sample
|
|
61
|
+
axion-code mcp remove sample
|
|
62
|
+
axion-code mcp import .\mcp-servers.json
|
|
63
|
+
axion-code plugins list --json
|
|
64
|
+
axion-code agents list --json
|
|
65
|
+
axion-code agents run bug-hunter "review this login flow"
|
|
66
|
+
axion-code agents run-many bug-hunter,performance-reviewer "review this login flow" --budget-tokens 2000 --stream
|
|
67
|
+
axion-code learn --json
|
|
68
|
+
axion-code memory status --json
|
|
69
|
+
axion-code memory recall "hooks safety" --json
|
|
70
|
+
axion-code memory curate --title "Pattern" --body "Apply this implementation pattern..." --json
|
|
71
|
+
axion-code hooks status --json
|
|
72
|
+
axion-code hooks add --event UserPromptSubmit --action inject --name Safety --content "Use trusted hook context only." --enabled
|
|
73
|
+
axion-code hooks enable
|
|
74
|
+
axion-code package inspect <path>
|
|
75
|
+
axion-code package self-check --json
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Install
|
|
79
|
+
|
|
80
|
+
Official install, after the package is published to the public npm registry:
|
|
81
|
+
|
|
82
|
+
```powershell
|
|
83
|
+
npm install -g @rnbsolucoes/axion-code
|
|
84
|
+
axion
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
The GitHub source repository can remain private. The npm package is intentionally
|
|
88
|
+
published as a small installer/runtime package: it contains the Node wrapper,
|
|
89
|
+
platform binaries under `npm/releases`, and documentation, but it does not ship
|
|
90
|
+
the Go source tree (`cmd/`, `internal/`, `go.mod`, `go.sum`).
|
|
91
|
+
|
|
92
|
+
Private GitHub install is not the recommended distribution path. Commands like
|
|
93
|
+
`npm install -g rnbsolucoes/Axion-CLI` use Git access and may require SSH keys or
|
|
94
|
+
credentials on every machine. Use the scoped npm package instead.
|
|
95
|
+
|
|
96
|
+
Development install from the current local clone:
|
|
97
|
+
|
|
98
|
+
```powershell
|
|
99
|
+
npm install -g .
|
|
100
|
+
axion
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
If an older local `axion.ps1` shim already exists, replace it once:
|
|
104
|
+
|
|
105
|
+
```powershell
|
|
106
|
+
npm install -g . --force
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
The npm package exposes both `axion` and `axion-code`. It does not use a
|
|
110
|
+
`postinstall` hook. On first run, the wrapper copies the packaged binary for the
|
|
111
|
+
current platform into the local Axion Code bin directory and then executes it. In
|
|
112
|
+
a source clone only, if no packaged binary exists, the wrapper can build from Go
|
|
113
|
+
as a development fallback.
|
|
114
|
+
|
|
115
|
+
### Terminal setup (multi-line composer)
|
|
116
|
+
|
|
117
|
+
In the chat composer, **Enter sends** and **Ctrl+J inserts a newline**. Terminals
|
|
118
|
+
do not report Shift+Enter or Ctrl+Enter as distinct keys to the app on Windows,
|
|
119
|
+
so those keys must be mapped to send a newline.
|
|
120
|
+
|
|
121
|
+
On the **first run**, Axion does this automatically for Windows Terminal: it maps
|
|
122
|
+
**Shift+Enter** and **Ctrl+Enter** to send a newline (only when those keys are
|
|
123
|
+
free — it never overwrites an existing binding), writes a `settings.json.axion-bak`
|
|
124
|
+
backup, and prints a one-line notice. Reopen the terminal tab to apply. This runs
|
|
125
|
+
at runtime (not via an npm `postinstall` hook) and only once, tracked by a marker
|
|
126
|
+
in the local bin directory.
|
|
127
|
+
|
|
128
|
+
Opt out with `AXION_SKIP_TERMINAL_SETUP=1`. Re-apply or repair anytime with:
|
|
129
|
+
|
|
130
|
+
```powershell
|
|
131
|
+
axion terminal-setup
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
On other terminals, bind Shift+Enter / Ctrl+Enter to send a newline (`\n`) manually.
|
|
135
|
+
|
|
136
|
+
To classify the currently executed binary for support or security review, run:
|
|
137
|
+
|
|
138
|
+
```powershell
|
|
139
|
+
axion package self-check --json
|
|
140
|
+
```
|
|
141
|
+
|
|
142
|
+
The self-check reports the executable path, real path, runtime version,
|
|
143
|
+
SHA-256, file size, package cache marker when present and a provenance
|
|
144
|
+
classification such as `npm-wrapper-cache`, `npm-package-release`,
|
|
145
|
+
`source-build` or `unknown-local-binary`. It is deterministic local
|
|
146
|
+
provenance, not a replacement for future Authenticode signing.
|
|
147
|
+
|
|
148
|
+
Requirements:
|
|
149
|
+
|
|
150
|
+
- Node.js 18+ for the npm wrapper.
|
|
151
|
+
- End users do not need Go when installing from npm.
|
|
152
|
+
- Development source builds need Go 1.26+ on `PATH`, `AXION_GO`, or the Codex
|
|
153
|
+
bundled Go toolchain at `%USERPROFILE%\.codex\toolchains\go1.26.4\go\bin\go.exe`.
|
|
154
|
+
|
|
155
|
+
For this development machine, if an older PowerShell shim still points directly
|
|
156
|
+
to `%LOCALAPPDATA%\AxionCode\bin\axion-code.exe`, rebuild the local binary:
|
|
157
|
+
|
|
158
|
+
```powershell
|
|
159
|
+
go build -o "$env:LOCALAPPDATA\AxionCode\bin\axion-code.exe" ./cmd/axion-code
|
|
160
|
+
```
|
|
161
|
+
|
|
162
|
+
## Publish
|
|
163
|
+
|
|
164
|
+
Build the npm package binaries before publishing:
|
|
165
|
+
|
|
166
|
+
```powershell
|
|
167
|
+
npm run build:npm-binaries:release
|
|
168
|
+
npm pack --dry-run
|
|
169
|
+
npm publish --access public
|
|
170
|
+
```
|
|
171
|
+
|
|
172
|
+
The npm account or organization must own the `@rnbsolucoes` scope. Scoped public
|
|
173
|
+
packages must be published with public access on the first publish.
|
|
174
|
+
The current release build targets Windows x64 and Linux x64. Add more targets by
|
|
175
|
+
running `node npm/build-package-binaries.mjs --targets=all` or a comma-separated
|
|
176
|
+
target list when those platforms are ready.
|
|
177
|
+
|
|
178
|
+
## Update
|
|
179
|
+
|
|
180
|
+
Check for a newer version:
|
|
181
|
+
|
|
182
|
+
```powershell
|
|
183
|
+
axion update --check
|
|
184
|
+
axion version --check
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
Update the installed CLI. This is the official update alias and must remain the
|
|
188
|
+
single command users run whenever a new Axion Code binary/package is released:
|
|
189
|
+
|
|
190
|
+
```powershell
|
|
191
|
+
axion update
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
The npm wrapper checks the public npm registry first and falls back to the GitHub
|
|
195
|
+
package metadata only when available. If a newer version exists, the initial
|
|
196
|
+
Axion Code splash shows the update notice and hides it after the first
|
|
197
|
+
interaction.
|
|
198
|
+
|
|
199
|
+
Without npm:
|
|
200
|
+
|
|
201
|
+
```powershell
|
|
202
|
+
go build -o "$env:LOCALAPPDATA\AxionCode\bin\axion-code.exe" ./cmd/axion-code
|
|
203
|
+
```
|
|
204
|
+
|
|
205
|
+
Provider catalog/configuration is shared with Axion Desktop, while the active
|
|
206
|
+
Axion Code selection is isolated:
|
|
207
|
+
|
|
208
|
+
```text
|
|
209
|
+
%USERPROFILE%\.axion\harness\providers.json
|
|
210
|
+
%USERPROFILE%\.axion\harness\active_profile # Axion Desktop active profile
|
|
211
|
+
%USERPROFILE%\.axion\harness\active_profile_cli # Axion Code active profile
|
|
212
|
+
%USERPROFILE%\.axion\harness\selection_cli.json # Axion Code active model/params
|
|
213
|
+
%USERPROFILE%\.axion\axion-mode.json
|
|
214
|
+
%USERPROFILE%\.axion\sessions\axion.db
|
|
215
|
+
%USERPROFILE%\.axion\mcp-servers.json
|
|
216
|
+
%USERPROFILE%\.axion\plugins.json
|
|
217
|
+
%USERPROFILE%\.axion\sub-agents.json
|
|
218
|
+
%USERPROFILE%\.axion\harness\cost-policy.json
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
OpenRouter uses `OPENROUTER_API_KEY` from the environment or a `secret:<NAME>` reference stored in `C:\Israel\Pesoal\secrets.env` (override for tests: `AXION_SECRETS_ENV`). Provider profile config stores only references, never the key value.
|
|
222
|
+
|
|
223
|
+
Provider-specific cost ceilings are stored outside the Desktop profile schema in
|
|
224
|
+
`%USERPROFILE%\.axion\harness\cost-policy.json`. Use `provider cost set` to
|
|
225
|
+
bind a ceiling and token prices to a profile or profile/model pair. The runtime
|
|
226
|
+
blocks a request before provider execution when the estimated input or configured
|
|
227
|
+
maximum output cost would exceed the ceiling. After a response, actual
|
|
228
|
+
input/output usage is converted to cost and surfaced in provider/subagent stream
|
|
229
|
+
telemetry; if actual cost exceeds the ceiling, the turn returns an explicit cost
|
|
230
|
+
ceiling error. A ceiling without token prices is not enforced, because Axion Code
|
|
231
|
+
does not infer provider pricing silently.
|
|
232
|
+
|
|
233
|
+
For test/dev isolation, set `AXION_HOME` to a temporary folder. In normal use,
|
|
234
|
+
leave it unset so Desktop and CLI share the same provider catalog while keeping
|
|
235
|
+
their active provider/model selections independent.
|
|
236
|
+
|
|
237
|
+
## Project Bootstrap
|
|
238
|
+
|
|
239
|
+
`axion-code init --json` bootstraps the shared user-level Axion home used by
|
|
240
|
+
Axion Desktop and Axion Code. It creates missing files under
|
|
241
|
+
`%USERPROFILE%\.axion` without overwriting Desktop-owned provider/model state.
|
|
242
|
+
|
|
243
|
+
`axion-code init --project --json` bootstraps the current workspace. The same
|
|
244
|
+
operation is available inside the TUI with `/init`. It creates only missing
|
|
245
|
+
project scaffolding:
|
|
246
|
+
|
|
247
|
+
```text
|
|
248
|
+
.brv/ local operational memory and PREVC + A learning buffers
|
|
249
|
+
.context/ workflow, plans, tasks, context snapshots and PREVC evidence
|
|
250
|
+
.docs/ project documents, specs, reports and handoff material
|
|
251
|
+
AGENTS.md project-scoped instructions
|
|
252
|
+
CLAUDE.md Claude-compatible project instructions
|
|
253
|
+
.gitignore ignored local runtime, secrets, cache and build-output patterns
|
|
254
|
+
```
|
|
255
|
+
|
|
256
|
+
If a legacy `docs/` directory exists and `.docs/` does not, project bootstrap
|
|
257
|
+
renames `docs/` to `.docs/`. If both exist, Axion Code leaves both untouched and
|
|
258
|
+
does not attempt an automatic merge.
|
|
259
|
+
|
|
260
|
+
Instruction layering is explicit: shared `%USERPROFILE%\.axion\AGENTS.md`
|
|
261
|
+
contains global Axion Code agent rules, while the workspace root `AGENTS.md`
|
|
262
|
+
contains project-specific rules. Provider runtime prompts read both layers when
|
|
263
|
+
present, plus `CLAUDE.md` as a compatibility surface.
|
|
264
|
+
|
|
265
|
+
The interactive TUI supports:
|
|
266
|
+
|
|
267
|
+
```text
|
|
268
|
+
/ inline slash palette
|
|
269
|
+
/init
|
|
270
|
+
/provider
|
|
271
|
+
/provider set <profile-id>
|
|
272
|
+
/model
|
|
273
|
+
/permission
|
|
274
|
+
/mcp
|
|
275
|
+
/learn
|
|
276
|
+
/memory
|
|
277
|
+
/hooks
|
|
278
|
+
/plugins
|
|
279
|
+
/agents
|
|
280
|
+
/agents run <id> <prompt>
|
|
281
|
+
/agents run-many <id,id,...> <prompt> [--budget-tokens <n>]
|
|
282
|
+
```
|
|
283
|
+
|
|
284
|
+
Slash palette behavior: `↑/↓` selects, `Tab` completes the selected command, `Enter` executes the selected command, `Esc` closes active menus/wizards.
|
|
285
|
+
|
|
286
|
+
`/model` pulls the active provider's `/models` endpoint when credentials are configured. Reasoning and fast-mode steps appear only when the selected model metadata exposes those parameters.
|
|
287
|
+
|
|
288
|
+
`/learn` consolidates plan-scoped learning from `.brv/plans/<plan-id>` and `.context/learning-candidates*.md`, filters low-signal material, deduplicates by content hash/summary and promotes relevant notes into native dotcontext at `<workspace>/.axion/context`.
|
|
289
|
+
|
|
290
|
+
`/memory` exposes the native project memory layer: `status`, `ensure`, `recall <query>` and `curate <text>`. Recall uses the local `.axion/context` note tree plus a SQLite FTS index and injects bounded `## Memoria recuperada` context into provider prompts without changing the visible/stored user message.
|
|
291
|
+
|
|
292
|
+
`/hooks` exposes Phase 1 native hooks. Hooks are stored in shared `%USERPROFILE%\.axion\hooks.json` and controlled by `%USERPROFILE%\.axion\hooks-config.json`, default OFF. `SessionStart` and `UserPromptSubmit` can inject trusted `<hook-context>` prompt context; `PostToolUse` and `Stop` are observe-only. Phase 1 does not execute shell commands or approve tools.
|
|
293
|
+
|
|
294
|
+
When the active plan comes from `.context/plans/*.md`, `/task add`, `/task done`
|
|
295
|
+
and `/task progress` update the Markdown plan file directly. Axion Code rewrites
|
|
296
|
+
only the target task line marker/progress and keeps the rest of the document
|
|
297
|
+
unchanged.
|
|
298
|
+
|
|
299
|
+
`/mcp` opens an inline MCP list. Enabled servers can be disabled, disabled servers can be enabled, and non-native servers can be uninstalled while preserving valid `mcp-servers.json` formatting.
|
|
300
|
+
|
|
301
|
+
`/agents` lists the native isolated subagents. `/agents run <id> <prompt>` calls one with an isolated prompt while inheriting the active provider/model from the main agent. `/agents run-many <id,id,...> <prompt> [--budget-tokens <n>]` runs up to eight isolated subagents in parallel, streams lifecycle/telemetry events into the TUI while the team runs, then returns their individual outputs plus a compact comparison and aggregate token usage. If the estimated isolated prompt input already exceeds the budget, no provider calls are executed.
|
|
302
|
+
|
|
303
|
+
## MCP, Plugins And Subagents
|
|
304
|
+
|
|
305
|
+
MCP import files use the same JSON array shape as `%USERPROFILE%\.axion\mcp-servers.json`:
|
|
306
|
+
|
|
307
|
+
```json
|
|
308
|
+
[
|
|
309
|
+
{
|
|
310
|
+
"id": "context7",
|
|
311
|
+
"name": "Context7",
|
|
312
|
+
"transport": "stdio",
|
|
313
|
+
"command": "npx",
|
|
314
|
+
"args": ["-y", "@upstash/context7-mcp"],
|
|
315
|
+
"enabled": false,
|
|
316
|
+
"read_only": true
|
|
317
|
+
}
|
|
318
|
+
]
|
|
319
|
+
```
|
|
320
|
+
|
|
321
|
+
`axion mcp import <file.json>` merges by `id`, preserves `native` protection for built-ins, writes formatted JSON, and rejects entries without `id` or without the required `command`/`url` for the selected transport. Native MCPs such as `dotcontext` cannot be removed, only disabled.
|
|
322
|
+
|
|
323
|
+
`axion mcp tools <id> [--json]` starts an enabled stdio MCP server, performs the MCP initialize handshake and returns the exact tools advertised by `tools/list`. This is the recommended smoke test for native MCPs before enabling provider tool calls, for example `axion mcp tools axion-dotcontext --json`.
|
|
324
|
+
|
|
325
|
+
The native Dotcontext MCP uses the current official package surface, `npx -y @dotcontext/mcp@latest`. Existing shared Axion homes are migrated from the deprecated `dotcontext` npm package to `@dotcontext/mcp@latest` during bootstrap while preserving local MCP status metadata. Because the native entry points at `@latest`, normal MCP startup pulls upstream Dotcontext server updates; Axion code changes are needed only when Dotcontext changes package names, tool contracts or Axion-specific integration policy.
|
|
326
|
+
|
|
327
|
+
Plugins are read from the same shared Axion Desktop file, `%USERPROFILE%\.axion\plugins.json`. The CLI can list, enable, disable and remove plugin records, but executable plugin installation remains intentionally gated for the next trust-policy cycle.
|
|
328
|
+
|
|
329
|
+
Subagents are stored in `%USERPROFILE%\.axion\sub-agents.json`. The initial catalog has 15 native entries:
|
|
330
|
+
|
|
331
|
+
- Programming: `code-reviewer`, `bug-hunter`, `security-reviewer`, `performance-reviewer`, `frontend-ux-reviewer`.
|
|
332
|
+
- Professional: `product-strategist`, `business-analyst`, `financial-analyst`, `legal-policy-reviewer`, `marketing-strategist`, `sales-ops-analyst`, `customer-success-advisor`, `data-analyst`, `operations-advisor`, `hr-talent-advisor`.
|
|
333
|
+
|
|
334
|
+
Execution contract: subagents inherit the active provider/model, receive an isolated prompt containing only their role and the requested task, do not access the main hidden context unless explicitly included in the prompt, and return findings/evidence/actions back to the main timeline.
|
|
335
|
+
|
|
336
|
+
## Approval And Sandbox Policy
|
|
337
|
+
|
|
338
|
+
`axion permission inspect` exposes the native Go approval policy without running
|
|
339
|
+
the tool. It classifies native tools, shell commands and MCP-proxied tools into
|
|
340
|
+
stable risk classes, reports whether the active permission mode would require
|
|
341
|
+
approval, redacts secret-shaped inputs and returns the sandbox profile that the
|
|
342
|
+
guarded dispatcher must use.
|
|
343
|
+
|
|
344
|
+
`axion permission request|approvals|resolve` adds the auditable approval queue.
|
|
345
|
+
Requests are persisted in the shared session database under
|
|
346
|
+
`%USERPROFILE%\.axion\sessions\axion.db` with the redacted decision, risk class,
|
|
347
|
+
permission mode, impact summary and pending/approved/denied state. This is the
|
|
348
|
+
headless contract used by the TUI approval menu and the future guarded
|
|
349
|
+
dispatcher before mutating filesystem, shell or MCP tools are enabled.
|
|
350
|
+
|
|
351
|
+
Provider stream `tool_call` events now open the TUI approval menu when the
|
|
352
|
+
active permission mode requires review. Approve/Deny records the audited
|
|
353
|
+
decision and returns focus to the chat input. When approved, the TUI executes
|
|
354
|
+
supported guarded-dispatcher tools and prints the bounded result in the
|
|
355
|
+
timeline. Successful supported tool results are then sent back into the active
|
|
356
|
+
provider as a follow-up `tool_result` continuation turn, so the agent can use
|
|
357
|
+
the evidence before answering. Unsupported tools remain explicitly pending until
|
|
358
|
+
a dedicated adapter exists.
|
|
359
|
+
|
|
360
|
+
`axion tool run` exposes the guarded dispatcher surface. The CLI and TUI
|
|
361
|
+
currently support workspace-local `Read`, `Glob`, `Grep`, `Write` and `Edit`,
|
|
362
|
+
governed `Shell`/`Bash`/`PowerShell` commands that run from a workspace
|
|
363
|
+
directory with timeout and bounded output, and enabled stdio MCP tools named as
|
|
364
|
+
`mcp__<server-id>__<tool-name>`. Provider tool aliases such as `read_file`,
|
|
365
|
+
`write_file` and `run_command` are normalized to native tool names before
|
|
366
|
+
approval/execution. When the active permission mode requires approval, execution
|
|
367
|
+
is allowed only if the supplied approval is already approved and matches the
|
|
368
|
+
exact redacted tool request. Remote MCP transports, browser, process and
|
|
369
|
+
unknown tools remain unsupported even when an approval exists.
|
|
370
|
+
|
|
371
|
+
Examples:
|
|
372
|
+
|
|
373
|
+
```powershell
|
|
374
|
+
axion permission inspect Read --mode approved_by_me --json
|
|
375
|
+
axion permission inspect Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --json
|
|
376
|
+
axion permission inspect mcp__serena__replace_symbol_body "{}" --mode full_permission --json
|
|
377
|
+
axion permission request Bash "{\"command\":\"npm install left-pad\"}" --mode full_permission --session smoke --turn turn-1 --json
|
|
378
|
+
axion permission approvals --session smoke --decision pending --json
|
|
379
|
+
axion permission resolve <approval-id> --deny --reason "not needed" --json
|
|
380
|
+
axion tool run Read "{\"path\":\"README.md\"}" --mode full_permission --json
|
|
381
|
+
axion tool run Write "{\"path\":\"notes/out.txt\",\"content\":\"approved\"}" --session smoke --turn turn-1 --approval <approval-id> --mode request_permission --json
|
|
382
|
+
axion tool run Shell "{\"command\":\"echo axion-shell\"}" --session smoke --turn turn-1 --approval <approval-id> --mode request_permission --json
|
|
383
|
+
axion mcp tools axion-dotcontext --json
|
|
384
|
+
# Shape: replace server/tool with an enabled MCP tool advertised by tools/list.
|
|
385
|
+
axion tool run mcp__your-server__list_items "{\"query\":\"PREVC\"}" --mode full_permission --json
|
|
386
|
+
```
|
|
387
|
+
|
|
388
|
+
Security invariants:
|
|
389
|
+
|
|
390
|
+
- `Full permission` skips only read and non-destructive write tiers.
|
|
391
|
+
- package install, network download/egress, destructive commands, process
|
|
392
|
+
control, shell commands, paid generation, browser actions, mutating MCP tools
|
|
393
|
+
and unknown tools still require approval under `Full permission`.
|
|
394
|
+
- `YOLO` is the only mode that bypasses every class, and remains explicit user
|
|
395
|
+
opt-in.
|
|
396
|
+
- unknown native tools are default-deny until they are classified.
|
|
397
|
+
- MCP tools are mutating by default; only read-shaped names such as `find_*`,
|
|
398
|
+
`get_*`, `list_*`, `search_*` and `*_overview` are downgraded to read-only.
|
|
399
|
+
The dispatcher validates that enabled stdio MCP servers advertise the target
|
|
400
|
+
tool through `tools/list` before calling `tools/call`.
|
|
401
|
+
|
|
402
|
+
Provider menu actions:
|
|
403
|
+
|
|
404
|
+
```text
|
|
405
|
+
Register provider
|
|
406
|
+
Edit provider
|
|
407
|
+
Set provider
|
|
408
|
+
Delete provider
|
|
409
|
+
```
|
|
410
|
+
|
|
411
|
+
For a profile-backed OpenRouter session:
|
|
412
|
+
|
|
413
|
+
```powershell
|
|
414
|
+
axion provider profile add or-free --catalog openrouter --model openrouter/free --credential-ref env:OPENROUTER_API_KEY
|
|
415
|
+
axion provider profile set or-free
|
|
416
|
+
axion
|
|
417
|
+
```
|
|
418
|
+
|
|
419
|
+
Nexus profiles share the same `%USERPROFILE%\.axion\harness\nexus-config.json`
|
|
420
|
+
used by Axion Desktop. The default `fusion` engine runs the existing
|
|
421
|
+
panel -> judge -> final flow. The `pcp` engine enables the text-only
|
|
422
|
+
Maestro/workers loop from the new Desktop Nexus provider:
|
|
423
|
+
|
|
424
|
+
```powershell
|
|
425
|
+
axion provider nexus status --profile nexus
|
|
426
|
+
axion provider nexus set --profile pcp-nexus --engine pcp --judge-kind sakana --judge sakana:fugu --image-provider imagehub --image-model image-default --video-provider videohub --video-model video-pro --exec3 mock:mock/worker --exec3-instruction "general text worker"
|
|
427
|
+
```
|
|
428
|
+
|
|
429
|
+
PCP in the CLI supports Maestro tool-calling with text workers `exec3` and
|
|
430
|
+
`exec4`, plus image/video slots exposed as internal PCP workers. Nexus streams
|
|
431
|
+
normalized lifecycle telemetry to the TUI for Fusion and PCP phases; internal
|
|
432
|
+
PCP worker dispatches stay private and do not surface as app-level tool
|
|
433
|
+
approvals. Image/video dispatch is refused unless permission mode is `yolo`;
|
|
434
|
+
even in `yolo`, the CLI currently returns a structured "media runtime
|
|
435
|
+
unavailable" tool result until the local media runtime lands. When Axion
|
|
436
|
+
Desktop saves PCP image/video slots as model-only capability references, the CLI
|
|
437
|
+
resolves the provider label from Desktop's `capability_selections` store on a
|
|
438
|
+
best-effort basis for status, audit metadata and worker labels.
|
|
439
|
+
|
|
440
|
+
## Build
|
|
441
|
+
|
|
442
|
+
```powershell
|
|
443
|
+
go test -count=1 ./...
|
|
444
|
+
go build ./cmd/axion-code
|
|
445
|
+
```
|
|
446
|
+
|
|
447
|
+
If Go is not on PATH, use a verified local Go toolchain and keep generated binaries out of git.
|
|
448
|
+
|
|
449
|
+
## Current Limits
|
|
450
|
+
|
|
451
|
+
This is a functional direction MVP, not the full harness:
|
|
452
|
+
|
|
453
|
+
- direct provider streaming exists for OpenAI-compatible chat completions,
|
|
454
|
+
OpenAI Responses and Anthropic Messages;
|
|
455
|
+
- Nexus supports the legacy Fusion engine and the new PCP Maestro/workers
|
|
456
|
+
engine with stream normalization, redacted audit surfacing, TUI Nexus
|
|
457
|
+
configuration, text workers and permission-gated image/video worker
|
|
458
|
+
placeholders; real CLI media generation remains deferred;
|
|
459
|
+
- terminal logo uses Sixel when available and falls back to width-bounded ANSI/block rendering;
|
|
460
|
+
- initial chat splash shows the Axion logo and system name until the first interaction;
|
|
461
|
+
- guarded dispatcher execution is limited to workspace-local `Read`, `Glob`,
|
|
462
|
+
`Grep`, `Write` and `Edit`, governed workspace-scoped shell commands and
|
|
463
|
+
enabled stdio MCP tools;
|
|
464
|
+
the TUI executes these after approval and shows the result, then feeds
|
|
465
|
+
successful supported results back into the provider as an iterative
|
|
466
|
+
`tool_result` continuation turn;
|
|
467
|
+
- remote MCP transports, browser, process and unknown tools remain blocked;
|
|
468
|
+
- no executable Pi RPC bridge yet;
|
|
469
|
+
- native subagent execution is prompt-isolated and provider/model-inherited; `agents run-many` provides parallel fan-out, compact comparison, aggregate usage, a token budget ceiling and streamed lifecycle/telemetry events. Provider/model cost ceilings are enforced by the shared Axion cost policy.
|