aemeathcli 1.0.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.
Files changed (102) hide show
  1. package/README.md +607 -0
  2. package/dist/App-P4MYD4QY.js +2719 -0
  3. package/dist/App-P4MYD4QY.js.map +1 -0
  4. package/dist/api-key-fallback-YQQBOQIL.js +11 -0
  5. package/dist/api-key-fallback-YQQBOQIL.js.map +1 -0
  6. package/dist/chunk-4IJD72YB.js +184 -0
  7. package/dist/chunk-4IJD72YB.js.map +1 -0
  8. package/dist/chunk-6PDJ45T4.js +325 -0
  9. package/dist/chunk-6PDJ45T4.js.map +1 -0
  10. package/dist/chunk-CARHU3DO.js +562 -0
  11. package/dist/chunk-CARHU3DO.js.map +1 -0
  12. package/dist/chunk-CGEV3ARR.js +80 -0
  13. package/dist/chunk-CGEV3ARR.js.map +1 -0
  14. package/dist/chunk-CS5X3BWX.js +27 -0
  15. package/dist/chunk-CS5X3BWX.js.map +1 -0
  16. package/dist/chunk-CYQNBB25.js +44 -0
  17. package/dist/chunk-CYQNBB25.js.map +1 -0
  18. package/dist/chunk-DAHGLHNR.js +657 -0
  19. package/dist/chunk-DAHGLHNR.js.map +1 -0
  20. package/dist/chunk-H66O5Z2V.js +305 -0
  21. package/dist/chunk-H66O5Z2V.js.map +1 -0
  22. package/dist/chunk-HCIHOHLX.js +322 -0
  23. package/dist/chunk-HCIHOHLX.js.map +1 -0
  24. package/dist/chunk-HMJRPNPZ.js +1031 -0
  25. package/dist/chunk-HMJRPNPZ.js.map +1 -0
  26. package/dist/chunk-I5PZ4JTS.js +119 -0
  27. package/dist/chunk-I5PZ4JTS.js.map +1 -0
  28. package/dist/chunk-IYW62KKR.js +255 -0
  29. package/dist/chunk-IYW62KKR.js.map +1 -0
  30. package/dist/chunk-JAXXTYID.js +51 -0
  31. package/dist/chunk-JAXXTYID.js.map +1 -0
  32. package/dist/chunk-LSOYPSAT.js +183 -0
  33. package/dist/chunk-LSOYPSAT.js.map +1 -0
  34. package/dist/chunk-MFBHNWGV.js +416 -0
  35. package/dist/chunk-MFBHNWGV.js.map +1 -0
  36. package/dist/chunk-MXZSI3AY.js +311 -0
  37. package/dist/chunk-MXZSI3AY.js.map +1 -0
  38. package/dist/chunk-NBR3GHMT.js +72 -0
  39. package/dist/chunk-NBR3GHMT.js.map +1 -0
  40. package/dist/chunk-O3ZF22SW.js +246 -0
  41. package/dist/chunk-O3ZF22SW.js.map +1 -0
  42. package/dist/chunk-SUSJPZU2.js +181 -0
  43. package/dist/chunk-SUSJPZU2.js.map +1 -0
  44. package/dist/chunk-TEVZS4FA.js +310 -0
  45. package/dist/chunk-TEVZS4FA.js.map +1 -0
  46. package/dist/chunk-UY2SYSEZ.js +211 -0
  47. package/dist/chunk-UY2SYSEZ.js.map +1 -0
  48. package/dist/chunk-WAHVZH7V.js +260 -0
  49. package/dist/chunk-WAHVZH7V.js.map +1 -0
  50. package/dist/chunk-WPP3PEDE.js +234 -0
  51. package/dist/chunk-WPP3PEDE.js.map +1 -0
  52. package/dist/chunk-Y5XVD2CD.js +1610 -0
  53. package/dist/chunk-Y5XVD2CD.js.map +1 -0
  54. package/dist/chunk-YL5XFHR3.js +56 -0
  55. package/dist/chunk-YL5XFHR3.js.map +1 -0
  56. package/dist/chunk-ZGOHARPV.js +122 -0
  57. package/dist/chunk-ZGOHARPV.js.map +1 -0
  58. package/dist/claude-adapter-QMLFMSP3.js +6 -0
  59. package/dist/claude-adapter-QMLFMSP3.js.map +1 -0
  60. package/dist/claude-login-5WELXPKT.js +324 -0
  61. package/dist/claude-login-5WELXPKT.js.map +1 -0
  62. package/dist/cli.d.ts +1 -0
  63. package/dist/cli.js +703 -0
  64. package/dist/cli.js.map +1 -0
  65. package/dist/codex-login-7HHLJHBF.js +164 -0
  66. package/dist/codex-login-7HHLJHBF.js.map +1 -0
  67. package/dist/config-store-W6FBCQAQ.js +6 -0
  68. package/dist/config-store-W6FBCQAQ.js.map +1 -0
  69. package/dist/executor-6RIKIGXK.js +4 -0
  70. package/dist/executor-6RIKIGXK.js.map +1 -0
  71. package/dist/gemini-adapter-6JIHZ7WI.js +6 -0
  72. package/dist/gemini-adapter-6JIHZ7WI.js.map +1 -0
  73. package/dist/gemini-login-ZZLYC3J6.js +346 -0
  74. package/dist/gemini-login-ZZLYC3J6.js.map +1 -0
  75. package/dist/index.d.ts +2210 -0
  76. package/dist/index.js +1419 -0
  77. package/dist/index.js.map +1 -0
  78. package/dist/kimi-adapter-JN4HFFHU.js +6 -0
  79. package/dist/kimi-adapter-JN4HFFHU.js.map +1 -0
  80. package/dist/kimi-login-CZPS63NK.js +149 -0
  81. package/dist/kimi-login-CZPS63NK.js.map +1 -0
  82. package/dist/native-cli-adapters-OLW3XX57.js +6 -0
  83. package/dist/native-cli-adapters-OLW3XX57.js.map +1 -0
  84. package/dist/ollama-adapter-OJQ3FKWK.js +6 -0
  85. package/dist/ollama-adapter-OJQ3FKWK.js.map +1 -0
  86. package/dist/openai-adapter-XU46EN7B.js +6 -0
  87. package/dist/openai-adapter-XU46EN7B.js.map +1 -0
  88. package/dist/registry-4KD24ZC3.js +6 -0
  89. package/dist/registry-4KD24ZC3.js.map +1 -0
  90. package/dist/registry-H7B3AHPQ.js +5 -0
  91. package/dist/registry-H7B3AHPQ.js.map +1 -0
  92. package/dist/server-manager-PTGBHCLS.js +5 -0
  93. package/dist/server-manager-PTGBHCLS.js.map +1 -0
  94. package/dist/session-manager-ECEEACGY.js +12 -0
  95. package/dist/session-manager-ECEEACGY.js.map +1 -0
  96. package/dist/team-manager-HC4XGCFY.js +11 -0
  97. package/dist/team-manager-HC4XGCFY.js.map +1 -0
  98. package/dist/tmux-manager-GPYZ3WQH.js +6 -0
  99. package/dist/tmux-manager-GPYZ3WQH.js.map +1 -0
  100. package/dist/tools-TSMXMHIF.js +6 -0
  101. package/dist/tools-TSMXMHIF.js.map +1 -0
  102. package/package.json +89 -0
