iosm-cli 0.1.0 → 0.1.1

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 (74) hide show
  1. package/CHANGELOG.md +3 -1
  2. package/README.md +218 -547
  3. package/dist/cli/args.d.ts.map +1 -1
  4. package/dist/cli/args.js +11 -3
  5. package/dist/cli/args.js.map +1 -1
  6. package/dist/core/agent-profiles.d.ts.map +1 -1
  7. package/dist/core/agent-profiles.js +20 -5
  8. package/dist/core/agent-profiles.js.map +1 -1
  9. package/dist/core/sdk.d.ts +2 -2
  10. package/dist/core/sdk.d.ts.map +1 -1
  11. package/dist/core/sdk.js +3 -3
  12. package/dist/core/sdk.js.map +1 -1
  13. package/dist/core/slash-commands.d.ts.map +1 -1
  14. package/dist/core/slash-commands.js +4 -1
  15. package/dist/core/slash-commands.js.map +1 -1
  16. package/dist/core/system-prompt.d.ts.map +1 -1
  17. package/dist/core/system-prompt.js +34 -3
  18. package/dist/core/system-prompt.js.map +1 -1
  19. package/dist/core/tools/ast-grep.d.ts +12 -0
  20. package/dist/core/tools/ast-grep.d.ts.map +1 -0
  21. package/dist/core/tools/ast-grep.js +12 -0
  22. package/dist/core/tools/ast-grep.js.map +1 -0
  23. package/dist/core/tools/comby.d.ts +12 -0
  24. package/dist/core/tools/comby.d.ts.map +1 -0
  25. package/dist/core/tools/comby.js +14 -0
  26. package/dist/core/tools/comby.js.map +1 -0
  27. package/dist/core/tools/external-cli.d.ts +33 -0
  28. package/dist/core/tools/external-cli.d.ts.map +1 -0
  29. package/dist/core/tools/external-cli.js +201 -0
  30. package/dist/core/tools/external-cli.js.map +1 -0
  31. package/dist/core/tools/fd.d.ts +12 -0
  32. package/dist/core/tools/fd.d.ts.map +1 -0
  33. package/dist/core/tools/fd.js +15 -0
  34. package/dist/core/tools/fd.js.map +1 -0
  35. package/dist/core/tools/index.d.ts +57 -0
  36. package/dist/core/tools/index.d.ts.map +1 -1
  37. package/dist/core/tools/index.js +61 -2
  38. package/dist/core/tools/index.js.map +1 -1
  39. package/dist/core/tools/jq.d.ts +12 -0
  40. package/dist/core/tools/jq.d.ts.map +1 -0
  41. package/dist/core/tools/jq.js +12 -0
  42. package/dist/core/tools/jq.js.map +1 -0
  43. package/dist/core/tools/rg.d.ts +12 -0
  44. package/dist/core/tools/rg.d.ts.map +1 -0
  45. package/dist/core/tools/rg.js +15 -0
  46. package/dist/core/tools/rg.js.map +1 -0
  47. package/dist/core/tools/sed.d.ts +12 -0
  48. package/dist/core/tools/sed.d.ts.map +1 -0
  49. package/dist/core/tools/sed.js +14 -0
  50. package/dist/core/tools/sed.js.map +1 -0
  51. package/dist/core/tools/semgrep.d.ts +12 -0
  52. package/dist/core/tools/semgrep.d.ts.map +1 -0
  53. package/dist/core/tools/semgrep.js +13 -0
  54. package/dist/core/tools/semgrep.js.map +1 -0
  55. package/dist/core/tools/yq.d.ts +12 -0
  56. package/dist/core/tools/yq.d.ts.map +1 -0
  57. package/dist/core/tools/yq.js +12 -0
  58. package/dist/core/tools/yq.js.map +1 -0
  59. package/dist/index.d.ts +2 -2
  60. package/dist/index.d.ts.map +1 -1
  61. package/dist/index.js +2 -2
  62. package/dist/index.js.map +1 -1
  63. package/dist/modes/interactive/interactive-mode.d.ts.map +1 -1
  64. package/dist/modes/interactive/interactive-mode.js +136 -3
  65. package/dist/modes/interactive/interactive-mode.js.map +1 -1
  66. package/docs/assets/preview.jpg +0 -0
  67. package/docs/cli-reference.md +12 -4
  68. package/docs/configuration.md +4 -4
  69. package/docs/development-and-testing.md +1 -1
  70. package/docs/extensions-packages-themes.md +1 -1
  71. package/docs/getting-started.md +3 -3
  72. package/docs/interactive-mode.md +1 -1
  73. package/docs/rpc-json-sdk.md +1 -1
  74. package/package.json +6 -2
package/README.md CHANGED
@@ -1,650 +1,321 @@
1
+ <h1 align="center">IOSM CLI v0.1.1</h1>
2
+
3
+ <p align="center">
4
+ <strong>AI Engineering Runtime for Professional Developers</strong>
5
+ </p>
1
6
  <p align="center">
2
- <h1 align="center">iosm-cli</h1>
3
- <p align="center">
4
- <strong>AI-Powered Engineering Agent with IOSM Methodology</strong>
5
- </p>
6
- <p align="center">
7
- Interactive terminal agent · Multi-provider LLM support · Built-in tools · IOSM cycles · Subagent orchestration · Extensions
8
- </p>
7
+ Interactive coding agent · IOSM methodology · MCP · Checkpoints · Subagent orchestration · Extensions
9
8
  </p>
10
9
 
11
10
  <p align="center">
12
11
  <a href="https://www.npmjs.com/package/iosm-cli"><img alt="npm version" src="https://img.shields.io/npm/v/iosm-cli?style=flat-square&color=cb3837"></a>
