aegiscode 3.1.8 → 3.2.0

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 CHANGED
@@ -58,7 +58,7 @@ aegiscode also ships as a native Electron desktop app — same AI engine, same m
58
58
 
59
59
  ```bash
60
60
  # Linux
61
- wget https://pub-a975e7eee93c4432a2bf952f50705bf1.r2.dev/aegiscode-gui.deb
61
+ wget https://dl.aegiscloud.org/aegiscode-gui.deb
62
62
  sudo dpkg -i aegiscode-gui.deb
63
63
  ```
64
64
 
@@ -138,6 +138,8 @@ aegis --model deepseek-chat # use a specific model
138
138
  aegis --router # start with the auto-router on
139
139
  aegis --continue # resume last session
140
140
  aegis --resume <session-id> # resume specific session
141
+ aegis --print "what does this repo do?" # headless — print response, exit
142
+ aegis --print --output-format json "summarize this" # headless JSON output, for scripts
141
143
  ```
142
144
 
143
145
  ---
@@ -181,34 +183,40 @@ Any OpenAI-compatible API can be added as a custom model.
181
183
 
182
184
  ## Commands
183
185
 
186
+ Full reference with copy-paste examples: **[aegiscloud.org/aegiscode/commands](https://aegiscloud.org/aegiscode/commands)**
187
+
184
188
  | Command | Alias | Description |
185
189
  |---------|-------|-------------|
186
- | `/help` | `/?` `/h` | Show all commands |
187
- | `/model` | `/m` | Interactive model switcher |
188
- | `/model <id>` | | Switch to model by ID |
190
+ | `/help [command]` | `/?` `/h` | Show all commands, or detailed help for one |
191
+ | `/model [id]` | `/m` | Interactive model switcher, or switch by ID |
189
192
  | `/model list` | | List all configured models |
190
193
  | `/model add <id> <name> <model> <baseURL> <apiKey>` | | Add a custom model |
191
194
  | `/model remove <id>` | | Remove a model |
192
- | `/router` | | Show auto-router status and tier mapping |
193
- | `/router on` / `/router off` | | Toggle automatic per-message model routing |
195
+ | `/router [on\|off\|stats]` | | Show/toggle auto-router status and tier mapping |
194
196
  | `/router set <tier> <id>` | | Pin a model to the simple/medium/complex tier |
197
+ | `/effort [off\|low\|medium\|high\|max]` | | Set Claude's extended-thinking effort level |
198
+ | `/confirm [on\|off] [model-id]` | `/confirmations` | Toggle tool-call confirmation prompt |
199
+ | `/yolo [on\|off]` | | Toggle auto-approve for all tool calls |
195
200
  | `/clear` | `/cls` | Clear chat history |
196
201
  | `/compact` | | Compress context to save tokens |
197
202
  | `/status` | `/st` | Show session info and token usage |
198
- | `/theme` | `/t` | Switch UI theme |
203
+ | `/tokens` | `/tok` | Token usage graph and estimated spend |
204
+ | `/theme [name]` | `/t` | Show or switch UI theme |
199
205
  | `/thinking` | | Toggle thinking blocks |
200
- | `/copy` | `/cp` | Copy last code block to clipboard |
201
- | `/copy N` | | Copy Nth code block |
202
- | `/yolo` | | Toggle auto-approve for all tool calls |
206
+ | `/copy [n\|last\|list]` | `/cp` | Copy a code block to clipboard |
203
207
  | `/multi <task>` | | Run task across multiple agents in parallel |
204
- | `/multiyolo <task>` | | Same as /multi with auto-approved tool calls |
208
+ | `/multiyolo <task>` | | Same as `/multi` with auto-approved tool calls |
205
209
  | `/build <description>` | `/forge` | Build an app with multiple AI models in parallel |
210
+ | `/clone <url> [--name <project>]` | `/fetch-site` `/websnap` | Clone a website using DeepSeek |
206
211
  | `/council <question>` | | Multi-model majority vote |
207
- | `/debate <question>` | | Structured multi-model debate across rounds |
212
+ | `/debate <topic> [--rounds N]` | `/db` | Structured multi-model debate across rounds |
208
213
  | `/research <question>` | | Multi-agent research |
209
- | `/memory` | | Manage semantic memory |
210
- | `/skills` | `/sk` | List loaded skills |
211
- | `/hooks` | | View and manage hooks |
214
+ | `/memory [activate\|stats\|clear]` | | Manage semantic memory |
215
+ | `/cloud [activate\|status]` | | Manage AEGIS Cloud sync |
216
+ | `/billing` | | Show subscription and billing info |
217
+ | `/skills [refresh]` | `/sk` | List and manage loaded skills |
218
+ | `/hooks [status\|list]` | | View and manage hooks |
219
+ | `/mcp [tools\|<server>]` | | Show MCP server status and tools |
212
220
  | `/version` | `/v` | Show version info |
213
221
 
214
222
  ---
File without changes
package/bin/cli.js ADDED
@@ -0,0 +1,68 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Thin entry-point for the aegis-cli binary.
4
+ *
5
+ * Detects the current platform, locates the matching binary downloaded by
6
+ * scripts/download-binary.mjs (postinstall), and spawns it with the same
7
+ * arguments and environment.
8
+ *
9
+ * This file is linked by npm as `aegis` and `aegis-cli` in PATH.
10
+ */
11
+
12
+ import { spawn } from 'child_process';
13
+ import { join, dirname } from 'path';
14
+ import { fileURLToPath } from 'url';
15
+ import { existsSync } from 'fs';
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
+ const BIN_DIR = join(__dirname);
19
+
20
+ // Must match PLATFORM_MAP in scripts/download-binary.mjs
21
+ const PLATFORM_MAP = {
22
+ 'linux-x64': 'aegis-cli-linux-x64',
23
+ 'linux-arm64': 'aegis-cli-linux-arm64',
24
+ 'darwin-x64': 'aegis-cli-darwin-x64',
25
+ 'darwin-arm64': 'aegis-cli-darwin-arm64',
26
+ 'win32-x64': 'aegis-cli-win-x64.exe',
27
+ };
28
+
29
+ const key = `${process.platform}-${process.arch}`;
30
+ const binaryName = PLATFORM_MAP[key];
31
+
32
+ if (!binaryName) {
33
+ console.error(`Unsupported platform: ${key}`);
34
+ console.error('See https://github.com/aegisinfo/aegiscode#readme for supported platforms');
35
+ process.exit(1);
36
+ }
37
+
38
+ const binaryPath = join(BIN_DIR, binaryName);
39
+
40
+ if (!existsSync(binaryPath)) {
41
+ console.error('');
42
+ console.error(`aegis-cli binary not found at: ${binaryPath}`);
43
+ console.error('');
44
+ console.error(' This usually means the postinstall script failed to download the binary.');
45
+ console.error(' Try reinstalling:');
46
+ console.error(' npm install -g aegiscode');
47
+ console.error('');
48
+ console.error(' Or download manually from:');
49
+ console.error(' https://github.com/aegisinfo/aegiscode/releases');
50
+ console.error(' and place the binary in:');
51
+ console.error(' ' + BIN_DIR);
52
+ console.error('');
53
+ process.exit(1);
54
+ }
55
+
56
+ const child = spawn(binaryPath, process.argv.slice(2), {
57
+ stdio: 'inherit',
58
+ env: { ...process.env },
59
+ });
60
+
61
+ child.on('exit', (code, signal) => {
62
+ process.exit(code ?? (signal ? 128 + signal : 1));
63
+ });
64
+
65
+ child.on('error', (err) => {
66
+ console.error(`Failed to launch aegis-cli: ${err.message}`);
67
+ process.exit(1);
68
+ });
package/package.json CHANGED
@@ -1,18 +1,18 @@
1
1
  {
2
2
  "name": "aegiscode",
3
- "version": "3.1.8",
4
- "description": "A CLI Coding Agent inspired by Claude Code - An AI-powered coding assistant that can read, write, and execute code",
3
+ "version": "3.2.0",
4
+ "description": "AEGIS CLI AI-powered coding assistant. Downloads and runs the prebuilt aegis-cli binary.",
5
5
  "type": "module",
6
- "main": "dist/main.js",
7
6
  "bin": {
8
- "aegis": "./dist/main.js",
9
- "aegis-cli": "./dist/main.js",
10
- "aegis-gui": "./gui/run-gui.cjs"
7
+ "aegis": "./bin/cli.js",
8
+ "aegis-cli": "./bin/cli.js"
11
9
  },
12
10
  "scripts": {
13
- "dev": "NODE_NO_WARNINGS=1 tsx src/main.tsx",
11
+ "postinstall": "node scripts/download-binary.mjs",
12
+ "prepublishOnly": "node scripts/download-binary.mjs",
14
13
  "build": "node esbuild.mjs",
15
- "publish:release": "node esbuild.mjs",
14
+ "build:standalone": "bash build-standalone.sh",
15
+ "dev": "NODE_NO_WARNINGS=1 tsx src/main.tsx",
16
16
  "start": "node --no-deprecation dist/main.js",
17
17
  "typecheck": "tsc --noEmit",
18
18
  "test:prompts": "tsx src/prompts/test.ts",
@@ -20,9 +20,7 @@
20
20
  "test:pipeline": "tsx src/tools/execution/test.ts",
21
21
  "test:context": "tsx src/context/test.ts",
22
22
  "test:mcp": "tsx src/mcp/test.ts",
23
- "test:store": "tsx src/store/test.ts",
24
- "gui": "node ./gui/run-gui.cjs",
25
- "prepublishOnly": "node esbuild.mjs"
23
+ "test:store": "tsx src/store/test.ts"
26
24
  },
27
25
  "keywords": [
28
26
  "cli",
@@ -48,50 +46,17 @@
48
46
  "url": "https://github.com/aegisinfo/aegiscode/issues"
49
47
  },
50
48
  "files": [
51
- "dist/main.js",
52
- "gui/run-gui.cjs",
49
+ "bin/",
50
+ "scripts/",
53
51
  "README.md",
54
52
  "LICENSE"
55
53
  ],
56
54
  "engines": {
57
55
  "node": ">=22.0.0"
58
56
  },
59
- "dependencies": {
60
- "@modelcontextprotocol/sdk": "^1.25.3",
61
- "@xenova/transformers": "^2.17.2",
62
- "chalk": "^5.4.1",
63
- "dotenv": "^17.4.2",
64
- "fuse.js": "^7.4.1",
65
- "glob": "^13.0.0",
66
- "ink": "^7.0.5",
67
- "ink-text-input": "^6.0.0",
68
- "js-tiktoken": "^1.0.21",
69
- "lowlight": "^3.3.0",
70
- "minimatch": "^10.1.1",
71
- "nanoid": "^5.1.6",
72
- "openai": "^4.77.0",
73
- "react": "^19.2.7",
74
- "react-dom": "^19.2.7",
75
- "sql.js": "^1.14.1",
76
- "string-width": "^8.1.1",
77
- "uuid": "^14.0.0",
78
- "yaml": "^2.8.2",
79
- "yargs": "^17.7.2",
80
- "zod": "^3.24.2",
81
- "zod-to-json-schema": "^3.25.1",
82
- "zustand": "^5.0.14"
83
- },
84
57
  "devDependencies": {
85
- "@types/minimatch": "^6.0.0",
86
58
  "@types/node": "^22.19.19",
87
- "@types/react": "^19.2.16",
88
- "@types/react-dom": "^19.2.3",
89
- "@types/sql.js": "^1.4.11",
90
- "@types/uuid": "^11.0.0",
91
- "@types/yargs": "^17.0.33",
92
- "electron": "^42.4.1",
93
59
  "esbuild": "^0.28.0",
94
- "react-devtools-core": "^7.0.1",
95
60
  "tsx": "^4.22.4",
96
61
  "typescript": "^5.7.2"
97
62
  }
@@ -0,0 +1,155 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * postinstall script — downloads the prebuilt aegis-cli binary for the current platform.
4
+ * The binary is saved to <package>/bin/ and then spawned by bin/cli.js.
5
+ *
6
+ * Requires zero external dependencies (uses only Node.js built-ins).
7
+ *
8
+ * Binary source: GitHub releases
9
+ * https://github.com/aegisinfo/aegiscode/releases/latest/download/aegis-cli-{platform}-{arch}
10
+ */
11
+
12
+ import { createWriteStream, existsSync, chmodSync, mkdirSync } from 'fs';
13
+ import { get } from 'https';
14
+ import { join, dirname } from 'path';
15
+ import { fileURLToPath } from 'url';
16
+
17
+ const __dirname = dirname(fileURLToPath(import.meta.url));
18
+ const PACKAGE_ROOT = join(__dirname, '..');
19
+ const BIN_DIR = join(PACKAGE_ROOT, 'bin');
20
+
21
+ const BASE_URL =
22
+ 'https://github.com/aegisinfo/aegiscode/releases/latest/download';
23
+
24
+ // Maps Node.js process.platform + process.arch → GitHub release asset name
25
+ const PLATFORM_MAP = {
26
+ 'linux-x64': 'aegis-cli-linux-x64',
27
+ 'linux-arm64': 'aegis-cli-linux-arm64',
28
+ 'darwin-x64': 'aegis-cli-darwin-x64',
29
+ 'darwin-arm64': 'aegis-cli-darwin-arm64',
30
+ 'win32-x64': 'aegis-cli-win-x64.exe',
31
+ };
32
+
33
+ // Fallback URLs for platforms that don't have a dedicated binary yet
34
+ const FALLBACK_MAP = {
35
+ 'linux-arm': 'aegis-cli-linux-arm64',
36
+ 'darwin': 'aegis-cli-darwin-x64',
37
+ };
38
+
39
+ // ---------------------------------------------------------------------------
40
+ // Helpers
41
+ // ---------------------------------------------------------------------------
42
+
43
+ function detectBinaryName() {
44
+ const os = process.platform;
45
+ const arch = process.arch;
46
+ const key = `${os}-${arch}`;
47
+
48
+ if (PLATFORM_MAP[key]) return PLATFORM_MAP[key];
49
+
50
+ // Try fallback (e.g. linux-arm → linux-arm64 binary if close enough)
51
+ for (const [pattern, fallback] of Object.entries(FALLBACK_MAP)) {
52
+ if (key.startsWith(pattern)) return fallback;
53
+ }
54
+
55
+ throw new Error(
56
+ `Unsupported platform: ${key}\n` +
57
+ ` Supported: ${Object.keys(PLATFORM_MAP).join(', ')}\n` +
58
+ ` You can build from source: git clone https://github.com/aegisinfo/aegiscode && cd aegiscode && npm install && npm run build`
59
+ );
60
+ }
61
+
62
+ function downloadFile(url, dest) {
63
+ return new Promise((resolve, reject) => {
64
+ const file = createWriteStream(dest);
65
+ const req = get(url, (res) => {
66
+ // Follow redirect (GitHub releases redirect to S3)
67
+ if (res.statusCode >= 300 && res.statusCode < 400 && res.headers.location) {
68
+ file.close();
69
+ // Avoid file-exists check on redirect target — let the stream overwrite
70
+ downloadFile(res.headers.location, dest).then(resolve).catch(reject);
71
+ return;
72
+ }
73
+
74
+ if (res.statusCode !== 200) {
75
+ file.close();
76
+ // Try to collect error body
77
+ let body = '';
78
+ res.on('data', (chunk) => (body += chunk.toString()));
79
+ res.on('end', () => {
80
+ const detail = body.trim().slice(0, 200);
81
+ reject(
82
+ new Error(`HTTP ${res.statusCode} — ${detail || 'no body'}`)
83
+ );
84
+ });
85
+ return;
86
+ }
87
+
88
+ res.pipe(file);
89
+ file.on('finish', () => {
90
+ file.close();
91
+ resolve();
92
+ });
93
+ });
94
+
95
+ req.on('error', (err) => {
96
+ file.close();
97
+ // Attempt cleanup
98
+ try { file.close(); } catch { /* ignore */ }
99
+ reject(err);
100
+ });
101
+
102
+ req.setTimeout(60_000, () => {
103
+ req.destroy();
104
+ reject(new Error('Download timed out after 60s'));
105
+ });
106
+ });
107
+ }
108
+
109
+ // ---------------------------------------------------------------------------
110
+ // Main
111
+ // ---------------------------------------------------------------------------
112
+
113
+ async function main() {
114
+ const binaryName = detectBinaryName();
115
+ const url = `${BASE_URL}/${binaryName}`;
116
+ const dest = join(BIN_DIR, binaryName);
117
+
118
+ // Check if binary already exists (reinstall / postinstall after prepublish)
119
+ if (existsSync(dest)) {
120
+ console.log(`✓ aegis-cli already installed at ${dest}`);
121
+ chmodSync(dest, 0o755);
122
+ return;
123
+ }
124
+
125
+ console.log(`⬡ Downloading aegis-cli for ${process.platform}-${process.arch}...`);
126
+
127
+ mkdirSync(BIN_DIR, { recursive: true });
128
+
129
+ try {
130
+ await downloadFile(url, dest);
131
+ chmodSync(dest, 0o755);
132
+ console.log(`✓ aegis-cli installed to ${dest}`);
133
+ } catch (err) {
134
+ console.error('');
135
+ console.error(`⚠ Failed to download aegis-cli binary: ${err.message}`);
136
+ console.error('');
137
+ console.error(' Possible causes:');
138
+ console.error(' • No binary release for your platform yet');
139
+ console.error(' • No internet connectivity');
140
+ console.error(' • GitHub releases are unavailable');
141
+ console.error('');
142
+ console.error(' Options:');
143
+ console.error(' 1. Download manually from: https://github.com/aegisinfo/aegiscode/releases');
144
+ console.error(' and place the binary in: ' + BIN_DIR);
145
+ console.error(' 2. Build from source:');
146
+ console.error(' git clone https://github.com/aegisinfo/aegiscode');
147
+ console.error(' cd aegiscode && npm install && npm run build');
148
+ console.error(' 3. Install via installer script:');
149
+ console.error(' curl -fsSL https://dl.aegiscloud.org/install.sh | bash');
150
+ console.error('');
151
+ process.exit(1);
152
+ }
153
+ }
154
+
155
+ main();