package/README.md ADDED
@@ -0,0 +1,607 @@
1
+ <p align="center">
2
+ <br />
3
+ <code>&nbsp;A E M E A T H&nbsp;</code>
4
+ <br />
5
+ <br />
6
+ <strong>Next-generation multi-model CLI coding tool</strong>
7
+ <br />
8
+ Agent teams &middot; Split-panel coordination &middot; Role-based routing
9
+ <br />
10
+ <br />
11
+ <a href="#installation"><img src="https://img.shields.io/badge/node-%3E%3D20-brightgreen?style=flat-square" alt="Node.js >= 20" /></a>
12
+ <a href="#license"><img src="https://img.shields.io/badge/license-MIT-blue?style=flat-square" alt="MIT License" /></a>
13
+ <a href="#supported-models"><img src="https://img.shields.io/badge/models-9-orange?style=flat-square" alt="9 Models" /></a>
14
+ <a href="#providers"><img src="https://img.shields.io/badge/providers-5-purple?style=flat-square" alt="5 Providers" /></a>
15
+ </p>
16
+
17
+ <br />
18
+
19
+ ```
20
+ ╔══════════════════════════════════════════════╗
21
+ ║ Welcome to AemeathCLI ║
22
+ ║ Multi-Model CLI Coding Tool v1.0.0 ║
23
+ ╚══════════════════════════════════════════════╝
24
+ ```
25
+
26
+ AemeathCLI orchestrates **multiple AI models** across **parallel agent teams** in your terminal. Route Claude for planning, GPT for coding, Gemini for reviews -- all in split-panel panes (iTerm2 native on macOS, tmux elsewhere) with real-time streaming, hub-and-spoke coordination, cost tracking, and enterprise-grade security.
27
+
28
+ <br />
29
+
30
+ ## Table of Contents
31
+
32
+ - [Why AemeathCLI](#why-aemeathcli)
33
+ - [Quick Start](#quick-start)
34
+ - [Installation](#installation)
35
+ - [Authentication](#authentication)
36
+ - [Usage](#usage)
37
+ - [Supported Models](#supported-models)
38
+ - [Role-Based Model Routing](#role-based-model-routing)
39
+ - [Agent Teams](#agent-teams)
40
+ - [Skills System](#skills-system)
41
+ - [MCP Integration](#mcp-integration)
42
+ - [Interactive Commands](#interactive-commands)
43
+ - [Configuration](#configuration)
44
+ - [Architecture](#architecture)
45
+ - [Security](#security)
46
+ - [Development](#development)
47
+ - [License](#license)
48
+
49
+ <br />
50
+
51
+ ## Why AemeathCLI
52
+
53
+ Most AI coding tools lock you into a single model. AemeathCLI breaks that ceiling:
54
+
55
+ - **Multi-model orchestration** -- Use the right model for each task. Claude Opus for architecture, GPT-5.2 for implementation, Gemini 2.5 Pro for code review -- in one session.
56
+ - **Agent teams** -- Describe what you need in plain English and the LLM designs the team. Agents spawn in iTerm2/tmux split panes with a hub-and-spoke coordination model -- a leader orchestrates, teammates execute, and results are synthesized through a shared board.
57
+ - **Smart routing** -- Define role-based routing rules. When you switch to "review" mode, the system automatically picks the best model for reviewing code.
58
+ - **Cost-aware** -- Real-time token counting, per-model cost tracking, configurable budget warnings and hard stops. Know exactly what you're spending.
59
+ - **Skills & MCP** -- Extend functionality with YAML-defined skills and Model Context Protocol servers. Your tools, your workflow.
60
+ - **Enterprise-grade** -- OS keychain storage, AES-256-GCM encryption, HMAC-SHA256 IPC auth, sandboxed execution, structured logging, typed error hierarchy.
61
+
62
+ <br />
63
+
64
+ ## Quick Start
65
+
66
+ ```bash
67
+ # Install globally
68
+ npm install -g aemeathcli
69
+
70
+ # Authenticate with your providers
71
+ aemeathcli auth login claude
72
+ aemeathcli auth login codex
73
+ aemeathcli auth login gemini
74
+
75
+ # Start coding
76
+ aemeathcli "Refactor the authentication module to use JWT tokens"
77
+ ```
78
+
79
+ That's it. AemeathCLI detects your project, picks the best model, and starts streaming.
80
+
81
+ <br />
82
+
83
+ ## Installation
84
+
85
+ ### Requirements
86
+
87
+ - **Node.js** >= 20.0.0
88
+ - **npm** >= 9 (or pnpm / yarn)
89
+ - **tmux** (optional, for split-panel mode)
90
+ - **iTerm2** (optional, macOS native pane support)
91
+
92
+ ### Install
93
+
94
+ ```bash
95
+ npm install -g aemeathcli
96
+ ```
97
+
98
+ The CLI installs two commands: `aemeathcli` and the shorthand `ac`.
99
+
100
+ ### Verify
101
+
102
+ ```bash
103
+ aemeathcli --version
104
+ # 1.0.0
105
+ ```
106
+
107
+ ### First Run
108
+
109
+ ```bash
110
+ aemeathcli config init
111
+ ```
112
+
113
+ This launches an interactive setup wizard that walks you through provider authentication and initial configuration.
114
+
115
+ <br />
116
+
117
+ ## Authentication
118
+
119
+ AemeathCLI supports four cloud providers with native OAuth PKCE login:
120
+
121
+ ```bash
122
+ # Browser-based OAuth login (recommended)
123
+ aemeathcli auth login claude # Anthropic
124
+ aemeathcli auth login codex # OpenAI
125
+ aemeathcli auth login gemini # Google
126
+ aemeathcli auth login kimi # Moonshot
127
+
128
+ # Or set API keys directly
129
+ aemeathcli auth set-key claude sk-ant-api03-...
130
+ aemeathcli auth set-key codex sk-...
131
+ aemeathcli auth set-key gemini AIza...
132
+
133
+ # Check status
134
+ aemeathcli auth status
135
+ ```
136
+
137
+ ```
138
+ claude ● Logged in (user@example.com) — Pro plan
139
+ codex ● Logged in (user@example.com) — Plus plan
140
+ gemini ● Logged in (user@gmail.com)
141
+ kimi ○ Not logged in
142
+ ```
143
+
144
+ Credentials are stored in your **OS keychain** (macOS Keychain, Windows Credential Vault, or Linux libsecret). An AES-256-GCM encrypted fallback is used when keychain is unavailable.
145
+
146
+ ```bash
147
+ # Manage sessions
148
+ aemeathcli auth logout codex # Single provider
149
+ aemeathcli auth logout --all # All providers
150
+ aemeathcli auth switch claude # Set default provider
151
+ ```
152
+
153
+ <br />
154
+
155
+ ## Usage
156
+
157
+ ### Interactive Chat
158
+
159
+ ```bash
160
+ # Start interactive session
161
+ aemeathcli
162
+
163
+ # Start with a message
164
+ aemeathcli "Explain the architecture of this project"
165
+
166
+ # Specify model and role
167
+ aemeathcli chat --model gpt-5.2 --role coding "Add input validation to the API"
168
+
169
+ # With a custom system prompt
170
+ aemeathcli chat --system "You are a security auditor" "Review this codebase"
171
+ ```
172
+
173
+ ### Task-Specific Modes
174
+
175
+ ```bash
176
+ # Planning mode — uses Claude Opus by default
177
+ aemeathcli plan "Design a caching layer for the API"
178
+
179
+ # Code review — analyzes specified files
180
+ aemeathcli review src/auth/ src/api/middleware.ts
181
+
182
+ # Test generation — uses Haiku/Flash for speed
183
+ aemeathcli test "Generate tests for the recent changes"
184
+ ```
185
+
186
+ ### Team Mode
187
+
188
+ Teams are created through **natural language** in the interactive chat -- no CLI subcommands needed:
189
+
190
+ ```bash
191
+ # Start interactive session
192
+ aemeathcli
193
+
194
+ # Then describe the team you need:
195
+ > Create a team to refactor the authentication module
196
+ > I need agents to review this PR from security, architecture, and code quality angles
197
+ > Spawn a team to build the new payment feature with planning, coding, and testing
198
+ ```
199
+
200
+ The LLM designs the optimal team (roles, models, agent count) and spawns each agent in its own split pane. On macOS with iTerm2, panes are native terminal splits. On Linux or inside tmux, panes use tmux splits. Stop a team with `/team stop`.
201
+
202
+ ```
203
+ ┌───────────────────────┬───────────────────────┐
204
+ │ LeadArchitect │ BackendDev │
205
+ │ (Claude Opus 4.6) │ (Claude Sonnet 4.6) │
206
+ │ Role: planning │ Role: coding │
207
+ │ ├───────────────────────┤
208
+ │ Coordinates team, │ SecurityAuditor │
209
+ │ synthesizes results │ (GPT-5.2 Codex) │
210
+ │ │ Role: review │
211
+ └───────────────────────┴───────────────────────┘
212
+ ```
213
+
214
+ <br />
215
+
216
+ ## Supported Models
217
+
218
+ AemeathCLI ships with 9 models across 5 providers:
219
+
220
+ | Model | Provider | Context | Output | Input $/M | Output $/M |
221
+ |:------|:---------|--------:|-------:|----------:|-----------:|
222
+ | **claude-opus-4-6** | Anthropic | 200K | 32K | $15.00 | $75.00 |
223
+ | **claude-sonnet-4-6** | Anthropic | 200K | 16K | $3.00 | $15.00 |
224
+ | **claude-haiku-4-5** | Anthropic | 200K | 8K | $0.80 | $4.00 |
225
+ | **gpt-5.2** | OpenAI | 256K | 32K | $2.50 | $10.00 |
226
+ | **gpt-5.2-mini** | OpenAI | 256K | 16K | $0.15 | $0.60 |
227
+ | **o3** | OpenAI | 256K | 100K | $10.00 | $40.00 |
228
+ | **gemini-2.5-pro** | Google | 2M | 64K | $1.25 | $10.00 |
229
+ | **gemini-2.5-flash** | Google | 2M | 64K | $0.15 | $0.60 |
230
+ | **kimi-k2.5** | Moonshot | 128K | 8K | $0.50 | $2.00 |
231
+
232
+ Local models via **Ollama** (Llama, Mistral, etc.) are also supported with a configurable base URL.
233
+
234
+ <br />
235
+
236
+ ## Role-Based Model Routing
237
+
238
+ AemeathCLI automatically selects the best model for each task through a 4-step resolution pipeline:
239
+
240
+ ```
241
+ User Override → Role Config → Fallback Chain → System Default
242
+ ```
243
+
244
+ ### Default Role Assignments
245
+
246
+ | Role | Primary Model | Fallback Chain |
247
+ |:-----|:--------------|:---------------|
248
+ | **Planning** | Claude Opus 4.6 | GPT-5.2 &rarr; Gemini 2.5 Pro |
249
+ | **Coding** | Claude Sonnet 4.6 | GPT-5.2 &rarr; Gemini 2.5 Flash |
250
+ | **Review** | Claude Opus 4.6 | Gemini 2.5 Pro |
251
+ | **Testing** | Claude Haiku 4.5 | Gemini 2.5 Flash |
252
+ | **Bugfix** | Claude Sonnet 4.6 | GPT-5.2 |
253
+ | **Documentation** | Gemini 2.5 Flash | Claude Haiku 4.5 |
254
+
255
+ Override at any time:
256
+
257
+ ```bash
258
+ # Session-level override
259
+ aemeathcli chat --model gpt-5.2 --role planning
260
+
261
+ # Or interactively
262
+ /model gemini-2.5-pro
263
+ /role review
264
+ ```
265
+
266
+ Customize routing in `~/.aemeathcli/config.json`:
267
+
268
+ ```json
269
+ {
270
+ "roles": {
271
+ "coding": {
272
+ "primary": "gpt-5.2",
273
+ "fallback": ["claude-sonnet-4-6", "gemini-2.5-flash"]
274
+ }
275
+ }
276
+ }
277
+ ```
278
+
279
+ <br />
280
+
281
+ ## Agent Teams
282
+
283
+ Create parallel agent teams through natural language. The LLM designs the team, split panes launch automatically, and agents coordinate via a hub-and-spoke model.
284
+
285
+ ### How It Works
286
+
287
+ 1. **Natural language creation** -- Describe the team you need ("Create a team to review the codebase"). No CLI subcommands or JSON config needed.
288
+ 2. **LLM-driven design** -- The active model decides the optimal team: agent count, names, roles, models, and task prompts -- all tailored to your request.
289
+ 3. **Split-panel mode** -- Each agent gets its own terminal pane (iTerm2 native splits on macOS, tmux splits on Linux/inside tmux).
290
+ 4. **Hub-and-spoke coordination** -- A lead agent orchestrates the effort. All agents share a board directory where they write outputs, read each other's work, and the lead synthesizes a final summary.
291
+ 5. **Cross-model teams** -- The LLM assigns different providers per agent: Claude Opus for planning, GPT Codex for coding, Gemini Pro for research -- all in one team.
292
+
293
+ ### Split-Panel Backends
294
+
295
+ | Environment | Backend | How |
296
+ |:------------|:--------|:----|
297
+ | **macOS + iTerm2** | Native iTerm2 panes | AppleScript creates vertical/horizontal splits directly in your iTerm2 window |
298
+ | **Inside tmux** | tmux splits | Auto-splits the current tmux window for each agent |
299
+ | **Outside tmux (Linux)** | tmux session | Creates a new tmux session and attaches |
300
+ | **No pane manager** | Single-pane fallback | Tab-based agent switching within the TUI |
301
+
302
+ ### Hub-and-Spoke Coordination
303
+
304
+ Following the patterns established by Claude Code Agent Teams and OpenAI Codex Multi-Agent:
305
+
306
+ ```
307
+ ┌─────────────────────┐
308
+ │ Shared Board │
309
+ │ /tmp/aemeathcli-*/ │
310
+ │ board/ │
311
+ └──┬──────┬──────┬───┘
312
+ │ │ │
313
+ ┌──────┘ │ └──────┐
314
+ │ │ │
315
+ ┌─────┴─────┐ ┌────┴────┐ ┌──────┴─────┐
316
+ │ Lead │ │ Agent 2 │ │ Agent 3 │
317
+ │ Writes: │ │ Writes: │ │ Writes: │
318
+ │ coord.md │ │ own .md │ │ own .md │
319
+ │ SUMMARY.md│ │ │ │ │
320
+ └───────────┘ └─────────┘ └────────────┘
321
+ ```
322
+
323
+ - **Team manifest** (`team-manifest.json`) -- Full team structure visible to every agent: names, roles, models, output file paths
324
+ - **Lead agent writes** `coordinator.md` with the task breakdown and assignments, then reads all agent outputs to produce `SUMMARY.md`
325
+ - **Non-lead agents** check the coordinator plan, do their bounded work, and write results to their output file
326
+ - **File-based protocol** -- No complex IPC needed for coordination. Agents read/write markdown files in the shared board directory.
327
+
328
+ ### Cross-Model Teams
329
+
330
+ Each agent runs a different model selected by the LLM based on role suitability:
331
+
332
+ ```json
333
+ [
334
+ { "name": "AuthArchitect", "model": "claude-opus-4-6", "role": "planning" },
335
+ { "name": "BackendDev", "model": "claude-sonnet-4-6", "role": "coding" },
336
+ { "name": "SecurityReviewer", "model": "gpt-5.2-codex", "role": "review" },
337
+ { "name": "TestWriter", "model": "gemini-2.5-flash", "role": "testing" }
338
+ ]
339
+ ```
340
+
341
+ ### Team Controls
342
+
343
+ | Action | How |
344
+ |:-------|:----|
345
+ | Create team | Natural language in chat: "Create a team to build X" |
346
+ | View agents | Each agent has its own pane -- click or switch panes |
347
+ | Stop team | `/team stop` in the leader pane |
348
+
349
+ <br />
350
+
351
+ ## Skills System
352
+
353
+ Extend AemeathCLI with reusable, model-agnostic skill files.
354
+
355
+ ### Built-in Skills
356
+
357
+ | Skill | Trigger | Description |
358
+ |:------|:--------|:------------|
359
+ | Code Review | `$review` | Structured code review with severity ratings |
360
+ | Commit | `$commit` | Conventional commit message generation |
361
+ | Plan | `$plan` | Architecture and implementation planning |
362
+ | Debug | `$debug` | Systematic debugging with hypothesis testing |
363
+ | Test | `$test` | Test generation with coverage analysis |
364
+ | Refactor | `$refactor` | Safe refactoring with before/after validation |
365
+
366
+ ### Custom Skills
367
+
368
+ Create a `SKILL.md` file with YAML frontmatter:
369
+
370
+ ```markdown
371
+ ---
372
+ name: my-skill
373
+ description: Custom skill for my workflow
374
+ version: 1.0.0
375
+ triggers:
376
+ - $my-skill
377
+ - my-skill
378
+ allowed-tools:
379
+ - read
380
+ - write
381
+ - bash
382
+ model-requirements:
383
+ preferred-role: coding
384
+ min-context: 100000
385
+ ---
386
+
387
+ # My Custom Skill
388
+
389
+ Instructions for the AI when this skill is active...
390
+ ```
391
+
392
+ **Skill resolution priority:** Project (`.aemeathcli/skills/`) > User (`~/.aemeathcli/skills/`) > Built-in
393
+
394
+ <br />
395
+
396
+ ## MCP Integration
397
+
398
+ Connect external tools via the [Model Context Protocol](https://modelcontextprotocol.io):
399
+
400
+ ```json
401
+ // ~/.aemeathcli/mcp.json
402
+ {
403
+ "mcpServers": {
404
+ "filesystem": {
405
+ "command": "npx",
406
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "./"],
407
+ "env": {}
408
+ },
409
+ "postgres": {
410
+ "command": "npx",
411
+ "args": ["-y", "@modelcontextprotocol/server-postgres"],
412
+ "env": {
413
+ "DATABASE_URL": "${DATABASE_URL}"
414
+ }
415
+ }
416
+ }
417
+ }
418
+ ```
419
+
420
+ Features:
421
+
422
+ - **stdio + Streamable HTTP** transport
423
+ - **Automatic tool discovery** -- MCP tools appear alongside built-in tools
424
+ - **Namespaced** -- `mcp__serverName__toolName` prevents conflicts
425
+ - **Rate-limited** -- Configurable per-server call limits
426
+ - **Health-checked** -- Auto-restart on consecutive failures
427
+ - **Hot-reload** -- File watching with live config updates
428
+
429
+ <br />
430
+
431
+ ## Interactive Commands
432
+
433
+ During a chat session:
434
+
435
+ | Command | Description |
436
+ |:--------|:------------|
437
+ | `/help` | Show available commands |
438
+ | `/model [name]` | Switch model or show current |
439
+ | `/model list` | List all available models |
440
+ | `/role [name]` | Switch role (planning, coding, review, testing, bugfix) |
441
+ | `/cost` | Show session cost breakdown |
442
+ | `/clear` | Clear conversation history |
443
+ | `/compact` | Compress context to free token budget |
444
+ | `/quit` | Exit the session |
445
+
446
+ <br />
447
+
448
+ ## Configuration
449
+
450
+ ### File Locations
451
+
452
+ ```
453
+ ~/.aemeathcli/
454
+ config.json # Global configuration
455
+ credentials.enc # Encrypted credential fallback
456
+ mcp.json # MCP server definitions
457
+ skills/ # User-level custom skills
458
+ teams/ # Team configurations
459
+ tasks/ # Task persistence
460
+ db/aemeathcli.db # SQLite database (WAL mode)
461
+ logs/ # Structured logs (pino)
462
+
463
+ .aemeathcli/ # Project-level overrides
464
+ config.json # Project configuration (merges over global)
465
+ skills/ # Project-specific skills
466
+ mcp.json # Project-specific MCP servers
467
+ AGENTS.md # Agent instructions
468
+ ```
469
+
470
+ ### Key Settings
471
+
472
+ ```json
473
+ {
474
+ "defaultModel": "claude-sonnet-4-6",
475
+ "permissions": {
476
+ "mode": "standard",
477
+ "allowedPaths": ["./"],
478
+ "blockedCommands": ["rm -rf /", "git push --force"]
479
+ },
480
+ "splitPanel": {
481
+ "enabled": true,
482
+ "backend": "auto",
483
+ "defaultLayout": "auto",
484
+ "maxPanes": 6
485
+ },
486
+ "cost": {
487
+ "budgetWarning": 5.00,
488
+ "budgetHardStop": 20.00,
489
+ "currency": "USD"
490
+ }
491
+ }
492
+ ```
493
+
494
+ ### Permission Modes
495
+
496
+ | Mode | Behavior |
497
+ |:-----|:---------|
498
+ | **strict** | All operations require explicit approval |
499
+ | **standard** | Reads auto-approved; writes and shell require approval |
500
+ | **permissive** | All operations auto-approved (trusted environments only) |
501
+
502
+ ```bash
503
+ aemeathcli --permission-mode strict "Delete all unused imports"
504
+ ```
505
+
506
+ <br />
507
+
508
+ ## Architecture
509
+
510
+ ```
511
+ aemeathcli/
512
+ src/
513
+ cli/ Command-line interface (Commander.js)
514
+ ui/ Terminal UI components (Ink 5 / React)
515
+ core/ Model router, event bus, context manager, cost tracker
516
+ providers/ AI provider adapters (Vercel AI SDK)
517
+ tools/ Built-in tools (bash, read, write, edit, glob, grep, git, web-fetch)
518
+ auth/ OAuth PKCE login, credential store, session management
519
+ teams/ Agent process management, message bus, task store
520
+ panes/ tmux/iTerm2 integration, IPC hub, layout engine
521
+ skills/ Skill loader, registry, executor
522
+ mcp/ MCP client, server manager, tool bridge
523
+ storage/ SQLite store, config store, conversation persistence
524
+ types/ TypeScript type definitions, error hierarchy
525
+ utils/ Logger, sanitizer, path resolver, retry, token counter
526
+ ```
527
+
528
+ **99 source files** &middot; **~14,000 lines of TypeScript** &middot; **Zero `any` types** &middot; **Strict mode + all strict flags**
529
+
530
+ ### Technology Stack
531
+
532
+ | Layer | Technology |
533
+ |:------|:-----------|
534
+ | Runtime | Node.js 20+ |
535
+ | Language | TypeScript 5.7+ (maximum strict mode) |
536
+ | CLI Framework | Commander.js 13 |
537
+ | Terminal UI | Ink 5 (React 18 for CLI) |
538
+ | AI Integration | Vercel AI SDK + provider adapters |
539
+ | Database | better-sqlite3 (WAL mode) |
540
+ | Validation | Zod |
541
+ | Logging | pino (structured, redacted) |
542
+ | Auth | keytar (OS keychain) + AES-256-GCM fallback |
543
+ | Build | tsup (ESM-only, sourcemaps, DTS) |
544
+ | Testing | Vitest |
545
+ | Linting | ESLint v9 + typescript-eslint (strict type-checked) |
546
+
547
+ <br />
548
+
549
+ ## Security
550
+
551
+ AemeathCLI is built with defense-in-depth:
552
+
553
+ - **Credential storage** -- OS keychain primary (macOS Keychain, Windows Credential Vault, Linux libsecret). AES-256-GCM encrypted file fallback with scrypt key derivation (N=32768, r=8, p=1) and per-file random salt.
554
+ - **IPC authentication** -- HMAC-SHA256 message signing for all inter-agent communication over Unix domain sockets. Socket permissions set to `0o700`.
555
+ - **Shell sandboxing** -- Dangerous command blocklist, sensitive environment variable filtering, configurable permission modes with per-operation approval.
556
+ - **Path traversal protection** -- All file operations validate resolved paths against the project root boundary.
557
+ - **SSRF protection** -- Web fetch blocks private IP ranges (RFC 1918, loopback, link-local, cloud metadata).
558
+ - **Secret redaction** -- pino structured logging with 15+ credential field paths redacted. Regex-based secret scrubbing for API keys in command output.
559
+ - **File permissions** -- All sensitive files written with `0o600`, directories with `0o700`.
560
+ - **Typed error hierarchy** -- 14 error classes with codes, user messages, diagnostic details, and recovery suggestions. No untyped `catch(e)` anywhere.
561
+
562
+ <br />
563
+
564
+ ## Development
565
+
566
+ ### Setup
567
+
568
+ ```bash
569
+ git clone https://github.com/AemeathCLI/AemeathCLI.git
570
+ cd AemeathCLI
571
+ npm install
572
+ ```
573
+
574
+ ### Scripts
575
+
576
+ ```bash
577
+ npm run build # Build with tsup
578
+ npm run dev # Watch mode
579
+ npm run typecheck # tsc --noEmit
580
+ npm run lint # ESLint (strict type-checked)
581
+ npm run format # Prettier
582
+ npm run test # Vitest
583
+ npm run test:coverage # With coverage report
584
+ ```
585
+
586
+ ### Project Conventions
587
+
588
+ - **Interfaces** use `I` prefix: `IModelInfo`, `IChatMessage`, `IToolResult`
589
+ - **Error classes** extend `AemeathError` with structured error codes
590
+ - **Type imports** use `import type { ... }` consistently
591
+ - **No `any`** -- enforced by ESLint `no-explicit-any` + `no-unsafe-*` rules
592
+ - **All `catch` blocks** use `catch (error: unknown)` or bare `catch {}`
593
+ - **Barrel exports** via `index.ts` in each module
594
+
595
+ <br />
596
+
597
+ ## License
598
+
599
+ MIT
600
+
601
+ <br />
602
+
603
+ ---
604
+
605
+ <p align="center">
606
+ Built with Claude, GPT, and Gemini — orchestrated by AemeathCLI itself.
607
+ </p>