aegisone 1.0.35 → 1.0.38
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 +1 -1
- package/bin/aegis.js +1 -1
- package/package.json +1 -1
- package/scripts/predist.mjs +1 -1
- package/src/iface/paths.js +3 -0
- package/src/iface/pty.js +3 -0
- package/src/iface/update.js +3 -0
- package/src/iface/window.js +3 -0
- package/src/protocol.js +3 -0
- package/src/selfhost.js +3 -0
- package/vendor/cli/package.json +1 -1
- package/vendor/cli/vendor/desktop/lib/local/integrity.js +1 -1
- package/vendor/cli/vendor/desktop/main.js +67 -1
- package/vendor/cli/vendor/one/src/selfhost.js +3 -0
- package/vendor/desktop/lib/local/integrity.js +1 -1
- package/vendor/desktop/main.js +67 -1
- package/vendor/desktop/package.json +1 -1
- package/vendor/desktop/vendor/faces/cli/LICENSE +661 -0
- package/vendor/desktop/vendor/faces/cli/README.md +784 -0
- package/vendor/desktop/vendor/faces/cli/bin/aegiscode.js +20 -0
- package/vendor/desktop/vendor/faces/cli/package.json +44 -0
- package/vendor/desktop/vendor/faces/cli/scripts/check.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/demo.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/predist.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/runtests.mjs +4 -0
- package/vendor/desktop/vendor/faces/cli/scripts/seal-gate.mjs +3 -0
- package/vendor/desktop/vendor/faces/cli/src/agents.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/app.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/art.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/autonomous.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/caps.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/chatflow.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/checkpoint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/clipboard.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/cloudsync.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/commands.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/config.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/connect.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/credentials.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/deps.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/devrun.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/diff.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/diffview.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/engine.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/entitlement.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/events.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/export.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/filepreview.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/fingerprint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/format.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/fuzzy.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/gate.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/history.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/init.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/input.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/keys.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/limits.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/markdown.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/mcp.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/models.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/naming.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/overlays.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/panels.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/permissions.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/ping.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/presence.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/provenance.js +58 -0
- package/vendor/desktop/vendor/faces/cli/src/provenance.lock.json +36 -0
- package/vendor/desktop/vendor/faces/cli/src/render.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/screen.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/screens.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/secret.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/securefs.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/settings.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/shared.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/sharedpaths.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/signup.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/summarize.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/sysdiag.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/system.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/theme.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/title.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/todos.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/tokens.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/topup.js +3 -0
- package/vendor/desktop/vendor/faces/cli/src/update.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/aegis.js +4 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/attest.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/authorship-key.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/auto-provision.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/brain-catalog.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/byok-catalog.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/catalog-client.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/conversation-export.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/credentials.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/device-fingerprint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/drive-connect.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/drive-upload.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/env-file.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/fingerprint.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/foreign-memory.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/google-signin.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/hooks.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/model-discovery.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/naming.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/platform.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/prefs.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/presence-constants.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/presence.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/record-vault.js +105 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/session-store.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/topup.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/touch.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/update.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/client/user-models.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/covenant/README.md +21 -0
- package/vendor/desktop/vendor/faces/cli/vendor/covenant/aegis.seal +177 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/aegis-seal.mjs +241 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/agents.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/attachments.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/autonomous.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/claude-pro.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/context.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/covenant.js +567 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/engine.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/entitlement.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/exec-plan.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/git-scope.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/integrity.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/local.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/prompt.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/queue.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/session-rounds.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/shell.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/spill.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/tools.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/turn-guard.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/local/worktree-lock.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/lib/settings.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/main.js +6 -0
- package/vendor/desktop/vendor/faces/cli/vendor/desktop/renderer/usage.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/install.js +1 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/openai-shim.js +2 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/spec.js +1 -0
- package/vendor/desktop/vendor/faces/cli/vendor/hosts/targets.js +1 -0
- package/vendor/desktop/vendor/faces/cli/vendor/mcp/server.js +4 -0
- package/vendor/desktop/vendor/faces/cli/vendor/mcp/tools.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/child.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/permissions.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/one/src/selfhost.js +3 -0
- package/vendor/desktop/vendor/faces/cli/vendor/tools/agent-gate.mjs +1203 -0
- package/vendor/desktop/vendor/selfhost.js +3 -0
|
@@ -0,0 +1,784 @@
|
|
|
1
|
+
# aegiscode — the terminal host
|
|
2
|
+
|
|
3
|
+
`aegiscode` in your shell — the command-line version of AEGIS Desktop. The same
|
|
4
|
+
tool surface the Claude Code plugin exposes over MCP, plus a terminal instead of
|
|
5
|
+
an editor — built on the same two shared pieces and no others:
|
|
6
|
+
|
|
7
|
+
| Shared piece | What it is |
|
|
8
|
+
|---|---|
|
|
9
|
+
| `client/aegis.js` | The thin transport. Holds the API key, speaks HTTP/SSE. No brain logic. |
|
|
10
|
+
| `mcp/tools.js` | The tool registry — names, JSON schemas, result formatting. |
|
|
11
|
+
| `desktop/renderer/usage.js` | The token-usage → number mapping, shared with the GUI so the two can never disagree. |
|
|
12
|
+
| `desktop/lib/local/` | The agent-loop engine — persistent-shell exec, read/write/edit/glob/grep, Task subagents. The CLI runs the same loop the GUI does, scoped to the AEGIS class. |
|
|
13
|
+
|
|
14
|
+
Routing, model tiers, memory and billing all stay behind aegiscloud.org.
|
|
15
|
+
|
|
16
|
+
## Quick start
|
|
17
|
+
|
|
18
|
+
Four steps, in order. Everything past this section is the fuller reference for
|
|
19
|
+
each one.
|
|
20
|
+
|
|
21
|
+
**1. Install** — requires Node 22+.
|
|
22
|
+
|
|
23
|
+
```bash
|
|
24
|
+
npm install -g aegiscode
|
|
25
|
+
```
|
|
26
|
+
|
|
27
|
+
**2. Log in** — get a key at <https://aegiscloud.org> if you don't have one.
|
|
28
|
+
|
|
29
|
+
```bash
|
|
30
|
+
aegiscode login # prompts, no echo
|
|
31
|
+
aegiscode key status # verify: masked key + which source is in use
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
**3. (Optional) Bring your own key** — skip this if you're happy on the
|
|
35
|
+
pooled AEGIS Cloud route (the default). Use your own OpenAI/Anthropic/etc. key
|
|
36
|
+
instead, at a flat handling fee instead of the pooled margin — see [Bring your
|
|
37
|
+
own key](#bring-your-own-key).
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
/byok # list providers and which are already set
|
|
41
|
+
/byok-key openai # save a key on this machine, prompts, no echo
|
|
42
|
+
/class byok # switch the session to run on it
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
**4. Use it.**
|
|
46
|
+
|
|
47
|
+
```bash
|
|
48
|
+
aegiscode # interactive session
|
|
49
|
+
aegiscode "why is the sky blue" # one-shot, prints the answer and the tokens
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
## Names: one name, `aegiscode`
|
|
53
|
+
|
|
54
|
+
This host and the CLI used to be two names for two packages. They are one
|
|
55
|
+
product, so they are one name now:
|
|
56
|
+
|
|
57
|
+
| Name | Status |
|
|
58
|
+
|---|---|
|
|
59
|
+
| `aegiscode` | **this host**, v6.0.0. Installs a single binary, `aegiscode`. |
|
|
60
|
+
| `aegis-terminal` | deprecated — the 0.1.x spelling of this package, folded into `aegiscode`. |
|
|
61
|
+
| `aegiscode-cli` | 4.0.3, an earlier name of this CLI's predecessor line. Untouched. |
|
|
62
|
+
| `aegis-cli` | 0.4.8 (unrelated). |
|
|
63
|
+
| `aegis` (bin) | claimed **twice already** — by `aegiscode-cli` (→ `bin/cli.js`) and by `aegis-desktop` (→ `bin/aegis.js`). Pre-existing; whichever installs last wins. |
|
|
64
|
+
|
|
65
|
+
Publishing this host as `aegiscode` moves the `latest` dist-tag for that name
|
|
66
|
+
onto it. The previous line (`aegiscode@5.x`, the earlier agent build) is
|
|
67
|
+
still installable and immutable on the registry — pin `aegiscode@5` for it.
|
|
68
|
+
|
|
69
|
+
## Installation
|
|
70
|
+
|
|
71
|
+
```bash
|
|
72
|
+
npm install -g aegiscode
|
|
73
|
+
# or, from a source checkout — no install needed:
|
|
74
|
+
node cli/bin/aegiscode.js
|
|
75
|
+
```
|
|
76
|
+
|
|
77
|
+
Requires Node 22+. Save your key once — it goes to `~/.aegiscode/credentials.json`
|
|
78
|
+
(mode `0600`) and is then picked up by every later launch, script and shell:
|
|
79
|
+
|
|
80
|
+
```bash
|
|
81
|
+
aegiscode login # prompts, no echo
|
|
82
|
+
aegiscode login "aegis_..." # or inline
|
|
83
|
+
aegiscode key status # masked key + which source is in use
|
|
84
|
+
aegiscode logout # remove it
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
`AEGIS_API_KEY` still works and still wins (useful in CI, or for a one-off);
|
|
88
|
+
`aegiscode --key <key>` applies to a single run and is never saved. A key an
|
|
89
|
+
older AEGIS CLI left in `~/.aegiscode/config.json` is picked up and copied into
|
|
90
|
+
the 0600 store automatically — `/cloud status` says so if the plaintext copy is
|
|
91
|
+
still there.
|
|
92
|
+
|
|
93
|
+
## One file for every key
|
|
94
|
+
|
|
95
|
+
`~/.aegiscode/.env` is read into the environment once at startup by the CLI, the
|
|
96
|
+
desktop app and the MCP server. It is the shortest way to configure the account
|
|
97
|
+
key *and* every BYOK provider at the same time:
|
|
98
|
+
|
|
99
|
+
```bash
|
|
100
|
+
# ~/.aegiscode/.env
|
|
101
|
+
AEGIS_API_KEY=aegis_...
|
|
102
|
+
ANTHROPIC_API_KEY=sk-ant-...
|
|
103
|
+
OPENAI_API_KEY=sk-...
|
|
104
|
+
DEEPSEEK_API_KEY=sk-...
|
|
105
|
+
```
|
|
106
|
+
|
|
107
|
+
That file alone is enough — no `login`, no `/byok-key <provider>` prompt per
|
|
108
|
+
provider. Both resolution paths already read these names out of the environment;
|
|
109
|
+
the file is just what fills it. `AEGIS_API_KEY` is entry one in the credential
|
|
110
|
+
order below, and a BYOK provider resolves `<PROVIDER>_API_KEY` (upper snake case,
|
|
111
|
+
with a short alias table for the ids that would spell it differently — `google`
|
|
112
|
+
and `gemini` → `GEMINI_API_KEY`, `xai` → `XAI_API_KEY`, `huggingface` →
|
|
113
|
+
`HF_TOKEN`).
|
|
114
|
+
|
|
115
|
+
Two rules it obeys: a variable **already exported in the launching shell always
|
|
116
|
+
wins**, so a stale file can never shadow `AEGIS_API_KEY=… aegiscode` in CI; and
|
|
117
|
+
the loader only ever reads. If the file is group- or world-readable you are told,
|
|
118
|
+
not silently fixed — the 0600 store stays the only secret this repo writes.
|
|
119
|
+
|
|
120
|
+
That one file is shared: the MCP plugin and AEGIS Desktop read the same store and
|
|
121
|
+
the same `.env`, so signing in here signs you in everywhere (see [One memory,
|
|
122
|
+
shared with AEGIS Desktop](#one-memory-shared-with-aegis-desktop)).
|
|
123
|
+
|
|
124
|
+
## Launch options
|
|
125
|
+
|
|
126
|
+
```bash
|
|
127
|
+
aegiscode # interactive session
|
|
128
|
+
aegiscode --continue # skip onboarding, resume the last session
|
|
129
|
+
aegiscode "why is the sky blue" # one-shot, prints the answer and the tokens
|
|
130
|
+
aegiscode -p "..." --json # machine-readable
|
|
131
|
+
echo "q" | aegiscode -p - # prompt on stdin
|
|
132
|
+
aegiscode -m deepseek/deepseek-v4-flash -p "..." # pin a model
|
|
133
|
+
aegiscode --terminal # print the resolved terminal capabilities
|
|
134
|
+
aegiscode --ascii # force the ASCII mark (legacy consoles)
|
|
135
|
+
aegiscode --width 100 # pin the frame width
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## One look on every terminal
|
|
139
|
+
|
|
140
|
+
The welcome screen, the palette and the glyph set are resolved from what the
|
|
141
|
+
terminal *can actually draw*, not from `process.platform`. PowerShell inside
|
|
142
|
+
Windows Terminal sets `WT_SESSION`/`TERM_PROGRAM`, so it renders the **same
|
|
143
|
+
byte-identical frame** as zsh: `unicode` mark, `native` star, 24-bit colour. The
|
|
144
|
+
host OS is only a fallback hint; the environment wins.
|
|
145
|
+
|
|
146
|
+
`cli/src/caps.js` resolves one capability object — mark (`unicode`/`ascii`), face
|
|
147
|
+
(`native`/`edges`), star (`native`/`narrow`), colour depth (24/8/4/0), control
|
|
148
|
+
(`ansi`/`plain`), size and EOL — and everything that draws goes through it.
|
|
149
|
+
`theme.js` builds its palettes and glyph table via `caps.rgb()`/`caps.bg()`, so a
|
|
150
|
+
16-colour console is painted in colours it has instead of literal escape text,
|
|
151
|
+
and `art.js` applies composable stencils (`ascii`, `edges`, `star`) rather than a
|
|
152
|
+
per-platform art table.
|
|
153
|
+
|
|
154
|
+
Only a **legacy** Windows console degrades — and it says why:
|
|
155
|
+
|
|
156
|
+
| host | mark | star | colour | reason |
|
|
157
|
+
| --- | --- | --- | --- | --- |
|
|
158
|
+
| any host, no override | `unicode` | `native` | truecolor | uniform default: nothing about the host is inferred |
|
|
159
|
+
| win32 legacy conhost | `ascii` | `narrow` | 16 | reported by `--terminal`; set `AEGIS_ART=ascii` to act on it |
|
|
160
|
+
| …requested | `ascii` | `narrow` | 16 | `AEGIS_ART=ascii` / `--ascii` |
|
|
161
|
+
|
|
162
|
+
The rendering is **uniform**: `process.platform`, `TERM`, `TERM_PROGRAM`,
|
|
163
|
+
`WT_SESSION` and the locale's character set are probed and reported
|
|
164
|
+
(`aegiscode --terminal`) but never change a byte that is drawn, because a font
|
|
165
|
+
that lacks a glyph is something only the person looking at the screen can
|
|
166
|
+
settle. Only an explicit switch changes the output, and every switch is spelled
|
|
167
|
+
the same way on every platform.
|
|
168
|
+
|
|
169
|
+
The one thing read from the terminal about *itself* is its background
|
|
170
|
+
brightness, and it is used for one decision only: which of the two legible
|
|
171
|
+
palettes `/theme`'s **Auto (match terminal)** row resolves to. The dark
|
|
172
|
+
palette's body text is white, so on a light terminal the wrong answer is an
|
|
173
|
+
invisible one — and the failure is symmetric: the *light* palette's body text is
|
|
174
|
+
near-black, so restoring it on a dark terminal is invisible too.
|
|
175
|
+
|
|
176
|
+
At startup, on a real terminal, `aegiscode` **asks** — an OSC 11 query
|
|
177
|
+
(`ESC ] 11 ; ? BEL`) that the terminal answers with its own background, e.g.
|
|
178
|
+
`rgb:1e1e/1e1e/2e2e`. That is the only signal that is neither an environment
|
|
179
|
+
variable nor a guess, and it is the one that matters: Alacritty, for instance,
|
|
180
|
+
sets no `COLORFGBG` and no `TERM_BACKGROUND`, so the palette used to be chosen
|
|
181
|
+
from silence. The environment is still read first and wins when set —
|
|
182
|
+
`COLORFGBG` (the background's ANSI index, as xterm, rxvt, Konsole and VTE
|
|
183
|
+
report it), `TERM_BACKGROUND=dark|light` (kitty, WezTerm), or
|
|
184
|
+
`AEGIS_BACKGROUND=dark|light` — and in that case nothing is asked at all. A
|
|
185
|
+
pipe, a CI run and `--print` never probe.
|
|
186
|
+
|
|
187
|
+
What the answer is *for*: a stored `/theme` row that cannot be read on the
|
|
188
|
+
terminal it is being restored on is corrected to the same palette family at the
|
|
189
|
+
other brightness (so "colorblind-friendly" survives, and the light/dark choice
|
|
190
|
+
inside it changes), saved, and announced once. A terminal that reports nothing
|
|
191
|
+
changes nothing — the dark default is not evidence, so a preference is never
|
|
192
|
+
overridden on the strength of it. `/terminal probe` asks again mid-session (for
|
|
193
|
+
a terminal whose theme changed after launch), and `/terminal background
|
|
194
|
+
dark|light` pins it outright without asking. None of this ever moves the mark,
|
|
195
|
+
the colour depth, the control sequences or the line ending.
|
|
196
|
+
|
|
197
|
+
Overrides, at launch — `--ascii`, `--unicode`, `--no-color`, `--color`,
|
|
198
|
+
`--width <cols>`, `--terminal` (print the report) — and in-session via
|
|
199
|
+
`/terminal ascii|unicode|color|no-color|background <dark|light>|probe|star <native|narrow>|width <cols>|auto|status`.
|
|
200
|
+
`/terminal auto` re-probes rather than restoring launch flags. `/terminal width`
|
|
201
|
+
pins the frame, so resizes are ignored until `/terminal auto`; every other
|
|
202
|
+
`/terminal` switch leaves resize handling intact — the background probe is
|
|
203
|
+
deliberately not routed through the code path that pins a frame, so asking about
|
|
204
|
+
the background can never freeze the width.
|
|
205
|
+
|
|
206
|
+
The same axes are settable by environment for scripts and CI: `AEGIS_ART`,
|
|
207
|
+
`AEGIS_ASCII`, `AEGIS_UNICODE`, `AEGIS_STAR`, `AEGIS_COLOR`, `AEGIS_VT`,
|
|
208
|
+
`AEGIS_WIDTH`, `AEGIS_WIDE_RUNES`, `AEGIS_BACKGROUND` (and `TERM_BACKGROUND`,
|
|
209
|
+
which the terminals that set it write themselves), plus `AEGIS_BACKGROUND_PROBE=0`
|
|
210
|
+
to skip the query while still honouring those variables. `NO_COLOR` is honoured
|
|
211
|
+
to the letter — "present and not an empty string, regardless of its value".
|
|
212
|
+
|
|
213
|
+
## First run
|
|
214
|
+
|
|
215
|
+
A genuine first run walks the reference's onboarding before the session starts —
|
|
216
|
+
the order is the reference's:
|
|
217
|
+
|
|
218
|
+
```
|
|
219
|
+
────────────────────────────────────────────────────────────────────────────────
|
|
220
|
+
Accessing workspace:
|
|
221
|
+
/home/you/project
|
|
222
|
+
|
|
223
|
+
Quick safety check: Is this a project you created or one you trust? …
|
|
224
|
+
AEGIS Code will be able to read, edit, and execute files here.
|
|
225
|
+
|
|
226
|
+
Security guide
|
|
227
|
+
|
|
228
|
+
❯ 1.Yes, I trust this folder
|
|
229
|
+
2.No, exit
|
|
230
|
+
|
|
231
|
+
Enter to confirm · Esc to cancel
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
then the theme picker (the reference's 7 rows — Auto, Dark/Light, plus
|
|
235
|
+
colourblind-friendly and ANSI-only variants, each previewed as a real diff in
|
|
236
|
+
that palette), then the welcome screen with the mark, a **Tips for getting
|
|
237
|
+
started** box and a **What's new** box. The chosen row is written to
|
|
238
|
+
`~/.aegiscode/config.json`, so `Welcome back!` is what you get next time and the
|
|
239
|
+
picker never reappears.
|
|
240
|
+
|
|
241
|
+
Declining the trust check **ends the process** rather than continuing — the
|
|
242
|
+
folder you just refused to vouch for is not read, edited or executed in.
|
|
243
|
+
`--continue` skips onboarding entirely.
|
|
244
|
+
|
|
245
|
+
Preferences survive a restart: model, effort, theme and vim mode are restored on
|
|
246
|
+
launch, and an explicit flag (`-m`, `--light`) always outranks the stored value.
|
|
247
|
+
|
|
248
|
+
## Commands
|
|
249
|
+
|
|
250
|
+
In a session, plain text is a prompt. `/help` lists commands, grouped by
|
|
251
|
+
category, the way the reference does. The registry is that client's, ported
|
|
252
|
+
command for command — 87 entries across nine categories:
|
|
253
|
+
|
|
254
|
+
| Category | Commands |
|
|
255
|
+
|---|---|
|
|
256
|
+
| Session & context | `/schedule` `/clear` `/compact` `/context` `/todos` `/config` `/exit` `/recap` `/resume` `/rewind` `/agents` `/status` `/teleport` `/version` `/new` `/skills` `/multiyolo` `/multi` `/research` `/debate` |
|
|
257
|
+
| Workspace | `/run` `/build` `/cd` `/init` `/clone` |
|
|
258
|
+
| Model & behavior | `/ping` `/effort` `/model` `/models` `/model-add` `/model-rm` `/theme` `/terminal` `/vim` `/permissions` `/hooks` `/credentials` `/install-github-app` `/thinking` `/mcp` `/memory` `/memory-deep` `/confirm` `/automode` *(alias `/yolo`)* `/router` `/class` |
|
|
259
|
+
| Data | `/copy` `/cost` `/export` `/tokens` `/sync` |
|
|
260
|
+
| Auth | `/login` `/logout` `/key` `/byok` `/byok-set` `/byok-rm` `/byok-key` `/byok-rm-key` |
|
|
261
|
+
| Support | `/help` `/doctor` `/upgrade` `/troubleshooting` `/feedback` `/bug` `/issue` `/onboarding` `/shell-completion` `/terminal-setup` `/pr-comments` `/prs` `/review` `/benchmark` `/billing` `/topup` `/cloud` `/gmail` `/release-notes` |
|
|
262
|
+
| Fun | `/radio` `/waifu` |
|
|
263
|
+
| Aegis plugin | `/aegis-status` `/aegis-ask` `/aegis-recall` `/aegis-remember` `/aegis-council` `/aegis-print` `/aegis-multi` `/tool` `/aegis-import` |
|
|
264
|
+
|
|
265
|
+
The table above is generated from `cli/src/commands.js` (`COMMANDS` +
|
|
266
|
+
`CATEGORIES`), which is the only authority on what exists — a hand-kept copy is
|
|
267
|
+
how it came to claim 75 entries while the code held 84 before this port.
|
|
268
|
+
|
|
269
|
+
`/help` shows the live list with hints; aliases are searchable in the `/`
|
|
270
|
+
palette exactly as they are there (`/ask` → `/aegis-ask`, `?` → `/help`,
|
|
271
|
+
`quit` → `/exit`, `tok` → `/tokens`, …).
|
|
272
|
+
|
|
273
|
+
Every command that talks to AEGIS names a tool from `mcp/tools.js`, and the test
|
|
274
|
+
suite asserts both directions: no command points at a tool that does not exist,
|
|
275
|
+
and no tool is unreachable from the prompt. Everything else is a real local
|
|
276
|
+
handler — `/run` detects and drives this project's dev command, `/init` sniffs
|
|
277
|
+
the project and writes `AEGIS.md`, `/export` writes the transcript out,
|
|
278
|
+
`/resume` and `/rewind` read the session store, `/cd` moves the working
|
|
279
|
+
directory, `/doctor` runs diagnostics.
|
|
280
|
+
|
|
281
|
+
## Model selection
|
|
282
|
+
|
|
283
|
+
Three layers, from broadest to narrowest. You only need the first one.
|
|
284
|
+
|
|
285
|
+
**1. The class — which route the turn takes.**
|
|
286
|
+
|
|
287
|
+
```bash
|
|
288
|
+
/class # show the picker
|
|
289
|
+
/class aegis # pooled AEGIS Cloud (the default)
|
|
290
|
+
/class byok # your own provider key, relayed by AEGIS
|
|
291
|
+
/class local # a model on your own machine or network (free)
|
|
292
|
+
```
|
|
293
|
+
|
|
294
|
+
A class is *whose credential pays and who talks to the vendor*, not a model.
|
|
295
|
+
Switching applies to your **next** turn and leaves the conversation intact. The
|
|
296
|
+
choice is written to `~/.aegiscode/config.json` (`modelClass`), so it survives a
|
|
297
|
+
restart.
|
|
298
|
+
|
|
299
|
+
| Class | Route | Who pays |
|
|
300
|
+
|---|---|---|
|
|
301
|
+
| `aegis` *(default)* | the AEGIS pool — one id, `nexus-brain` (alias `aegis-brain`), auto-routed server-side across whichever providers are live | your AEGIS account balance |
|
|
302
|
+
| `byok` | your provider key, relayed via `POST /api/v1/byok/chat/completions` | your provider direct, **plus** a small AEGIS handling fee on your account |
|
|
303
|
+
| `local` | a model on your own machine or network — your Ollama daemon at `http://localhost:11434` by default, keyless; any OpenAI-compatible server on that box works | nobody — free; there is no vendor to bill |
|
|
304
|
+
|
|
305
|
+
`local` never leaves your own network: it dials a model on your machine or your
|
|
306
|
+
LAN, and is refused fail-closed if the endpoint is not local — the check runs
|
|
307
|
+
when the base URL is saved and again before a request is dialled
|
|
308
|
+
(`desktop/lib/local/local.js` → `remoteRefusal`). The generic *remote*
|
|
309
|
+
custom-endpoint lanes (an arbitrary remote OpenAI- or Anthropic-compatible URL)
|
|
310
|
+
do not exist here; any OpenAI-compatible server on that box — llama.cpp, LM
|
|
311
|
+
Studio, vLLM — works by pointing the base URL at it.
|
|
312
|
+
|
|
313
|
+
**2. The model id — what to pin.**
|
|
314
|
+
|
|
315
|
+
```bash
|
|
316
|
+
/models # what you can pin, for the class you are on
|
|
317
|
+
/model # open the picker
|
|
318
|
+
/model nexus-brain # pin it
|
|
319
|
+
/model - # clear the pin, back to the class default
|
|
320
|
+
```
|
|
321
|
+
|
|
322
|
+
`/models` is class-aware: it answers from the pool catalogue under `aegis`, and
|
|
323
|
+
from the models your saved keys actually unlock under `byok`. A pin is
|
|
324
|
+
**cleared with a reason** if you switch to a class it does not belong to,
|
|
325
|
+
instead of failing later at the route.
|
|
326
|
+
|
|
327
|
+
Under `byok` every id is compound — `provider:model`:
|
|
328
|
+
|
|
329
|
+
```bash
|
|
330
|
+
/models # e.g. anthropic:claude-sonnet-4-5
|
|
331
|
+
/model anthropic:claude-sonnet-4-5
|
|
332
|
+
```
|
|
333
|
+
|
|
334
|
+
The `byok` list also carries the pooled **Nexus** row, marked *pooled lane —
|
|
335
|
+
/class aegis*. The two id spaces are disjoint, so without it a session sitting
|
|
336
|
+
on `byok` had a correct list with no way back to the pooled route in it.
|
|
337
|
+
Selecting it switches the class to `aegis` first (this is the one row that is
|
|
338
|
+
not a `provider:model` id); pinning it *without* switching is not offered,
|
|
339
|
+
because the relay would read `nexus-brain` as a provider name.
|
|
340
|
+
|
|
341
|
+
**3. Adding a model nobody has released yet.**
|
|
342
|
+
|
|
343
|
+
Vendors ship models faster than any client can be updated, and the BYOK relay is
|
|
344
|
+
a pass-through: your own vendor key authenticates upstream and AEGIS forwards the
|
|
345
|
+
model string it is handed. So an id your provider serves is callable the moment
|
|
346
|
+
your machine offers it as a row — which is what these do:
|
|
347
|
+
|
|
348
|
+
```bash
|
|
349
|
+
/model-add deepseek deepseek-v4.2-preview # offer it on this machine
|
|
350
|
+
/model-rm deepseek deepseek-v4.2-preview # forget it
|
|
351
|
+
/model-add deepseek # prompt for the id instead
|
|
352
|
+
```
|
|
353
|
+
|
|
354
|
+
`/model-add` resolves the provider against the relay's catalogue first, so a
|
|
355
|
+
provider the relay takes no key for is **refused** rather than stored — a
|
|
356
|
+
declaration for a slug the relay does not accept would appear in no picker at
|
|
357
|
+
all, and the failure would land on your first turn. The id itself is shape
|
|
358
|
+
checked (no spaces, no colon — `provider:model` is the id a pin uses) but never
|
|
359
|
+
checked against a vendor list: reaching a model the catalogue has not caught up
|
|
360
|
+
with is the entire point.
|
|
361
|
+
|
|
362
|
+
The declaration lives in **`~/.aegiscode/models.json`** (`$AEGISCODE_HOME` if you
|
|
363
|
+
set it), which is also the file the desktop's Settings pane writes and reads. Add
|
|
364
|
+
a model in the terminal and it is in the window's picker on its next refresh,
|
|
365
|
+
with no restart; add one in the window and `/models` shows it immediately. The
|
|
366
|
+
file is plain JSON and 0600, so a bulk edit is an editor away:
|
|
367
|
+
|
|
368
|
+
```json
|
|
369
|
+
{
|
|
370
|
+
"deepseek": ["deepseek-v4.2-preview"],
|
|
371
|
+
"anthropic": ["claude-opus-9-1"]
|
|
372
|
+
}
|
|
373
|
+
```
|
|
374
|
+
|
|
375
|
+
Nothing here is validated against a vendor on read, so a hand-typed row that the
|
|
376
|
+
vendor does not serve will 404 on your first turn — that is the one cost of the
|
|
377
|
+
escape hatch, and it is why the commands validate what they store.
|
|
378
|
+
|
|
379
|
+
```bash
|
|
380
|
+
aegiscode -m nexus-brain -p "…" # pin at launch
|
|
381
|
+
aegiscode -m anthropic:claude-sonnet-4-5 -p "…" # a BYOK id at launch
|
|
382
|
+
```
|
|
383
|
+
|
|
384
|
+
**3. Effort — how hard it reasons.**
|
|
385
|
+
|
|
386
|
+
```bash
|
|
387
|
+
/effort # show
|
|
388
|
+
/effort low|medium|high
|
|
389
|
+
```
|
|
390
|
+
|
|
391
|
+
Effort scales the token budget the provider is given, so it is the dial that
|
|
392
|
+
actually changes reasoning depth on a reasoning model (see the root README for
|
|
393
|
+
the per-provider mechanics).
|
|
394
|
+
|
|
395
|
+
> **A `byok` turn is single-shot.** The relay takes no `tools` parameter, so the
|
|
396
|
+
> agentic tool loop is off by construction — no file edits, no shell, no
|
|
397
|
+
> subagents, no approval cards. `/class` says so rather than letting you discover
|
|
398
|
+
> it mid-task.
|
|
399
|
+
|
|
400
|
+
## Bring your own key
|
|
401
|
+
|
|
402
|
+
Two lanes. The one people mix up is which key goes where, so state it plainly:
|
|
403
|
+
**`/byok-set` stores on your AEGIS account; `/byok-key` stores on this machine.**
|
|
404
|
+
|
|
405
|
+
| | `/byok-set <provider>` | `/byok-key <provider>` |
|
|
406
|
+
|---|---|---|
|
|
407
|
+
| Key lives | on your AEGIS account, encrypted server-side | in `~/.aegiscode/settings.json` (mode `0600`) |
|
|
408
|
+
| Follows you to other machines | yes | no |
|
|
409
|
+
| Reaches the vendor via | AEGIS, server-side | AEGIS's BYOK relay |
|
|
410
|
+
| Needed for `/class byok`? | no | **yes** — this is the one the relay reads |
|
|
411
|
+
|
|
412
|
+
### Save a key on this machine
|
|
413
|
+
|
|
414
|
+
```bash
|
|
415
|
+
/byok # list every provider, and which are already set
|
|
416
|
+
/byok-key openai # prompts, no echo, never enters history
|
|
417
|
+
/byok-key openai sk-… # scriptable form
|
|
418
|
+
/byok-rm-key openai # forget it
|
|
419
|
+
```
|
|
420
|
+
|
|
421
|
+
The first command is the one to run when you don't know a provider id. The
|
|
422
|
+
catalogue is server-side and grows, so `/byok` is the authority — each row names
|
|
423
|
+
the provider, the models its key unlocks, where the vendor issues it, and the
|
|
424
|
+
prefix a valid key starts with. A typo'd or wrong-vendor key is caught before it
|
|
425
|
+
is stored.
|
|
426
|
+
|
|
427
|
+
### Save a key on your account
|
|
428
|
+
|
|
429
|
+
```bash
|
|
430
|
+
/byok-set anthropic # prompts, no echo
|
|
431
|
+
/byok-rm anthropic # remove it
|
|
432
|
+
```
|
|
433
|
+
|
|
434
|
+
### What a BYOK turn costs
|
|
435
|
+
|
|
436
|
+
Bringing your own key does not make the turn free, and it is not meant to. AEGIS
|
|
437
|
+
pays the vendor nothing on this lane, so there is no provider cost to take a
|
|
438
|
+
margin on — the account is charged a flat **handling fee** per 1k tokens
|
|
439
|
+
instead, for the routing, prompt assembly, caching, tool bridging and uptime
|
|
440
|
+
that still happen server-side. It is deliberately well under the pooled price
|
|
441
|
+
for the same traffic, so BYOK stays the cheaper lane; it just is not the free
|
|
442
|
+
one.
|
|
443
|
+
|
|
444
|
+
The figure is published by the server (`GET /api/v1/byok/providers` returns
|
|
445
|
+
`fee`) and never hardcoded in this client, so what you see is what is charged.
|
|
446
|
+
Two consequences worth knowing:
|
|
447
|
+
|
|
448
|
+
- A BYOK turn needs an **AEGIS account key** as well as your provider key — that
|
|
449
|
+
is where the fee is billed. Without one the relay refuses up front and says so,
|
|
450
|
+
rather than running the turn and dropping the charge.
|
|
451
|
+
- If a fee is ever configured to zero the lane is genuinely free, and nothing in
|
|
452
|
+
this client needs to change to reflect that.
|
|
453
|
+
|
|
454
|
+
Removing a key is the only thing that stops the key being sent; unsetting
|
|
455
|
+
`/class byok` switches the route but leaves the key on disk.
|
|
456
|
+
|
|
457
|
+
## Command manual
|
|
458
|
+
|
|
459
|
+
Copy-paste, in the order you actually need them.
|
|
460
|
+
|
|
461
|
+
### Install and sign in
|
|
462
|
+
|
|
463
|
+
```bash
|
|
464
|
+
npm install -g aegiscode # requires Node 22+
|
|
465
|
+
aegiscode login # prompts for your AEGIS key, no echo
|
|
466
|
+
aegiscode key status # verify: masked key + which source is in use
|
|
467
|
+
aegiscode # start a session
|
|
468
|
+
```
|
|
469
|
+
|
|
470
|
+
No AEGIS key yet? Get one at <https://aegiscloud.org>. To run entirely on your
|
|
471
|
+
own provider key instead, skip `login` and see
|
|
472
|
+
[Bring your own key](#bring-your-own-key) — note that lane still bills its fee to
|
|
473
|
+
an AEGIS account.
|
|
474
|
+
|
|
475
|
+
### Day one in a repo
|
|
476
|
+
|
|
477
|
+
```bash
|
|
478
|
+
cd ~/my-project
|
|
479
|
+
aegiscode # first run asks you to trust the folder
|
|
480
|
+
/init # sniff the project, write AEGIS.md
|
|
481
|
+
/status # key, class, model, effort, cwd — one panel
|
|
482
|
+
```
|
|
483
|
+
|
|
484
|
+
Then just type. Plain text is a prompt.
|
|
485
|
+
|
|
486
|
+
### Ask one question and leave
|
|
487
|
+
|
|
488
|
+
```bash
|
|
489
|
+
aegiscode "explain this stack trace"
|
|
490
|
+
aegiscode -p "summarise docs/design.md" --json
|
|
491
|
+
echo "why is the sky blue" | aegiscode -p -
|
|
492
|
+
```
|
|
493
|
+
|
|
494
|
+
`--json` emits the answer plus the usage object, token total and balance.
|
|
495
|
+
|
|
496
|
+
### Switch how you're paying
|
|
497
|
+
|
|
498
|
+
```bash
|
|
499
|
+
/class # see every route and who pays
|
|
500
|
+
/class byok # use your own key
|
|
501
|
+
/byok-key openai # …save one first if it says you have none
|
|
502
|
+
/models # what that key unlocks
|
|
503
|
+
/model openai:gpt-4o # pin one
|
|
504
|
+
/class aegis # back to the pool
|
|
505
|
+
```
|
|
506
|
+
|
|
507
|
+
### Control the budget
|
|
508
|
+
|
|
509
|
+
```bash
|
|
510
|
+
/effort low # cheaper, shallower
|
|
511
|
+
/effort high # deeper reasoning
|
|
512
|
+
/cost # this session
|
|
513
|
+
/balance # tokens beside € on every ledger row
|
|
514
|
+
/billing # spend and plan
|
|
515
|
+
```
|
|
516
|
+
|
|
517
|
+
### Keep the work
|
|
518
|
+
|
|
519
|
+
```bash
|
|
520
|
+
/compact # shrink the context, keep the thread
|
|
521
|
+
/export markdown ~/notes/session.md
|
|
522
|
+
/resume # pick up a saved session
|
|
523
|
+
/rewind 3 # back up three turns
|
|
524
|
+
/sync # push pending, then pull
|
|
525
|
+
```
|
|
526
|
+
|
|
527
|
+
### When something is wrong
|
|
528
|
+
|
|
529
|
+
```bash
|
|
530
|
+
/doctor # diagnostics, in one panel
|
|
531
|
+
/status # key + class + model actually in effect
|
|
532
|
+
/byok # which provider keys are set
|
|
533
|
+
/troubleshooting
|
|
534
|
+
```
|
|
535
|
+
|
|
536
|
+
### Settings and the reply-ready alert
|
|
537
|
+
|
|
538
|
+
```bash
|
|
539
|
+
/config # every setting, and which store holds it
|
|
540
|
+
/config effort high # set one, typed (true/false/null, numbers, JSON, text)
|
|
541
|
+
/config reset themeIndex # back to the shipped value
|
|
542
|
+
```
|
|
543
|
+
|
|
544
|
+
`/config` writes through the same split every other surface uses: the keys in
|
|
545
|
+
`SHARED_PREF_KEYS` go to `preferences.json`, the file AEGIS Desktop's settings
|
|
546
|
+
window reads and writes too, and this shell's own keys (`lastCwd`,
|
|
547
|
+
`updateCheck`) stay in `config.json`. It never writes a file directly, so it
|
|
548
|
+
cannot leave the window and the shell holding two answers to one question.
|
|
549
|
+
|
|
550
|
+
```bash
|
|
551
|
+
/ping # show the state and the vocabulary
|
|
552
|
+
/ping bell # channel: off | bell | notify | both
|
|
553
|
+
/ping notify 120 # only turns longer than two minutes
|
|
554
|
+
/ping test # fire one now, to check this terminal
|
|
555
|
+
```
|
|
556
|
+
|
|
557
|
+
`/ping` is the terminal's half of the desktop's "reply ready" notification: a
|
|
558
|
+
turn that outlasted `pingMinSeconds` raises an OSC 9 / OSC 777 notification and
|
|
559
|
+
rings the bell, so you can stop watching a long turn. A turn you pressed Escape
|
|
560
|
+
on never pings — you were demonstrably looking at the screen — and neither does
|
|
561
|
+
a piped or headless run, which has no one to notify. `notify` needs a terminal
|
|
562
|
+
that implements those sequences (iTerm2, WezTerm, kitty, GNOME Terminal, Windows
|
|
563
|
+
Terminal); `/ping test` tells you whether yours does, and `/ping bell` is the
|
|
564
|
+
fallback every terminal has.
|
|
565
|
+
|
|
566
|
+
```bash
|
|
567
|
+
/todos # list
|
|
568
|
+
/todos add ship the retry fix # add one
|
|
569
|
+
/todos done 1 # by number, or by a unique text prefix
|
|
570
|
+
/todos clear
|
|
571
|
+
```
|
|
572
|
+
|
|
573
|
+
The list lives in `$AEGISCODE_HOME/todos.json` and survives compaction, so a
|
|
574
|
+
plan you wrote out mid-session is still there after the context is shrunk.
|
|
575
|
+
|
|
576
|
+
### Unattended work
|
|
577
|
+
|
|
578
|
+
```bash
|
|
579
|
+
aegiscode autonomous add "fix the flaky retry test" --cwd ~/repo
|
|
580
|
+
aegiscode autonomous list
|
|
581
|
+
aegiscode autonomous proceed --commit
|
|
582
|
+
```
|
|
583
|
+
|
|
584
|
+
Queued tasks always run on the pooled brain (`nexus-brain`); a task naming
|
|
585
|
+
another model is refused where you can still see it. `--commit` commits only the
|
|
586
|
+
paths that task's own tool layer wrote.
|
|
587
|
+
|
|
588
|
+
## Account key and cloud sync
|
|
589
|
+
|
|
590
|
+
Three ways in, one store: `aegiscode login <key>`, `/key <api_key>` (or a bare
|
|
591
|
+
`/key` to paste it echo-off), and `$AEGIS_API_KEY`. The first two persist;
|
|
592
|
+
the env var outranks the store and needs no persistence. `/login` used to be an
|
|
593
|
+
unavailable Claude Code auth-loop command pointing at `/byok-set` — which stores
|
|
594
|
+
a *provider* key, so that advice sent the AEGIS key into the wrong slot. It is
|
|
595
|
+
now the in-band way to set the account key, and `/logout` removes it.
|
|
596
|
+
|
|
597
|
+
Conversation sync is the same `conversationSyncPush/Pull` surface the desktop
|
|
598
|
+
uses, over the sessions this host keeps in `~/.aegiscode/history.jsonl`:
|
|
599
|
+
|
|
600
|
+
```bash
|
|
601
|
+
/sync # push what is pending, then pull — the one you want
|
|
602
|
+
/sync status # local / pending / in-sync counts, last push and pull
|
|
603
|
+
/sync on | off # auto-push after each turn (off by default)
|
|
604
|
+
/cloud # key + sync state in one panel
|
|
605
|
+
/cloud activate # turn on cloud memory for the account
|
|
606
|
+
```
|
|
607
|
+
|
|
608
|
+
Sync is **off by default** on purpose: the server charges a push for the growth
|
|
609
|
+
of a session against the plan's synced-token ceiling, so nothing is uploaded
|
|
610
|
+
until you ask. A refusal (HTTP 402) is reported as a quota refusal with the way
|
|
611
|
+
out, not as "sync failed". Imported remote sessions land in the same store
|
|
612
|
+
`/resume` reads, and are marked `imported` with estimated token counts — never
|
|
613
|
+
passed off as measured here.
|
|
614
|
+
|
|
615
|
+
## One memory, shared with AEGIS Desktop
|
|
616
|
+
|
|
617
|
+
`~/.aegiscode/` is the data dir for **every** AEGIS host — this CLI, AEGIS
|
|
618
|
+
Desktop and the MCP plugin built on the same account:
|
|
619
|
+
|
|
620
|
+
| File | What it holds | Written by |
|
|
621
|
+
|---|---|---|
|
|
622
|
+
| `credentials.json` | the account key, mode 0600 | `aegiscode login`, `/key`, the desktop's Settings pane |
|
|
623
|
+
| `sessions.json` | every conversation, one record per session | both hosts, live |
|
|
624
|
+
| `history.jsonl` | this host's per-exchange ledger (feeds `/cost`) | the CLI |
|
|
625
|
+
| `config.json` | preferences, permissions | the CLI |
|
|
626
|
+
|
|
627
|
+
Sign in once and every face is signed in: they resolve the key with the
|
|
628
|
+
same precedence (`$AEGIS_API_KEY` → `credentials.json` → an older `config.json`),
|
|
629
|
+
and when two faces hold a key the **most recently saved one wins** — so rotating
|
|
630
|
+
it from the terminal does not leave the app 401-ing on a stale string.
|
|
631
|
+
|
|
632
|
+
Sessions are shared too, and not only through the cloud. `/resume` lists a
|
|
633
|
+
thread typed in the desktop, and the desktop's session list shows a thread typed
|
|
634
|
+
here — same file, no sync and no network. An upgrade adopts a desktop install's
|
|
635
|
+
private `sessions.json` into the shared store once, so no existing conversation
|
|
636
|
+
is lost. Records carry `origin`, and terminal sessions are **not** enrolled in
|
|
637
|
+
the desktop's push queue (that would spend the account's synced-token quota as a
|
|
638
|
+
side effect of typing in a shell); this host's own `/sync` covers them.
|
|
639
|
+
|
|
640
|
+
There are currently **no** `unavailable` commands: every entry in the registry
|
|
641
|
+
either runs or is a real handler that says honestly what it cannot do.
|
|
642
|
+
|
|
643
|
+
## The chatflow
|
|
644
|
+
|
|
645
|
+
The session is the reference's loop, ported rather than approximated: an
|
|
646
|
+
alternate-screen frame of header rule, transcript viewport, spinner/effort line,
|
|
647
|
+
input line and status line, driven by a raw key stream.
|
|
648
|
+
|
|
649
|
+
```
|
|
650
|
+
╭───────────────────────────── AEGIS Code v6.3.0 ─────────────────────────────╮
|
|
651
|
+
❯ summarise what changed in the token accounting
|
|
652
|
+
● Three things changed, and one of them was costing you money:
|
|
653
|
+
|
|
654
|
+
- the pool merges worker usage instead of overwriting it
|
|
655
|
+
- cache reads and writes are billed, not ignored
|
|
656
|
+
- a zero-token call no longer refunds its reservation
|
|
657
|
+
|
|
658
|
+
● Running 1 shell command…
|
|
659
|
+
⎿ $ git log --oneline -3
|
|
660
|
+
Ran 1 shell command
|
|
661
|
+
✻ Worked for 6s
|
|
662
|
+
⎿ nexus-brain · 1,562 tok · 1,250/312 · €0.0007 · 4.2s
|
|
663
|
+
● high · /effort
|
|
664
|
+
────────────────────────────────────────────────────────────────────────────────
|
|
665
|
+
❯ Try "edit <filepath> to..."
|
|
666
|
+
────────────────────────────────────────────────────────────────────────────────
|
|
667
|
+
⏸ manual mode on · ? for shortcuts · ← for agents
|
|
668
|
+
```
|
|
669
|
+
|
|
670
|
+
What the loop does, in the order a turn happens:
|
|
671
|
+
|
|
672
|
+
- **You type.** The input line has history (`↑`/`↓`), tab completion for `/…`,
|
|
673
|
+
word motions, a rotating suggestion when empty, horizontal scrolling for a
|
|
674
|
+
long line, and a collapsed one-line preview for a multi-line paste (the full
|
|
675
|
+
text is still what gets submitted).
|
|
676
|
+
- **The turn starts.** A random verb from the reference set shimmers in coral
|
|
677
|
+
beside the spinner, with elapsed time and a live token estimate.
|
|
678
|
+
- **The answer streams into a row**, markdown-rendered, opening with `●` — one
|
|
679
|
+
marker, whatever the answer's length, so the glyph does not multiply when the
|
|
680
|
+
text wraps.
|
|
681
|
+
- **Tool calls become rows.** `● Running 1 shell command… · 3s` resolves to
|
|
682
|
+
`Ran 1 shell command` when the call returns — paired by tool-call id, so
|
|
683
|
+
parallel same-name calls and nested subagent rows stay separate, and the
|
|
684
|
+
plural is right.
|
|
685
|
+
- **The turn ends** with `✻ Churned for Ns` (no tools) or `✻ Worked for Ns`
|
|
686
|
+
(tools), then an accounting row: `⎿ nexus-brain · 1,562 tok · 1,250/312 ·
|
|
687
|
+
€0.0007 · 4.2s`.
|
|
688
|
+
- **Esc interrupts.** The abort reaches the transport through an
|
|
689
|
+
`AbortSignal`, so the in-flight provider call is genuinely cancelled — it
|
|
690
|
+
does not keep running and billing behind a "stopped" label — and whatever had
|
|
691
|
+
already streamed is kept, marked `(stopped)`.
|
|
692
|
+
- **Keys work mid-turn.** Esc/Ctrl-C abort; PgUp/PgDn and the wheel scroll the
|
|
693
|
+
transcript live (and scrolling up is anchored to an absolute line index, so an
|
|
694
|
+
arriving delta does not drag the reader back to the bottom); everything else
|
|
695
|
+
you type is replayed into the input line afterwards.
|
|
696
|
+
- **Overlays**: `/` the palette (fuzzy-ranked, with `Tab` to complete to the
|
|
697
|
+
highlighted command), `alt+p` the model picker, `/effort` the effort picker,
|
|
698
|
+
`/resume` the session list, `?` the shortcut grid, `ctrl+o` permissions, and a
|
|
699
|
+
centred Yes/No dialog when a mutating tool needs approval. `Esc` closes an
|
|
700
|
+
overlay, and clears the input line when nothing is open.
|
|
701
|
+
- **Every turn is persisted** to `~/.aegiscode/history.jsonl` and mirrored into
|
|
702
|
+
the shared `~/.aegiscode/sessions.json`, with a transcript checkpoint alongside
|
|
703
|
+
them, so `/resume`, `/cost`, `/clear` and `/rewind` all have something real to
|
|
704
|
+
read — and the desktop app sees the same conversations. On exit the session
|
|
705
|
+
prints how to come back to it.
|
|
706
|
+
|
|
707
|
+
Anything that is not a real terminal — a pipe, `-p`, a CI run — stays a linear
|
|
708
|
+
transcript written once to scrollback, so output remains pipeable and
|
|
709
|
+
scriptable.
|
|
710
|
+
|
|
711
|
+
Render it yourself, with no key and no network:
|
|
712
|
+
|
|
713
|
+
```bash
|
|
714
|
+
node cli/scripts/demo.mjs # from a source checkout
|
|
715
|
+
# --light, --width 100, --plain also work
|
|
716
|
+
```
|
|
717
|
+
|
|
718
|
+
## Design notes
|
|
719
|
+
|
|
720
|
+
**It looks like the reference on purpose.** The gold/coral/lavender palette,
|
|
721
|
+
the `✦`-studded welcome mark (mascot, crescent moon and diving whale), the `❯`
|
|
722
|
+
prompt, the `⎿` hook rows and the `✻` spinner line are the reference's
|
|
723
|
+
design system, adopted wholesale rather than approximated: the palette, glyphs,
|
|
724
|
+
welcome art, working verbs and command vocabulary all come from it, and
|
|
725
|
+
`test/cli-conformance.test.mjs` pins every RGB triple, glyph, spinner frame, verb
|
|
726
|
+
and art row to that source so the two hosts cannot drift apart. (An earlier
|
|
727
|
+
revision of this CLI was a deliberate divergence — a violet/cyan "Signal" theme
|
|
728
|
+
with a test asserting it. That direction is gone.)
|
|
729
|
+
|
|
730
|
+
**A full-screen chatflow on a terminal, a linear transcript everywhere else.**
|
|
731
|
+
On a TTY the session is the reference's loop: alternate screen, header rule,
|
|
732
|
+
transcript viewport, spinner, effort line, input line, status line, overlays.
|
|
733
|
+
Anywhere else — a pipe, `-p`, CI — turns are written once to the scrollback
|
|
734
|
+
instead, so output stays selectable, searchable and pipeable. A tool you script
|
|
735
|
+
should not become un-scriptable because the interactive mode got nicer.
|
|
736
|
+
|
|
737
|
+
**The command registry is the reference's, ported.** Names, aliases,
|
|
738
|
+
categories, the palette grouping and the handlers themselves come from it, with
|
|
739
|
+
`test/cli-commands.test.mjs` asserting the full name list so a silent drop
|
|
740
|
+
fails the build. Local capability that the reference has — a dev-server runner,
|
|
741
|
+
project sniffing, an export path, a session store, checkpoints, permission
|
|
742
|
+
rules, subagent presets — was ported with it rather than stubbed.
|
|
743
|
+
|
|
744
|
+
**Tokens beside money, always.** A turn prints what it consumed and what it
|
|
745
|
+
settled at, in the same line: `1,562 tok ∙ 1,250/312 ∙ €0.0007`. Sub-cent
|
|
746
|
+
amounts keep four decimals, because a €0.0007 call rendered at 2dp reads as
|
|
747
|
+
free usage next to a token count.
|
|
748
|
+
|
|
749
|
+
**Esc really stops the call.** The interrupt travels as an `AbortSignal` into
|
|
750
|
+
the transport, and the engine does not re-dispatch after an abort — a cancelled
|
|
751
|
+
turn used to fire a second billed provider request ("the model said nothing"
|
|
752
|
+
recovery, triggered by the empty result an abort produces) and stream the
|
|
753
|
+
partial answer twice. `test/local-engine.test.mjs` pins the dispatch count.
|
|
754
|
+
|
|
755
|
+
## Tests
|
|
756
|
+
|
|
757
|
+
```bash
|
|
758
|
+
node ../test/cli-chatflow.test.mjs # the session loop, driven with a synthetic key stream
|
|
759
|
+
node ../test/cli-commands.test.mjs # the full command table, aliases, dispatch contract
|
|
760
|
+
node ../test/cli-panels.test.mjs # every panel builder, defensive against missing data
|
|
761
|
+
node ../test/cli-support.test.mjs # config/history/tokens/agents/export/checkpoints
|
|
762
|
+
node ../test/cli-conformance.test.mjs # the design guard: palette, glyphs, art, verbs
|
|
763
|
+
node ../test/cli-terminal-caps.test.mjs # capability resolution: PowerShell and zsh agree
|
|
764
|
+
node ../test/cli-render.test.mjs # width safety, accounting, live region
|
|
765
|
+
node ../test/cli-overlays.test.mjs # the / palette, model + effort pickers, resume list
|
|
766
|
+
node ../test/cli-fuzzy.test.mjs # palette ranking and match positions
|
|
767
|
+
node ../test/cli-ping-todos.test.mjs # /ping's four properties, /todos, /config's store routing
|
|
768
|
+
node ../test/cli-markdown.test.mjs # span-line markdown, cell widths
|
|
769
|
+
node ../test/cli-tools.test.mjs # registry parity with the MCP host + dispatch
|
|
770
|
+
node ../test/cli-run.test.mjs # the real binary against a real backend
|
|
771
|
+
node ../test/cli-package.test.mjs # the published layout, isolated from the repo
|
|
772
|
+
npm test # all of the above
|
|
773
|
+
```
|
|
774
|
+
|
|
775
|
+
The chatflow test drives `runSession` for real: a synthetic key stream, stdout
|
|
776
|
+
captured, and the app entered exactly as `bin/aegiscode.js` enters it. It covers
|
|
777
|
+
the turn lifecycle, tool-row pairing, the interrupt reaching the transport, the
|
|
778
|
+
viewport anchor, the input line's cell maths and an abort that must not
|
|
779
|
+
re-dispatch.
|
|
780
|
+
|
|
781
|
+
`npm run predist` stages `client/`, `mcp/tools.js` and the desktop's `usage.js`,
|
|
782
|
+
`local/engine.js` and `local/agents.js` into `cli/vendor/` (gitignored) so the
|
|
783
|
+
published package resolves its own modules. `test/cli-package.test.mjs` copies
|
|
784
|
+
that tree somewhere with no repo around it and runs the binary there.
|