12
+ <a href="https://www.npmjs.com/package/iosm-cli"><img alt="npm downloads" src="https://img.shields.io/npm/dm/iosm-cli?style=flat-square"></a>
13
13
  <a href="https://opensource.org/licenses/MIT"><img alt="License: MIT" src="https://img.shields.io/badge/license-MIT-blue?style=flat-square"></a>
14
14
  <img alt="Node.js" src="https://img.shields.io/badge/node-%3E%3D20.6.0-brightgreen?style=flat-square&logo=node.js">
15
- <img alt="TypeScript" src="https://img.shields.io/badge/TypeScript-5.9-blue?style=flat-square&logo=typescript">
15
+ <a href="https://github.com/rokoss21/iosm-cli"><img alt="GitHub" src="https://img.shields.io/badge/github-rokoss21%2Fiosm--cli-black?style=flat-square&logo=github"></a>
16
16
  </p>
17
17
 
18
- ---
19
-
20
- `iosm-cli` is a standalone TypeScript CLI that combines an LLM-powered coding agent with the **IOSM** (Improve → Optimize → Shrink → Modularize) methodology for systematic engineering excellence. It provides a rich interactive terminal, built-in file/code tools, multi-provider model support, session management, subagent orchestration, and a full extension system.
21
-
22
- ## ✨ Feature Highlights
23
-
24
- | Feature | Description |
25
- |---------|-------------|
26
- | **Interactive Agent** | Multi-turn terminal sessions with persistent history, branching, and tree navigation |
27
- | **15+ LLM Providers** | Anthropic, OpenAI, Google Gemini, Groq, Cerebras, xAI, OpenRouter, Mistral, AWS Bedrock, Azure OpenAI, and more |
28
- | **7 Built-in Tools** | `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls` — full filesystem and shell integration |
29
- | **IOSM Methodology** | Algorithmic improvement cycles with quality gates, metrics, hypothesis cards, and IOSM-Index scoring |
30
- | **Subagent Orchestration** | Parallel/sequential task delegation with isolation, locks, and worktree support |
31
- | **Extension System** | Custom tools, commands, hooks, UI components, themes, and provider integrations |
32
- | **Skills & Prompts** | Markdown-based workflow modules and reusable prompt templates |
33
- | **Session Management** | Persistence, branching, forking, HTML export, and sharing via GitHub Gists |
34
- | **Multi-Mode Output** | Interactive, print (`-p`), JSON stream, and JSON-RPC for IDE integrations |
35
- | **Package Manager** | Install extensions/skills/themes from npm, git, or local paths |
36
- | **Programmatic SDK** | Full API via `createAgentSession()` for embedding in custom applications |
37
- | **Configurable Profiles** | `full`, `plan`, `iosm` + advanced profiles for specialized workflows |
18
+ <p align="center">
19
+ <img src="./docs/assets/preview.jpg" alt="IOSM CLI terminal preview">
20
+ </p>
38
21
 
39
22
  ---
40
23
 
41
- ## 📦 Installation
24
+ **IOSM CLI** (`iosm-cli`) is not a chat wrapper around an LLM.
42
25
 
43
- ### Global Install (recommended)
26
+ It is a runtime for production codebases:
27
+ - a terminal-native coding agent with direct filesystem and shell tooling
28
+ - primary operating profiles: **full** (default) and **iosm** (advanced, methodology-driven engineering cycles)
29
+ - smart orchestration for complex tasks: parallel/sequential agents, dependency ordering, lock coordination, and worktree isolation
30
+ - repeatable codebase improvement workflows via **IOSM** (Improve -> Optimize -> Shrink -> Modularize)
31
+ - auditable artifact history for cycles, decisions, and metric evolution across runs
32
+ - operational controls for safe iteration (`/checkpoint`, `/rollback`, `/doctor`, `/memory`)
33
+ - extensibility for teams (MCP + extensions) and embedding (SDK + JSON/RPC modes)
44
34
 
45
- ```bash
46
- npm install -g iosm-cli
47
- iosm --version
48
- ```
35
+ Adoption path is layered: start in **full** profile for low-friction daily usage, then switch to **iosm** profile when you need advanced IOSM cycles, metrics, and governance.
49
36
 
50
- ### Run Without Installing
37
+ ## Why It Exists
51
38
 
52
- ```bash
53
- npx iosm-cli --version
54
- ```
39
+ Most AI CLIs optimize for conversation.
40
+ **IOSM CLI** optimizes for engineering execution quality.
55
41
 
56
- ### Build from Source
42
+ | Area | Typical AI CLI | IOSM CLI |
43
+ |------|----------------|------------|
44
+ | Workflow | Prompt-by-prompt | Structured session + IOSM cycles |
45
+ | Safety | Basic confirmations | Checkpoints, rollback, diagnostics, permission policies |
46
+ | Context ops | Ad hoc notes | Managed memory with interactive edit/remove |
47
+ | Tooling | Built-ins only | Built-ins + MCP + extension tools |
48
+ | Integrations | Mostly interactive only | Interactive + print + JSON + JSON-RPC + SDK |
57
49
 
58
- ```bash
59
- git clone https://github.com/rokoss21/iosm-cli.git
60
- cd iosm-cli
61
- npm install
62
- npm run build
63
- npm link
64
- ```
50
+ ## Compared to Other Tools
65
51
 
66
- ### Requirements
52
+ This is not a “better/worse” claim. It is a positioning map so teams can choose the right tool for the job.
67
53
 
68
- - **Node.js** `>=20.6.0`
69
- - **npm** (bundled with Node.js)
70
- - At least one LLM provider API key (see [Providers](#-supported-providers))
54
+ | Tool | Typical Strength | Typical Mode | IOSM CLI Difference |
55
+ |------|------------------|--------------|------------------------|
56
+ | **Claude Code** | Strong conversational coding flow | Terminal conversation | Adds structured IOSM cycles + explicit checkpoint/rollback/doctor workflow |
57
+ | **OpenCode** | Lightweight open-source coding assistant | Terminal-first iteration | Emphasizes repeatable engineering process and quality-gated cycles |
58
+ | **Cursor** | Excellent IDE-native editing and inline assistance | IDE-first | Keeps workflow in terminal with agent tooling, MCP, and scriptable runtime modes |
59
+ | **Gemini CLI** | Fast Gemini-centric command-line assistance | CLI prompts and tasks | Provider-agnostic runtime + IOSM methodology + deeper operational controls |
60
+ | **IOSM CLI** | Structured engineering execution | Terminal runtime + methodology | Designed for reproducible refactors, diagnostics, memory, and cycle artifacts |
71
61
 
72
- ---
62
+ ## Who It Is For
73
63
 
74
- ## 🚀 Quick Start
64
+ - developers at any level: start in **full** profile and be productive quickly
65
+ - advanced engineers and tech leads using **iosm** mode for high-risk refactors and system-level change
66
+ - teams that need auditability, rollback, and repeatable improvement history
67
+ - platform/backend teams that operationalize AI coding into reliable workflows
68
+ - teams building internal coding automation on top of a CLI runtime
75
69
 
76
- ### 1. Set Up a Provider
70
+ ## Install
77
71
 
78
72
  ```bash
79
- export ANTHROPIC_API_KEY="sk-ant-..."
80
- # or
81
- export OPENAI_API_KEY="sk-..."
82
- # or
83
- export GEMINI_API_KEY="..."
73
+ npm install -g iosm-cli
74
+ iosm --version
84
75
  ```
85
76
 
86
- ### 2. Start Interactive Mode
77
+ Requirements:
78
+ - Node.js `>=20.6.0`
79
+ - provider auth (environment variable API key and/or `/login`)
87
80
 
88
- ```bash
89
- iosm
90
- ```
81
+ ### Recommended CLI Toolchain (for maximum efficiency)
91
82
 
92
- You'll enter a multi-turn terminal session where you can converse with the AI agent and leverage all built-in tools.
83
+ `iosm-cli` ships managed fallback for `rg` and `fd`, but best performance comes from system-installed tooling, especially for large repos.
93
84
 
94
- ### 3. One-Shot Prompt
85
+ Tools used by advanced search/analysis workflows:
86
+ - `rg`, `fd`, `ast-grep` (`sg`), `comby`, `jq`, `yq`, `semgrep`, `sed`
95
87
 
88
+ macOS (Homebrew):
96
89
  ```bash
97
- # Run a single prompt and exit
98
- iosm -p "Review src/ and list the top 5 refactoring opportunities"
99
-
100
- # Read-only mode (no writes)
101
- iosm --tools read,grep,find,ls -p "Audit src/ for dead code"
90
+ brew install ripgrep fd ast-grep comby jq yq semgrep
102
91
  ```
103
92
 
104
- ### 4. Initialize IOSM Workspace
105
-
93
+ Ubuntu/Debian:
106
94
  ```bash
107
- # Bootstrap IOSM artifacts for your project
108
- iosm init
109
-
110
- # Plan an improvement cycle
111
- iosm cycle plan "reduce API latency" "simplify auth module"
112
-
113
- # Check cycle progress
114
- iosm cycle status
95
+ sudo apt-get update
96
+ sudo apt-get install -y ripgrep fd-find jq yq sed
115
97
 
116
- # View cycle report
117
- iosm cycle report
98
+ # optional but recommended:
99
+ # semgrep: pipx install semgrep
100
+ # ast-grep: npm i -g @ast-grep/cli
101
+ # comby: see https://comby.dev/docs/installation
118
102
  ```
119
103
 
120
- ---
121
-
122
- ## 🛠 Built-in Tools
123
-
124
- The agent has access to 7 built-in tools for direct filesystem and shell interaction:
125
-
126
- | Tool | Description | Key Capabilities |
127
- |------|-------------|-----------------|
128
- | `read` | Read file contents | Line-range selection, image support, streaming for large files |
129
- | `bash` | Execute shell commands | Full shell access with configurable permissions and timeouts |
130
- | `edit` | Edit existing files | Diff-based editing with before/after verification |
131
- | `write` | Create/overwrite files | New file creation, directory auto-creation |
132
- | `grep` | Search file contents | Regex/literal search, include/exclude patterns, context lines |
133
- | `find` | Find files by name/pattern | Glob patterns, type filters, depth limits |
134
- | `ls` | List directory contents | Recursive listing, size/date info, ignore patterns |
135
-
136
- ### Tool Control
137
-
104
+ Check availability quickly:
138
105
  ```bash
139
- # Use all tools (default)
140
106
  iosm
141
-
142
- # Read-only tools
143
- iosm --tools read,grep,find,ls
144
-
145
- # Disable all tools
146
- iosm --no-tools
147
-
148
- # Specific tool selection
149
- iosm --tools read,bash,grep
150
- ```
151
-
152
- ---
153
-
154
- ## 🤖 Supported Providers
155
-
156
- | Provider | Environment Variable | Example Model |
157
- |----------|---------------------|---------------|
158
- | Anthropic | `ANTHROPIC_API_KEY` | `claude-sonnet-4-20250514` |
159
- | OpenAI | `OPENAI_API_KEY` | `gpt-4o` |
160
- | Google Gemini | `GEMINI_API_KEY` | `gemini-2.5-pro` |
161
- | Groq | `GROQ_API_KEY` | `llama-3.3-70b` |
162
- | Cerebras | `CEREBRAS_API_KEY` | `llama-3.3-70b` |
163
- | xAI | `XAI_API_KEY` | `grok-3` |
164
- | OpenRouter | `OPENROUTER_API_KEY` | `anthropic/claude-sonnet-4` |
165
- | Mistral | `MISTRAL_API_KEY` | `mistral-large` |
166
- | AWS Bedrock | `AWS_ACCESS_KEY_ID` | `anthropic.claude-v2` |
167
- | Azure OpenAI | `AZURE_OPENAI_API_KEY` | `gpt-4o` |
168
- | MiniMax | `MINIMAX_API_KEY` | — |
169
- | Kimi | `KIMI_API_KEY` | — |
170
- | AI Gateway | `AI_GATEWAY_API_KEY` | — |
171
-
172
- ### Model Selection
173
-
174
- ```bash
175
- # Full provider/model specification
176
- iosm --provider openai --model gpt-4o
177
-
178
- # Shorthand with provider prefix
179
- iosm --model openai/gpt-4o
180
-
181
- # Model with thinking level
182
- iosm --model sonnet:high
183
-
184
- # Cycle through models during session
185
- iosm --models "sonnet,gpt-4o,gemini-2.5-pro"
186
-
187
- # List available models
188
- iosm --list-models
189
- iosm --list-models gemini
107
+ /doctor
190
108
  ```
191
109
 
192
- ---
193
-
194
- ## 💬 Interactive Mode
195
-
196
- Interactive mode is the default experience — a rich multi-turn terminal session:
110
+ ## 60-Second Start
197
111
 
198
112
  ```bash
113
+ # 1) Open project and start CLI
114
+ cd /path/to/repo
199
115
  iosm
200
116
  ```
201
117
 
202
- ### Slash Commands
203
-
204
- | Category | Commands |
205
- |----------|----------|
206
- | **Session** | `/new` `/resume` `/fork` `/tree` `/checkpoint` `/rollback` `/name` `/session` `/quit` |
207
- | **Model** | `/model` `/scoped-models` `/settings` `/hotkeys` `/changelog` |
208
- | **MCP** | `/mcp` |
209
- | **Context** | `/memory` |
210
- | **IOSM** | `/init` `/iosm` `/cycle-plan` `/cycle-status` `/cycle-report` `/cycle-list` |
211
- | **Orchestration** | `/orchestrate` `/agents` `/subagent-runs` `/subagent-resume` `/team-runs` `/team-status` |
212
- | **System** | `/doctor` `/export` `/share` `/copy` `/compact` `/reload` `/permissions` `/yolo` `/login` `/logout` |
213
-
214
- `/mcp add` without flags opens a guided add-server wizard directly in the TUI.
215
- `/memory` opens an interactive memory manager (add/edit/remove/scope/path), and `/memory <text>` appends a note to `memory.md` with immediate context reload.
216
-
217
- ### Keyboard Shortcuts
218
-
219
- | Key | Action |
220
- |-----|--------|
221
- | `Esc` | Interrupt current run |
222
- | `Ctrl+C` | Clear input |
223
- | `Ctrl+D` | Exit |
224
- | `Shift+Tab` | Cycle profile (full → plan → iosm) |
225
- | `Shift+Ctrl+T` | Cycle thinking level |
226
- | `Ctrl+P` / `Shift+Ctrl+P` | Next/previous model |
227
- | `Ctrl+L` | Open model selector |
228
- | `Ctrl+O` | Expand/collapse tool output |
229
- | `Ctrl+T` | Toggle thinking panel |
230
- | `Ctrl+G` | Open external editor |
231
- | `Alt+Enter` | Queue follow-up message |
232
-
233
- Customize keybindings via `~/.iosm/agent/keybindings.json`.
234
-
235
- ### Profiles
236
-
237
- | Profile | Behavior |
238
- |---------|----------|
239
- | `full` | Default — all tools enabled, full agent capabilities |
240
- | `plan` | Read-first planning and architecture mode |
241
- | `iosm` | IOSM context with artifact synchronization |
242
- | `explore` | Exploratory analysis (advanced) |
243
- | `iosm_analyst` | IOSM metric analysis (advanced) |
244
- | `iosm_verifier` | IOSM verification (advanced) |
245
- | `cycle_planner` | Cycle planning specialist (advanced) |
246
-
247
- ```bash
248
- iosm --profile plan
249
- iosm --profile iosm
118
+ Inside the session (full profile):
119
+ ```text
120
+ /login # or /auth: configure credentials
121
+ /model # select active model
122
+ <your task> # start working immediately
250
123
  ```
251
124
 
252
- ---
253
-
254
- ## 🔄 IOSM Methodology
255
-
256
- IOSM (**Improve → Optimize → Shrink → Modularize**) is an algorithmic methodology for systematic engineering improvement. Each cycle follows a fixed phase order with quality gates:
257
-
258
- ```
259
- PLAN → HYPOTHESIZE → IMPROVE → GATE_I → OPTIMIZE → GATE_O → SHRINK → GATE_S → MODULARIZE → GATE_M → SCORE → LEARN → DECIDE
125
+ When you need advanced IOSM workflow:
126
+ ```text
127
+ Shift+Tab # switch profile to iosm
128
+ /init # bootstrap IOSM workspace
129
+ /iosm 0.95 --max-iterations 5
260
130
  ```
261
131
 
262
- ### Workspace Artifacts
263
-
264
- Running `iosm init` creates:
265
-
132
+ Core commands to unlock full runtime value:
133
+ - `/orchestrate` — run parallel/sequential subagents with dependencies, locks, and optional worktrees
134
+ - `/init` + `/iosm` — execute measurable IOSM cycles with artifacts and quality gates
135
+ - `/mcp` — connect external tool ecosystems in interactive UI
136
+ - `/memory` — persist project facts and constraints across sessions
137
+
138
+ ## Real-World Example: Agent-Orchestrated IOSM Refactor
139
+
140
+ ```console
141
+ $ iosm
142
+ IOSM CLI v0.1.1 [full]
143
+
144
+ you> Refactor authentication module with parallel agents, then finalize in IOSM mode
145
+ iosm> /orchestrate --parallel --agents 4 \
146
+ --profiles iosm_analyst,explore,iosm_verifier,full \
147
+ --depends 3>1,4>2 --locks schema,config --worktree \
148
+ Refactor auth and reduce integration risk
149
+ iosm> Team run started: #77
150
+
151
+ iosm> agent[1] architecture map complete
152
+ iosm> agent[2] implementation patch set prepared
153
+ iosm> agent[3] verification suite and rollback checks ready
154
+ iosm> agent[4] integration validation passed
155
+ iosm> Consolidated patch plan generated
156
+
157
+ iosm> switch profile: iosm (Shift+Tab)
158
+ iosm> /init
159
+ iosm> IOSM workspace initialized
160
+ iosm> /iosm 0.95 --max-iterations 5
161
+
162
+ iosm> Baseline captured
163
+ iosm> Planned cycle from team artifacts: simplify auth module
164
+ iosm> Running improve -> verify -> optimize loop
165
+ iosm> Result: simplicity +18%, modularity +11%, performance +6%
166
+ iosm> Artifacts written to .iosm/cycles/2026-03-10-001/
266
167
  ```
267
- project/
268
- ├── iosm.yaml # Configuration, thresholds, weights, policies
269
- ├── IOSM.md # Operator/agent playbook and priority checklist
270
- └── .iosm/
271
- ├── metrics-history.jsonl # Longitudinal cycle metrics
272
- ├── decision-log.md # Historical decisions and rationale
273
- ├── pattern-library.md # Reusable implementation patterns
274
- ├── waivers.yaml # Governance exceptions
275
- ├── invariants.yaml # Logic baseline
276
- ├── contracts.yaml # Boundary control
277
- └── cycles/
278
- └── <cycle-id>/
279
- ├── baseline-report.json
280
- ├── hypotheses.json
281
- ├── cycle-report.json
282
- └── phase-reports/
283
- ├── improve.json
284
- ├── optimize.json
285
- ├── shrink.json
286
- └── modularize.json
287
- ```
288
-
289
- ### Six Canonical Metrics
290
-
291
- | Metric | Intent |
292
- |--------|--------|
293
- | `semantic` | The system says one thing in one way |
294
- | `logic` | The system behaves consistently |
295
- | `performance` | The system is fast enough and survives disruption |
296
- | `simplicity` | The system is easier to use and change |
297
- | `modularity` | The system evolves with low blast radius |
298
- | `flow` | The organization ships changes predictably |
299
168
 
300
- ### Example Workflow
169
+ For broader tasks, delegate in parallel:
301
170
 
302
171
  ```bash
303
- # 1. Initialize IOSM workspace
304
- iosm init
305
-
306
- # 2. Plan a cycle with goals
307
- iosm cycle plan "reduce checkout latency" "simplify auth module"
308
-
309
- # 3. Work through the cycle in interactive mode
310
- iosm --profile iosm
311
-
312
- # 4. Check progress
313
- iosm cycle status
314
-
315
- # 5. View the full report
316
- iosm cycle report
172
+ /orchestrate --parallel --agents 4 \
173
+ --profiles iosm_analyst,explore,iosm_verifier,full \
174
+ --depends 3>1,4>2 --locks schema,config --worktree \
175
+ Refactor auth and reduce integration risk
317
176
  ```
318
177
 
319
- For the full IOSM specification, see [iosm-spec.md](./iosm-spec.md).
320
-
321
- ---
322
-
323
- ## 🤝 Subagent Orchestration
324
-
325
- Delegate tasks to specialized subagents with parallel or sequential execution:
326
-
327
- ```bash
328
- # Orchestrate 3 parallel agents with different profiles
329
- /orchestrate --parallel --agents 3 \
330
- --profiles explore,full,iosm_verifier \
331
- --cwd .,src,.iosm \
332
- Implement feature X
333
-
334
- # Sequential with dependencies
335
- /orchestrate --sequential --agents 2 \
336
- --depends 2>1 \
337
- First analyze, then implement
338
-
339
- # With worktree isolation for write-heavy work
340
- /orchestrate --parallel --worktree --agents 2 \
341
- Refactor both modules independently
178
+ ## Architecture Overview
179
+
180
+ `IOSM CLI` is layered so execution stays controllable as task complexity grows:
181
+
182
+ ```text
183
+ Providers (OpenAI / Anthropic / OpenRouter / GitHub / Qwen)
184
+
185
+ Auth + Model Selection (/login, /model)
186
+
187
+ Agent Runtime (interactive + JSON + JSON-RPC + SDK)
188
+
189
+ Tooling Layer (read/edit/bash + search/structural/data/security tools + MCP tools)
190
+
191
+ Orchestration Engine (/orchestrate, subagents, dependencies, locks, worktrees)
192
+
193
+ IOSM Layer (/init, /iosm cycles, metrics, governance)
194
+
195
+ Artifacts + Memory (.iosm/cycles/*, checkpoints, /memory state)
342
196
  ```
343
197
 
344
- ### Custom Agents
345
-
346
- Define custom agents in `.iosm/agents/*.md`:
198
+ ## Design Principles
347
199
 
348
- ```markdown
349
- ---
350
- name: security-auditor
351
- description: Specialized security review agent
352
- ---
200
+ - **AI executes structured engineering loops, not ad hoc chats.** Core flow is orchestration + IOSM cycle execution (`/orchestrate` -> `/init` -> `/iosm`).
201
+ - **Complex work needs orchestration.** Parallel agents, dependency ordering, locks, and optional worktree isolation reduce collision and blast radius.
202
+ - **Refactoring must be measurable.** IOSM cycles capture baseline, hypotheses, and metric deltas instead of untracked edits.
203
+ - **Every important run must be auditable.** Artifacts and memory preserve decisions and outcomes across sessions.
204
+ - **Adoption should be progressive.** Start in `full` profile for speed; move to `iosm` profile for advanced cycles and governance when needed.
353
205
 
354
- You are a security auditor. Review code for:
355
- - SQL injection vulnerabilities
356
- - XSS attack vectors
357
- - Authentication bypasses
358
- - Secrets exposure
359
- ```
206
+ ## Operating Profiles
360
207
 
361
- Use with `@security-auditor` mention in interactive mode.
208
+ `IOSM CLI` has a layered operating model:
362
209
 
363
- ---
210
+ | Profile | Best For | What `/init` Does | Advanced Command |
211
+ |------|----------|-------------------|------------------|
212
+ | **full** (default) | Daily coding for any level | Generates/updates `AGENTS.md` from real repo scan and prepares `.iosm/agents/` | Use `/orchestrate` and built-in tools directly |
213
+ | **iosm** (advanced) | High-risk refactors and system-level engineering loops | Bootstraps full IOSM workspace (`iosm.yaml`, `IOSM.md`, `.iosm/cycles/...`) with optional agent verification | `/iosm [target-index] [--max-iterations N] [--force-init]` |
364
214
 
365
- ## 🔌 Extension System
366
-
367
- Extensions are TypeScript modules that can register tools, commands, hooks, UI components, and provider integrations.
368
-
369
- ### Quick Example
370
-
371
- ```typescript
372
- import type { ExtensionAPI } from "iosm-cli";
373
- import { Type } from "@sinclair/typebox";
374
-
375
- export default function (pi: ExtensionAPI) {
376
- // Register a custom tool
377
- pi.registerTool({
378
- name: "greet",
379
- label: "Greeting",
380
- description: "Generate a greeting",
381
- parameters: Type.Object({
382
- name: Type.String({ description: "Name to greet" }),
383
- }),
384
- async execute(toolCallId, params) {
385
- return {
386
- content: [{ type: "text", text: `Hello, ${params.name}!` }],
387
- details: {},
388
- };
389
- },
390
- });
391
-
392
- // Register a slash command
393
- pi.registerCommand("hello", {
394
- description: "Say hello",
395
- handler: async (args, ctx) => {
396
- ctx.ui.notify("Hello from extension!", "info");
397
- },
398
- });
399
-
400
- // Subscribe to lifecycle events
401
- pi.on("tool_call", async (event, ctx) => {
402
- if (event.toolName === "bash" && event.input.command?.includes("rm -rf")) {
403
- const ok = await ctx.ui.confirm("Warning", "Allow rm -rf?");
404
- if (!ok) return { block: true, reason: "Blocked by user" };
405
- }
406
- });
407
- }
408
- ```
409
-
410
- ### Loading Extensions
215
+ Typical advanced flow:
411
216
 
412
217
  ```bash
413
- # CLI flag
414
- iosm -e ./my-extension.ts
415
-
416
- # Auto-discovery directories
417
- ~/.iosm/agent/extensions/ # Global
418
- .iosm/extensions/ # Project-local
218
+ iosm --profile iosm
219
+ /init
220
+ /iosm 0.95 --max-iterations 5
419
221
  ```
420
222
 
421
- See [66 extension examples](./examples/extensions/) covering tools, UI, git integration, providers, and more.
422
-
423
- ---
424
-
425
- ## 📡 SDK & Programmatic Usage
426
-
427
- Use `iosm-cli` as a library in your own applications:
223
+ ## Smart Orchestration
428
224
 
429
- ```typescript
430
- import { createAgentSession, AuthStorage, ModelRegistry } from "iosm-cli";
225
+ For complex work, use explicit multi-agent orchestration instead of one long monolithic prompt.
431
226
 
432
- const authStorage = AuthStorage.create();
433
- const modelRegistry = new ModelRegistry(authStorage);
227
+ `/orchestrate` supports:
228
+ - parallel or sequential execution (`--parallel` / `--sequential`)
229
+ - controlled concurrency (`--max-parallel`)
230
+ - per-agent profiles and working directories (`--profiles`, `--cwd`)
231
+ - dependency DAGs (`--depends 2>1,3>2`)
232
+ - write safety (`--locks`) and optional git worktree isolation (`--worktree`)
434
233
 
435
- // Create a session
436
- const { session } = await createAgentSession({
437
- authStorage,
438
- modelRegistry,
439
- });
440
-
441
- // Subscribe to events
442
- session.subscribe((event) => {
443
- if (event.type === "message_update" && event.assistantMessageEvent.type === "text_delta") {
444
- process.stdout.write(event.assistantMessageEvent.delta);
445
- }
446
- });
447
-
448
- // Send prompts
449
- await session.prompt("Analyze this codebase and suggest improvements");
450
- ```
451
-
452
- ### Output Modes
234
+ Example:
453
235
 
454
236
  ```bash
455
- # JSON event stream (for automation)
456
- iosm --mode json "Your prompt"
457
-
458
- # JSON-RPC server (for IDE integration)
459
- iosm --mode rpc --no-session
460
-
461
- # Single-turn print (for scripts/CI)
462
- iosm -p "Summarize the architecture"
237
+ /orchestrate --parallel --agents 4 \
238
+ --profiles iosm_analyst,explore,iosm_verifier,full \
239
+ --max-parallel 2 \
240
+ --depends 3>1,4>2 \
241
+ --locks schema,config \
242
+ --worktree \
243
+ Improve auth reliability and performance with verification gates
463
244
  ```
464
245
 
465
- See [12 SDK examples](./examples/sdk/) for complete usage patterns.
246
+ Track and resume delegated execution with `/subagent-runs`, `/subagent-resume`, `/team-runs`, and `/team-status`.
466
247
 
467
- ---
468
-
469
- ## 📂 Sessions & Export
248
+ ## Core Commands
470
249
 
471
- ### Session Persistence
250
+ | Workflow Step | Command | Why It Matters |
251
+ |------|---------|----------------|
252
+ | Start clean context | `/new` or `/clear` | Reset session state before a new task or after context drift |
253
+ | Configure auth | `/login` or `/auth` | Set provider credentials with guided flow |
254
+ | Select active model | `/model` | Choose provider/model category for current workload |
255
+ | Launch multi-agent execution | `/orchestrate ...` | Split complex tasks across agents with dependencies, locks, and optional worktrees |
256
+ | Initialize IOSM workspace | `/init` | Bootstrap/update IOSM files and cycle workspace |
257
+ | Run IOSM cycle | `/iosm [target-index] [--max-iterations N]` | Execute measurable improve/verify loops with artifact output |
258
+ | Track delegated runs | `/subagent-runs`, `/subagent-resume`, `/team-runs`, `/team-status` | Monitor and resume orchestration pipelines |
259
+ | Manage MCP servers | `/mcp` | Inspect/add/enable external tool servers interactively |
260
+ | Manage memory | `/memory` | Add/edit/remove persistent project facts and constraints |
261
+ | Save/restore state | `/checkpoint` / `/rollback` | Safe experimentation with fast rollback |
262
+ | Diagnose runtime | `/doctor` | Verify model/auth/MCP/resources when behavior is inconsistent |
263
+ | Manage settings | `/settings` | Tune runtime defaults and operational preferences |
472
264
 
473
- ```bash
474
- # Continue previous session
475
- iosm --continue
476
- iosm -c
265
+ ## IOSM In One Line
477
266
 
478
- # Interactive session picker
479
- iosm --resume
480
- iosm -r
267
+ **IOSM** gives you a repeatable loop for improving codebases with explicit quality gates, metrics, and artifact history instead of one-off AI edits.
481
268
 
482
- # Use specific session file
483
- iosm --session /path/to/session.jsonl
484
-
485
- # Ephemeral (no persistence)
486
- iosm --no-session
487
- ```
488
-
489
- ### Export & Sharing
269
+ Quick start:
490
270
 
491
271
  ```bash
492
- # Export session to HTML
493
- /export
494
-
495
- # Share via GitHub Gist
496
- /share
497
-
498
- # Copy last response to clipboard
499
- /copy
500
- ```
501
-
502
- ### Session Navigation
503
-
504
- ```bash
505
- # View session tree
506
- /tree
507
-
508
- # Fork from a previous point
509
- /fork
510
-
511
- # Name the session
512
- /name "refactoring-auth-module"
272
+ iosm init
273
+ iosm cycle plan "reduce API latency" "simplify auth module"
274
+ iosm cycle status
275
+ iosm cycle report
513
276
  ```
514
277
 
515
- ---
516
-
517
- ## ⚙️ Configuration
278
+ ## Documentation
518
279
 
519
- ### Hierarchy (highest priority first)
280
+ Use the docs as the source of truth for details.
520
281
 
521
- 1. **CLI flags** runtime overrides
522
- 2. **Project settings** — `.iosm/settings.json`
523
- 3. **Global settings** `~/.iosm/agent/settings.json`
282
+ | Topic | Link |
283
+ |------|------|
284
+ | Getting started | [docs/getting-started.md](./docs/getting-started.md) |
285
+ | CLI flags and options | [docs/cli-reference.md](./docs/cli-reference.md) |
286
+ | Interactive mode (commands, keys, profiles) | [docs/interactive-mode.md](./docs/interactive-mode.md) |
287
+ | IOSM init/cycles | [docs/iosm-init-and-cycles.md](./docs/iosm-init-and-cycles.md) |
288
+ | MCP, providers, settings | [docs/configuration.md](./docs/configuration.md) |
289
+ | Orchestration and subagents | [docs/orchestration-and-subagents.md](./docs/orchestration-and-subagents.md) |
290
+ | Extensions, packages, themes | [docs/extensions-packages-themes.md](./docs/extensions-packages-themes.md) |
291
+ | Sessions, traces, export | [docs/sessions-traces-export.md](./docs/sessions-traces-export.md) |
292
+ | JSON/RPC/SDK usage | [docs/rpc-json-sdk.md](./docs/rpc-json-sdk.md) |
293
+ | Full docs index | [docs/README.md](./docs/README.md) |
294
+ | Full IOSM specification (local) | [iosm-spec.md](./iosm-spec.md) |
295
+ | IOSM methodology spec (canonical) | [github.com/rokoss21/IOSM](https://github.com/rokoss21/IOSM) |
524
296
 
525
- ### Key Directories
297
+ ## Related Repositories
526
298
 
527
- | Path | Purpose |
528
- |------|---------|
529
- | `~/.iosm/agent/` | Global config, models, auth, sessions |
530
- | `~/.iosm/agent/settings.json` | Global settings |
531
- | `~/.iosm/agent/auth.json` | Provider credentials |
532
- | `~/.iosm/agent/extensions/` | Global extensions |
533
- | `~/.iosm/agent/skills/` | Global skills |
534
- | `~/.iosm/agent/themes/` | Global themes |
535
- | `.iosm/` | Project-local workspace |
536
- | `.iosm/settings.json` | Project settings |
537
- | `.iosm/extensions/` | Project extensions |
299
+ | Repository | Description |
300
+ |------------|-------------|
301
+ | [IOSM](https://github.com/rokoss21/IOSM) | Canonical IOSM v1.0 specification, schemas, artifact templates, and validation scripts |
302
+ | [iosm-cli](https://github.com/rokoss21/iosm-cli) | This repo — CLI runtime that implements the IOSM methodology as an engineering agent |
538
303
 
539
- ### Environment Variables
304
+ ## Development
540
305
 
541
306
  ```bash
542
- # Provider keys
543
- export ANTHROPIC_API_KEY="..."
544
- export OPENAI_API_KEY="..."
545
- export GEMINI_API_KEY="..."
546
-
547
- # Runtime behavior
548
- export IOSM_OFFLINE=1 # Disable network on startup
549
- export IOSM_SESSION_TRACE=1 # Enable JSONL trace
550
- export IOSM_SESSION_TRACE_DIR="/traces" # Trace directory
551
- export IOSM_CODING_AGENT_DIR="/custom" # Override agent directory
552
- ```
553
-
554
- ---
555
-
556
- ## 📁 Repository Structure
557
-
558
- ```
559
- iosm-cli/
560
- ├── src/
561
- │ ├── cli/ # CLI argument parsing and config
562
- │ ├── core/ # Runtime engine
563
- │ │ ├── tools/ # Built-in tools (read, bash, edit, write, grep, find, ls)
564
- │ │ ├── extensions/ # Extension system (discovery, runners, hooks)
565
- │ │ ├── compaction/ # Context compaction and summarization
566
- │ │ ├── export-html/ # HTML session export templates
567
- │ │ ├── agent-session.ts # Core agent session logic
568
- │ │ ├── subagents.ts # Subagent orchestration
569
- │ │ ├── session-manager.ts # Session persistence
570
- │ │ ├── model-registry.ts # Multi-provider model registry
571
- │ │ ├── package-manager.ts # Package install/remove/update
572
- │ │ ├── sdk.ts # Programmatic API
573
- │ │ └── ...
574
- │ ├── iosm/ # IOSM methodology implementation
575
- │ │ ├── init.ts # Workspace bootstrapping
576
- │ │ ├── cycle.ts # Cycle lifecycle management
577
- │ │ ├── metrics.ts # Metric calculation and normalization
578
- │ │ ├── config.ts # IOSM configuration parsing
579
- │ │ └── ...
580
- │ ├── modes/ # Output modes
581
- │ │ ├── interactive/ # TUI with full keyboard/UI
582
- │ │ ├── rpc/ # JSON-RPC server mode
583
- │ │ └── print-mode.ts # Single-shot print mode
584
- │ └── utils/ # Utilities (git, shell, clipboard, images)
585
- ├── test/ # 73 Vitest test files
586
- ├── examples/
587
- │ ├── extensions/ # 66 extension examples
588
- │ └── sdk/ # 12 SDK examples
589
- ├── docs/ # Comprehensive documentation
590
- ├── iosm-spec.md # Full IOSM methodology specification
591
- ├── package.json
592
- ├── tsconfig.base.json
593
- └── vitest.config.ts
594
- ```
595
-
596
- ---
597
-
598
- ## 🧑‍💻 Development
599
-
600
- ```bash
601
- # Install dependencies
602
307
  npm install
603
-
604
- # Type-check
605
308
  npm run check
606
-
607
- # Run tests
608
309
  npm test
609
-
610
- # Build
611
310
  npm run build
612
-
613
- # Watch mode (development)
614
- npm run dev
615
-
616
- # Build standalone binary (via Bun)
617
- npm run build:binary
618
311
  ```
619
312
 
620
- See [Development & Testing](./docs/development-and-testing.md) and [CONTRIBUTING.md](./CONTRIBUTING.md) for details.
621
-
622
- ---
623
-
624
- ## 📚 Documentation
625
-
626
- | Document | Description |
627
- |----------|-------------|
628
- | [Getting Started](./docs/getting-started.md) | Installation, first run, provider setup |
629
- | [CLI Reference](./docs/cli-reference.md) | Complete flag and option reference |
630
- | [Interactive Mode](./docs/interactive-mode.md) | Slash commands, keybindings, profiles |
631
- | [IOSM Init & Cycles](./docs/iosm-init-and-cycles.md) | Workspace bootstrap and cycle operations |
632
- | [Orchestration & Subagents](./docs/orchestration-and-subagents.md) | Task delegation and parallel execution |
633
- | [Extensions & Packages](./docs/extensions-packages-themes.md) | Extension API, skills, themes, packages |
634
- | [Configuration](./docs/configuration.md) | Settings, env vars, profiles |
635
- | [Sessions & Export](./docs/sessions-traces-export.md) | Persistence, traces, HTML export |
636
- | [JSON/RPC/SDK](./docs/rpc-json-sdk.md) | Programmatic integrations |
637
- | [Development & Testing](./docs/development-and-testing.md) | Contributing, architecture, tests |
638
- | [IOSM Specification](./iosm-spec.md) | Full methodology specification |
313
+ Contributing guide: [CONTRIBUTING.md](./CONTRIBUTING.md)
639
314
 
640
- ---
641
-
642
- ## 📄 License
315
+ ## License
643
316
 
644
317
  [MIT](./LICENSE) © 2026 Emil Rokossovskiy
645
318
 
646
- ---
647
-
648
319
  <p align="center">
649
- <sub>Created by Emil Rokossovskiy · <a href="https://github.com/rokoss21">@rokoss21</a> · ecsiar@gmail.com</sub>
320
+ <sub>Built for teams that treat AI coding as an engineering system, not a chat.</sub>
650
321
  </p>