indusagi-coding-agent 0.1.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 (240) hide show
  1. package/CHANGELOG.md +2249 -0
  2. package/README.md +546 -0
  3. package/dist/cli/args.js +282 -0
  4. package/dist/cli/config-selector.js +30 -0
  5. package/dist/cli/file-processor.js +78 -0
  6. package/dist/cli/list-models.js +91 -0
  7. package/dist/cli/session-picker.js +31 -0
  8. package/dist/cli.js +10 -0
  9. package/dist/config.js +158 -0
  10. package/dist/core/agent-session.js +2097 -0
  11. package/dist/core/auth-storage.js +278 -0
  12. package/dist/core/bash-executor.js +211 -0
  13. package/dist/core/compaction/branch-summarization.js +241 -0
  14. package/dist/core/compaction/compaction.js +606 -0
  15. package/dist/core/compaction/index.js +6 -0
  16. package/dist/core/compaction/utils.js +137 -0
  17. package/dist/core/diagnostics.js +1 -0
  18. package/dist/core/event-bus.js +24 -0
  19. package/dist/core/exec.js +70 -0
  20. package/dist/core/export-html/ansi-to-html.js +248 -0
  21. package/dist/core/export-html/index.js +221 -0
  22. package/dist/core/export-html/template.css +905 -0
  23. package/dist/core/export-html/template.html +54 -0
  24. package/dist/core/export-html/template.js +1549 -0
  25. package/dist/core/export-html/tool-renderer.js +56 -0
  26. package/dist/core/export-html/vendor/highlight.min.js +1213 -0
  27. package/dist/core/export-html/vendor/marked.min.js +6 -0
  28. package/dist/core/extensions/index.js +8 -0
  29. package/dist/core/extensions/loader.js +395 -0
  30. package/dist/core/extensions/runner.js +499 -0
  31. package/dist/core/extensions/types.js +31 -0
  32. package/dist/core/extensions/wrapper.js +101 -0
  33. package/dist/core/footer-data-provider.js +133 -0
  34. package/dist/core/index.js +8 -0
  35. package/dist/core/keybindings.js +140 -0
  36. package/dist/core/messages.js +122 -0
  37. package/dist/core/model-registry.js +454 -0
  38. package/dist/core/model-resolver.js +309 -0
  39. package/dist/core/package-manager.js +1142 -0
  40. package/dist/core/prompt-templates.js +250 -0
  41. package/dist/core/resource-loader.js +569 -0
  42. package/dist/core/sdk.js +225 -0
  43. package/dist/core/session-manager.js +1078 -0
  44. package/dist/core/settings-manager.js +430 -0
  45. package/dist/core/skills.js +339 -0
  46. package/dist/core/system-prompt.js +136 -0
  47. package/dist/core/timings.js +24 -0
  48. package/dist/core/tools/bash.js +226 -0
  49. package/dist/core/tools/edit-diff.js +242 -0
  50. package/dist/core/tools/edit.js +145 -0
  51. package/dist/core/tools/find.js +205 -0
  52. package/dist/core/tools/grep.js +238 -0
  53. package/dist/core/tools/index.js +60 -0
  54. package/dist/core/tools/ls.js +117 -0
  55. package/dist/core/tools/path-utils.js +52 -0
  56. package/dist/core/tools/read.js +165 -0
  57. package/dist/core/tools/truncate.js +204 -0
  58. package/dist/core/tools/write.js +77 -0
  59. package/dist/index.js +41 -0
  60. package/dist/main.js +565 -0
  61. package/dist/migrations.js +260 -0
  62. package/dist/modes/index.js +7 -0
  63. package/dist/modes/interactive/components/armin.js +328 -0
  64. package/dist/modes/interactive/components/assistant-message.js +86 -0
  65. package/dist/modes/interactive/components/bash-execution.js +155 -0
  66. package/dist/modes/interactive/components/bordered-loader.js +47 -0
  67. package/dist/modes/interactive/components/branch-summary-message.js +41 -0
  68. package/dist/modes/interactive/components/compaction-summary-message.js +42 -0
  69. package/dist/modes/interactive/components/config-selector.js +458 -0
  70. package/dist/modes/interactive/components/countdown-timer.js +27 -0
  71. package/dist/modes/interactive/components/custom-editor.js +61 -0
  72. package/dist/modes/interactive/components/custom-message.js +80 -0
  73. package/dist/modes/interactive/components/diff.js +132 -0
  74. package/dist/modes/interactive/components/dynamic-border.js +19 -0
  75. package/dist/modes/interactive/components/extension-editor.js +96 -0
  76. package/dist/modes/interactive/components/extension-input.js +54 -0
  77. package/dist/modes/interactive/components/extension-selector.js +70 -0
  78. package/dist/modes/interactive/components/footer.js +213 -0
  79. package/dist/modes/interactive/components/index.js +31 -0
  80. package/dist/modes/interactive/components/keybinding-hints.js +60 -0
  81. package/dist/modes/interactive/components/login-dialog.js +138 -0
  82. package/dist/modes/interactive/components/model-selector.js +253 -0
  83. package/dist/modes/interactive/components/oauth-selector.js +91 -0
  84. package/dist/modes/interactive/components/scoped-models-selector.js +262 -0
  85. package/dist/modes/interactive/components/session-selector-search.js +145 -0
  86. package/dist/modes/interactive/components/session-selector.js +698 -0
  87. package/dist/modes/interactive/components/settings-selector.js +250 -0
  88. package/dist/modes/interactive/components/show-images-selector.js +33 -0
  89. package/dist/modes/interactive/components/skill-invocation-message.js +44 -0
  90. package/dist/modes/interactive/components/theme-selector.js +43 -0
  91. package/dist/modes/interactive/components/thinking-selector.js +45 -0
  92. package/dist/modes/interactive/components/tool-execution.js +608 -0
  93. package/dist/modes/interactive/components/tree-selector.js +892 -0
  94. package/dist/modes/interactive/components/user-message-selector.js +109 -0
  95. package/dist/modes/interactive/components/user-message.js +15 -0
  96. package/dist/modes/interactive/components/visual-truncate.js +32 -0
  97. package/dist/modes/interactive/interactive-mode.js +3576 -0
  98. package/dist/modes/interactive/theme/dark.json +85 -0
  99. package/dist/modes/interactive/theme/light.json +84 -0
  100. package/dist/modes/interactive/theme/theme-schema.json +335 -0
  101. package/dist/modes/interactive/theme/theme.js +938 -0
  102. package/dist/modes/print-mode.js +96 -0
  103. package/dist/modes/rpc/rpc-client.js +390 -0
  104. package/dist/modes/rpc/rpc-mode.js +448 -0
  105. package/dist/modes/rpc/rpc-types.js +7 -0
  106. package/dist/utils/changelog.js +86 -0
  107. package/dist/utils/clipboard-image.js +116 -0
  108. package/dist/utils/clipboard.js +58 -0
  109. package/dist/utils/frontmatter.js +25 -0
  110. package/dist/utils/git.js +5 -0
  111. package/dist/utils/image-convert.js +34 -0
  112. package/dist/utils/image-resize.js +180 -0
  113. package/dist/utils/mime.js +25 -0
  114. package/dist/utils/photon.js +120 -0
  115. package/dist/utils/shell.js +164 -0
  116. package/dist/utils/sleep.js +16 -0
  117. package/dist/utils/tools-manager.js +186 -0
  118. package/docs/compaction.md +390 -0
  119. package/docs/custom-provider.md +538 -0
  120. package/docs/development.md +69 -0
  121. package/docs/extensions.md +1733 -0
  122. package/docs/images/doom-extension.png +0 -0
  123. package/docs/images/interactive-mode.png +0 -0
  124. package/docs/images/tree-view.png +0 -0
  125. package/docs/json.md +79 -0
  126. package/docs/keybindings.md +162 -0
  127. package/docs/models.md +193 -0
  128. package/docs/packages.md +163 -0
  129. package/docs/prompt-templates.md +67 -0
  130. package/docs/providers.md +147 -0
  131. package/docs/rpc.md +1048 -0
  132. package/docs/sdk.md +957 -0
  133. package/docs/session.md +412 -0
  134. package/docs/settings.md +216 -0
  135. package/docs/shell-aliases.md +13 -0
  136. package/docs/skills.md +226 -0
  137. package/docs/terminal-setup.md +65 -0
  138. package/docs/themes.md +295 -0
  139. package/docs/tree.md +219 -0
  140. package/docs/tui.md +887 -0
  141. package/docs/windows.md +17 -0
  142. package/examples/README.md +25 -0
  143. package/examples/extensions/README.md +192 -0
  144. package/examples/extensions/antigravity-image-gen.ts +414 -0
  145. package/examples/extensions/auto-commit-on-exit.ts +49 -0
  146. package/examples/extensions/bookmark.ts +50 -0
  147. package/examples/extensions/claude-rules.ts +86 -0
  148. package/examples/extensions/confirm-destructive.ts +59 -0
  149. package/examples/extensions/custom-compaction.ts +115 -0
  150. package/examples/extensions/custom-footer.ts +65 -0
  151. package/examples/extensions/custom-header.ts +73 -0
  152. package/examples/extensions/custom-provider-anthropic/index.ts +605 -0
  153. package/examples/extensions/custom-provider-anthropic/package-lock.json +24 -0
  154. package/examples/extensions/custom-provider-anthropic/package.json +19 -0
  155. package/examples/extensions/custom-provider-gitlab-duo/index.ts +350 -0
  156. package/examples/extensions/custom-provider-gitlab-duo/package.json +16 -0
  157. package/examples/extensions/custom-provider-gitlab-duo/test.ts +83 -0
  158. package/examples/extensions/dirty-repo-guard.ts +56 -0
  159. package/examples/extensions/doom-overlay/README.md +46 -0
  160. package/examples/extensions/doom-overlay/doom/build/doom.js +21 -0
  161. package/examples/extensions/doom-overlay/doom/build/doom.wasm +0 -0
  162. package/examples/extensions/doom-overlay/doom/build.sh +152 -0
  163. package/examples/extensions/doom-overlay/doom/doomgeneric_pi.c +72 -0
  164. package/examples/extensions/doom-overlay/doom-component.ts +133 -0
  165. package/examples/extensions/doom-overlay/doom-engine.ts +173 -0
  166. package/examples/extensions/doom-overlay/doom-keys.ts +105 -0
  167. package/examples/extensions/doom-overlay/index.ts +74 -0
  168. package/examples/extensions/doom-overlay/wad-finder.ts +51 -0
  169. package/examples/extensions/event-bus.ts +43 -0
  170. package/examples/extensions/file-trigger.ts +41 -0
  171. package/examples/extensions/git-checkpoint.ts +53 -0
  172. package/examples/extensions/handoff.ts +151 -0
  173. package/examples/extensions/hello.ts +25 -0
  174. package/examples/extensions/inline-bash.ts +94 -0
  175. package/examples/extensions/input-transform.ts +43 -0
  176. package/examples/extensions/interactive-shell.ts +196 -0
  177. package/examples/extensions/mac-system-theme.ts +47 -0
  178. package/examples/extensions/message-renderer.ts +60 -0
  179. package/examples/extensions/modal-editor.ts +86 -0
  180. package/examples/extensions/model-status.ts +31 -0
  181. package/examples/extensions/notify.ts +25 -0
  182. package/examples/extensions/overlay-qa-tests.ts +882 -0
  183. package/examples/extensions/overlay-test.ts +151 -0
  184. package/examples/extensions/permission-gate.ts +34 -0
  185. package/examples/extensions/pirate.ts +47 -0
  186. package/examples/extensions/plan-mode/README.md +65 -0
  187. package/examples/extensions/plan-mode/index.ts +341 -0
  188. package/examples/extensions/plan-mode/utils.ts +168 -0
  189. package/examples/extensions/preset.ts +399 -0
  190. package/examples/extensions/protected-paths.ts +30 -0
  191. package/examples/extensions/qna.ts +120 -0
  192. package/examples/extensions/question.ts +265 -0
  193. package/examples/extensions/questionnaire.ts +428 -0
  194. package/examples/extensions/rainbow-editor.ts +88 -0
  195. package/examples/extensions/sandbox/index.ts +318 -0
  196. package/examples/extensions/sandbox/package-lock.json +92 -0
  197. package/examples/extensions/sandbox/package.json +19 -0
  198. package/examples/extensions/send-user-message.ts +97 -0
  199. package/examples/extensions/session-name.ts +27 -0
  200. package/examples/extensions/shutdown-command.ts +63 -0
  201. package/examples/extensions/snake.ts +344 -0
  202. package/examples/extensions/space-invaders.ts +561 -0
  203. package/examples/extensions/ssh.ts +220 -0
  204. package/examples/extensions/status-line.ts +40 -0
  205. package/examples/extensions/subagent/README.md +172 -0
  206. package/examples/extensions/subagent/agents/planner.md +37 -0
  207. package/examples/extensions/subagent/agents/reviewer.md +35 -0
  208. package/examples/extensions/subagent/agents/scout.md +50 -0
  209. package/examples/extensions/subagent/agents/worker.md +24 -0
  210. package/examples/extensions/subagent/agents.ts +127 -0
  211. package/examples/extensions/subagent/index.ts +964 -0
  212. package/examples/extensions/subagent/prompts/implement-and-review.md +10 -0
  213. package/examples/extensions/subagent/prompts/implement.md +10 -0
  214. package/examples/extensions/subagent/prompts/scout-and-plan.md +9 -0
  215. package/examples/extensions/summarize.ts +196 -0
  216. package/examples/extensions/timed-confirm.ts +70 -0
  217. package/examples/extensions/todo.ts +300 -0
  218. package/examples/extensions/tool-override.ts +144 -0
  219. package/examples/extensions/tools.ts +147 -0
  220. package/examples/extensions/trigger-compact.ts +40 -0
  221. package/examples/extensions/truncated-tool.ts +193 -0
  222. package/examples/extensions/widget-placement.ts +17 -0
  223. package/examples/extensions/with-deps/index.ts +36 -0
  224. package/examples/extensions/with-deps/package-lock.json +31 -0
  225. package/examples/extensions/with-deps/package.json +22 -0
  226. package/examples/sdk/01-minimal.ts +22 -0
  227. package/examples/sdk/02-custom-model.ts +50 -0
  228. package/examples/sdk/03-custom-prompt.ts +55 -0
  229. package/examples/sdk/04-skills.ts +46 -0
  230. package/examples/sdk/05-tools.ts +56 -0
  231. package/examples/sdk/06-extensions.ts +88 -0
  232. package/examples/sdk/07-context-files.ts +40 -0
  233. package/examples/sdk/08-prompt-templates.ts +47 -0
  234. package/examples/sdk/09-api-keys-and-oauth.ts +48 -0
  235. package/examples/sdk/10-settings.ts +38 -0
  236. package/examples/sdk/11-sessions.ts +48 -0
  237. package/examples/sdk/12-full-control.ts +82 -0
  238. package/examples/sdk/13-codex-oauth.ts +37 -0
  239. package/examples/sdk/README.md +144 -0
  240. package/package.json +85 -0
package/README.md ADDED
@@ -0,0 +1,546 @@
1
+ <p align="center">
2
+ <a href="https://shittycodingagent.ai">
3
+ <img src="https://shittycodingagent.ai/logo.svg" alt="indusagi logo" width="128">
4
+ </a>
5
+ </p>
6
+ <p align="center">
7
+ <a href="https://discord.com/invite/nKXTsAcmbT"><img alt="Discord" src="https://img.shields.io/badge/discord-community-5865F2?style=flat-square&logo=discord&logoColor=white" /></a>
8
+ <a href="https://www.npmjs.com/package/indusagi-coding-agent"><img alt="npm" src="https://img.shields.io/npm/v/indusagi-coding-agent?style=flat-square" /></a>
9
+ <a href="https://github.com/badlogic/indusagi-mono/actions/workflows/ci.yml"><img alt="Build status" src="https://img.shields.io/github/actions/workflow/status/badlogic/indusagi-mono/ci.yml?style=flat-square&branch=main" /></a>
10
+ </p>
11
+
12
+ Indusagi is a minimal terminal coding harness. Adapt indusagi to your workflows, not the other way around, without having to fork and modify indusagi internals. Extend it with TypeScript [Extensions](#extensions), [Skills](#skills), [Prompt Templates](#prompt-templates), and [Themes](#themes). Put your extensions, skills, prompt templates, and themes in [Indusagi Packages](#indusagi-packages) and share them with others via npm or git.
13
+
14
+ Indusagi ships with powerful defaults but skips features like sub agents and plan mode. Instead, you can ask indusagi to build what you want or install a third party indusagi package that matches your workflow.
15
+
16
+ Indusagi runs in four modes: interactive, print or JSON, RPC for process integration, and an SDK for embedding in your own apps. See [clawdbot/clawdbot](https://github.com/clawdbot/clawdbot) for a real-world SDK integration.
17
+
18
+ ## Table of Contents
19
+
20
+ - [Quick Start](#quick-start)
21
+ - [Providers & Models](#providers--models)
22
+ - [Interactive Mode](#interactive-mode)
23
+ - [Editor](#editor)
24
+ - [Commands](#commands)
25
+ - [Keyboard Shortcuts](#keyboard-shortcuts)
26
+ - [Message Queue](#message-queue)
27
+ - [Sessions](#sessions)
28
+ - [Branching](#branching)
29
+ - [Compaction](#compaction)
30
+ - [Settings](#settings)
31
+ - [Context Files](#context-files)
32
+ - [Customization](#customization)
33
+ - [Prompt Templates](#prompt-templates)
34
+ - [Skills](#skills)
35
+ - [Extensions](#extensions)
36
+ - [Themes](#themes)
37
+ - [Indusagi Packages](#indusagi-packages)
38
+ - [Programmatic Usage](#programmatic-usage)
39
+ - [Philosophy](#philosophy)
40
+ - [CLI Reference](#cli-reference)
41
+
42
+ ---
43
+
44
+ ## Quick Start
45
+
46
+ ```bash
47
+ npm install -g indusagi-coding-agent
48
+ ```
49
+
50
+ Authenticate with an API key:
51
+
52
+ ```bash
53
+ export ANTHROPIC_AINDUSAGI_KEY=sk-ant-...
54
+ indusagi
55
+ ```
56
+
57
+ Or use your existing subscription:
58
+
59
+ ```bash
60
+ indusagi
61
+ /login # Then select provider
62
+ ```
63
+
64
+ Then just talk to indusagi. By default, indusagi gives the model four tools: `read`, `write`, `edit`, and `bash`. The model uses these to fulfill your requests. Add capabilities via [skills](#skills), [prompt templates](#prompt-templates), [extensions](#extensions), or [indusagi packages](#indusagi-packages).
65
+
66
+ **Platform notes:** [Windows](docs/windows.md) | [Terminal setup](docs/terminal-setup.md) | [Shell aliases](docs/shell-aliases.md)
67
+
68
+ ---
69
+
70
+ ## Providers & Models
71
+
72
+ For each built-in provider, indusagi maintains a list of tool-capable models, updated with every release. Authenticate via subscription (`/login`) or API key, then select any model from that provider via `/model` (or Ctrl+L).
73
+
74
+ **Subscriptions:**
75
+ - Anthropic Claude Pro/Max
76
+ - OpenAI ChatGPT Plus/Pro (Codex)
77
+ - GitHub Copilot
78
+ - Google Gemini CLI
79
+ - Google Antigravity
80
+
81
+ **API keys:**
82
+ - Anthropic
83
+ - OpenAI
84
+ - Azure OpenAI
85
+ - Google Gemini
86
+ - Google Vertex
87
+ - Amazon Bedrock
88
+ - Mistral
89
+ - Groq
90
+ - Cerebras
91
+ - xAI
92
+ - OpenRouter
93
+ - Vercel AI Gateway
94
+ - ZAI
95
+ - OpenCode Zen
96
+ - MiniMax
97
+
98
+ See [docs/providers.md](docs/providers.md) for detailed setup instructions.
99
+
100
+ **Custom providers & models:** Add providers via `~/.indusagi/agent/models.json` if they speak a supported API (OpenAI, Anthropic, Google). For custom APIs or OAuth, use extensions. See [docs/models.md](docs/models.md) and [docs/custom-provider.md](docs/custom-provider.md).
101
+
102
+ ---
103
+
104
+ ## Interactive Mode
105
+
106
+ <p align="center"><img src="docs/images/interactive-mode.png" alt="Interactive Mode" width="600"></p>
107
+
108
+ The interface from top to bottom:
109
+
110
+ - **Startup header** - Shows shortcuts (`/hotkeys` for all), loaded AGENTS.md files, prompt templates, skills, and extensions
111
+ - **Messages** - Your messages, assistant responses, tool calls and results, notifications, errors, and extension UI
112
+ - **Editor** - Where you type; border color indicates thinking level
113
+ - **Footer** - Working directory, session name, total token/cache usage, cost, context usage, current model
114
+
115
+ The editor can be temporarily replaced by other UI, like built-in `/settings` or custom UI from extensions (e.g., a Q&A tool that lets the user answer model questions in a structured format). [Extensions](#extensions) can also replace the editor, add widgets above/below it, a status line, custom footer, or overlays.
116
+
117
+ ### Editor
118
+
119
+ | Feature | How |
120
+ |---------|-----|
121
+ | File reference | Type `@` to fuzzy-search project files |
122
+ | Path completion | Tab to complete paths |
123
+ | Multi-line | Shift+Enter (or Ctrl+Enter on Windows Terminal) |
124
+ | Images | Ctrl+V to paste, or drag onto terminal |
125
+ | Bash commands | `!command` runs and sends output to LLM, `!!command` runs without sending |
126
+
127
+ Standard editing keybindings for delete word, undo, etc. See [docs/keybindings.md](docs/keybindings.md).
128
+
129
+ ### Commands
130
+
131
+ Type `/` in the editor to trigger commands. [Extensions](#extensions) can register custom commands, [skills](#skills) are available as `/skill:name`, and [prompt templates](#prompt-templates) expand via `/templatename`.
132
+
133
+ | Command | Description |
134
+ |---------|-------------|
135
+ | `/login`, `/logout` | OAuth authentication |
136
+ | `/model` | Switch models |
137
+ | `/scoped-models` | Enable/disable models for Ctrl+P cycling |
138
+ | `/settings` | Thinking level, theme, message delivery |
139
+ | `/resume` | Pick from previous sessions |
140
+ | `/new` | Start a new session |
141
+ | `/name <name>` | Set session display name |
142
+ | `/session` | Show session info (path, tokens, cost) |
143
+ | `/tree` | Jump to any point in the session and continue from there |
144
+ | `/fork` | Create a new session from the current branch |
145
+ | `/compact [prompt]` | Manually compact context, optional custom instructions |
146
+ | `/copy` | Copy last assistant message to clipboard |
147
+ | `/export [file]` | Export session to HTML file |
148
+ | `/share` | Upload as private GitHub gist with shareable HTML link |
149
+ | `/reload` | Reload extensions, skills, prompts, context files (themes hot-reload automatically) |
150
+ | `/hotkeys` | Show all keyboard shortcuts |
151
+ | `/changelog` | Display version history |
152
+ | `/quit`, `/exit` | Quit indusagi |
153
+
154
+ ### Keyboard Shortcuts
155
+
156
+ See `/hotkeys` for the full list. Customize via `~/.indusagi/agent/keybindings.json`. See [docs/keybindings.md](docs/keybindings.md).
157
+
158
+ **Commonly used:**
159
+
160
+ | Key | Action |
161
+ |-----|--------|
162
+ | Ctrl+C | Clear editor |
163
+ | Ctrl+C twice | Quit |
164
+ | Escape | Cancel/abort |
165
+ | Escape twice | Open `/tree` |
166
+ | Ctrl+L | Open model selector |
167
+ | Ctrl+P / Shift+Ctrl+P | Cycle scoped models forward/backward |
168
+ | Shift+Tab | Cycle thinking level |
169
+ | Ctrl+O | Collapse/expand tool output |
170
+ | Ctrl+T | Collapse/expand thinking blocks |
171
+
172
+ ### Message Queue
173
+
174
+ Submit messages while the agent is working:
175
+
176
+ - **Enter** queues a *steering* message, delivered after current tool execution (interrupts remaining tools)
177
+ - **Alt+Enter** queues a *follow-up* message, delivered only after the agent finishes all work
178
+ - **Escape** aborts and restores queued messages to editor
179
+ - **Alt+Up** retrieves queued messages back to editor
180
+
181
+ Configure delivery in [settings](docs/settings.md): `steeringMode` and `followUpMode` can be `"one-at-a-time"` (default, waits for response) or `"all"` (delivers all queued at once).
182
+
183
+ ---
184
+
185
+ ## Sessions
186
+
187
+ Sessions are stored as JSONL files with a tree structure. Each entry has an `id` and `parentId`, enabling in-place branching without creating new files. See [docs/session.md](docs/session.md) for file format.
188
+
189
+ ### Management
190
+
191
+ Sessions auto-save to `~/.indusagi/agent/sessions/` organized by working directory.
192
+
193
+ ```bash
194
+ indusagi -c # Continue most recent session
195
+ indusagi -r # Browse and select from past sessions
196
+ indusagi --no-session # Ephemeral mode (don't save)
197
+ indusagi --session <path> # Use specific session file or ID
198
+ ```
199
+
200
+ ### Branching
201
+
202
+ **`/tree`** - Navigate the session tree in-place. Select any previous point, continue from there, and switch between branches. All history preserved in a single file.
203
+
204
+ <p align="center"><img src="docs/images/tree-view.png" alt="Tree View" width="600"></p>
205
+
206
+ - Search by typing, page with ←/→
207
+ - Filter modes (Ctrl+O): default → no-tools → user-only → labeled-only → all
208
+ - Press `l` to label entries as bookmarks
209
+
210
+ **`/fork`** - Create a new session file from the current branch. Opens a selector, copies history up to the selected point, and places that message in the editor for modification.
211
+
212
+ ### Compaction
213
+
214
+ Long sessions can exhaust context windows. Compaction summarizes older messages while keeping recent ones.
215
+
216
+ **Manual:** `/compact` or `/compact <custom instructions>`
217
+
218
+ **Automatic:** Enabled by default. Triggers on context overflow (recovers and retries) or when approaching the limit (proactive). Configure via `/settings` or `settings.json`.
219
+
220
+ Compaction is lossy. The full history remains in the JSONL file; use `/tree` to revisit. Customize compaction behavior via [extensions](#extensions). See [docs/compaction.md](docs/compaction.md) for internals.
221
+
222
+ ---
223
+
224
+ ## Settings
225
+
226
+ Use `/settings` to modify common options, or edit JSON files directly:
227
+
228
+ | Location | Scope |
229
+ |----------|-------|
230
+ | `~/.indusagi/agent/settings.json` | Global (all projects) |
231
+ | `.indusagi/settings.json` | Project (overrides global) |
232
+
233
+ See [docs/settings.md](docs/settings.md) for all options.
234
+
235
+ ---
236
+
237
+ ## Context Files
238
+
239
+ Indusagi loads `AGENTS.md` (or `CLAUDE.md`) at startup from:
240
+ - `~/.indusagi/agent/AGENTS.md` (global)
241
+ - Parent directories (walking up from cwd)
242
+ - Current directory
243
+
244
+ Use for project instructions, conventions, common commands. All matching files are concatenated.
245
+
246
+ ### System Prompt
247
+
248
+ Replace the default system prompt with `.indusagi/SYSTEM.md` (project) or `~/.indusagi/agent/SYSTEM.md` (global). Append without replacing via `APPEND_SYSTEM.md`.
249
+
250
+ ---
251
+
252
+ ## Customization
253
+
254
+ ### Prompt Templates
255
+
256
+ Reusable prompts as Markdown files. Type `/name` to expand.
257
+
258
+ ```markdown
259
+ <!-- ~/.indusagi/agent/prompts/review.md -->
260
+ Review this code for bugs, security issues, and performance problems.
261
+ Focus on: {{focus}}
262
+ ```
263
+
264
+ Place in `~/.indusagi/agent/prompts/`, `.indusagi/prompts/`, or a [indusagi package](#indusagi-packages) to share with others. See [docs/prompt-templates.md](docs/prompt-templates.md).
265
+
266
+ ### Skills
267
+
268
+ On-demand capability packages following the [Agent Skills standard](https://agentskills.io). Invoke via `/skill:name` or let the agent load them automatically.
269
+
270
+ ```markdown
271
+ <!-- ~/.indusagi/agent/skills/my-skill/SKILL.md -->
272
+ # My Skill
273
+ Use this skill when the user asks about X.
274
+
275
+ ## Steps
276
+ 1. Do this
277
+ 2. Then that
278
+ ```
279
+
280
+ Place in `~/.indusagi/agent/skills/`, `.indusagi/skills/`, or a [indusagi package](#indusagi-packages) to share with others. See [docs/skills.md](docs/skills.md).
281
+
282
+ ### Extensions
283
+
284
+ <p align="center"><img src="docs/images/doom-extension.png" alt="Doom Extension" width="600"></p>
285
+
286
+ TypeScript modules that extend indusagi with custom tools, commands, keyboard shortcuts, event handlers, and UI components.
287
+
288
+ ```typescript
289
+ export default function (indusagi: ExtensionAPI) {
290
+ indusagi.registerTool({ name: "deploy", ... });
291
+ indusagi.registerCommand("stats", { ... });
292
+ indusagi.on("tool_call", async (event, ctx) => { ... });
293
+ }
294
+ ```
295
+
296
+ **What's possible:**
297
+ - Custom tools (or replace built-in tools entirely)
298
+ - Sub-agents and plan mode
299
+ - Custom compaction and summarization
300
+ - Permission gates and path protection
301
+ - Custom editors and UI components
302
+ - Status lines, headers, footers
303
+ - Git checkpointing and auto-commit
304
+ - SSH and sandbox execution
305
+ - MCP server integration
306
+ - Make indusagi look like Claude Code
307
+ - Games while waiting (yes, Doom runs)
308
+ - ...anything you can dream up
309
+
310
+ Place in `~/.indusagi/agent/extensions/`, `.indusagi/extensions/`, or a [indusagi package](#indusagi-packages) to share with others. See [docs/extensions.md](docs/extensions.md) and [examples/extensions/](examples/extensions/).
311
+
312
+ ### Themes
313
+
314
+ Built-in: `dark`, `light`. Themes hot-reload: modify the active theme file and indusagi immediately applies changes.
315
+
316
+ Place in `~/.indusagi/agent/themes/`, `.indusagi/themes/`, or a [indusagi package](#indusagi-packages) to share with others. See [docs/themes.md](docs/themes.md).
317
+
318
+ ### Indusagi Packages
319
+
320
+ Bundle and share extensions, skills, prompts, and themes via npm or git. Find packages on [npmjs.com](https://www.npmjs.com/search?q=keywords%3Api-package) or [Discord](https://discord.com/channels/1456806362351669492/1457744485428629628).
321
+
322
+ > **Security:** Indusagi packages run with full system access. Extensions execute arbitrary code, and skills can instruct the model to perform any action including running executables. Review source code before installing third-party packages.
323
+
324
+ ```bash
325
+ indusagi install npm:@foo/indusagi-tools
326
+ indusagi install npm:@foo/indusagi-tools@1.2.3 # pinned version
327
+ indusagi install git:github.com/user/repo
328
+ indusagi install git:github.com/user/repo@v1 # tag or commit
329
+ indusagi install https://github.com/user/repo
330
+ indusagi remove npm:@foo/indusagi-tools
331
+ indusagi list
332
+ indusagi update # skips pinned packages
333
+ indusagi config # enable/disable extensions, skills, prompts, themes
334
+ ```
335
+
336
+ Packages install to `~/.indusagi/agent/git/` (git) or global npm. Use `-l` for project-local installs (`.indusagi/git/`, `.indusagi/npm/`).
337
+
338
+ Create a package by adding a `indusagi` key to `package.json`:
339
+
340
+ ```json
341
+ {
342
+ "name": "my-indusagi-package",
343
+ "keywords": ["indusagi-package"],
344
+ "indusagi": {
345
+ "extensions": ["./extensions"],
346
+ "skills": ["./skills"],
347
+ "prompts": ["./prompts"],
348
+ "themes": ["./themes"]
349
+ }
350
+ }
351
+ ```
352
+
353
+ Without a `indusagi` manifest, indusagi auto-discovers from conventional directories (`extensions/`, `skills/`, `prompts/`, `themes/`).
354
+
355
+ See [docs/packages.md](docs/packages.md).
356
+
357
+ ---
358
+
359
+ ## Programmatic Usage
360
+
361
+ ### SDK
362
+
363
+ ```typescript
364
+ import { AuthStorage, createAgentSession, ModelRegistry, SessionManager } from "indusagi-coding-agent";
365
+
366
+ const { session } = await createAgentSession({
367
+ sessionManager: SessionManager.inMemory(),
368
+ authStorage: new AuthStorage(),
369
+ modelRegistry: new ModelRegistry(authStorage),
370
+ });
371
+
372
+ await session.prompt("What files are in the current directory?");
373
+ ```
374
+
375
+ See [docs/sdk.md](docs/sdk.md) and [examples/sdk/](examples/sdk/).
376
+
377
+ ### RPC Mode
378
+
379
+ For non-Node.js integrations, use RPC mode over stdin/stdout:
380
+
381
+ ```bash
382
+ indusagi --mode rpc
383
+ ```
384
+
385
+ See [docs/rpc.md](docs/rpc.md) for the protocol.
386
+
387
+ ---
388
+
389
+ ## Philosophy
390
+
391
+ Indusagi is aggressively extensible so it doesn't have to dictate your workflow. Features that other tools bake in can be built with [extensions](#extensions), [skills](#skills), or installed from third-party [indusagi packages](#indusagi-packages). This keeps the core minimal while letting you shape indusagi to fit how you work.
392
+
393
+ **No MCP.** Build CLI tools with READMEs (see [Skills](#skills)), or build an extension that adds MCP support. [Why?](https://mariozechner.at/posts/2025-11-02-what-if-you-dont-need-mcp/)
394
+
395
+ **No sub-agents.** There's many ways to do this. Spawn indusagi instances via tmux, or build your own with [extensions](#extensions), or install a package that does it your way.
396
+
397
+ **No permission popups.** Run in a container, or build your own confirmation flow with [extensions](#extensions) inline with your environment and security requirements.
398
+
399
+ **No plan mode.** Write plans to files, or build it with [extensions](#extensions), or install a package.
400
+
401
+ **No built-in to-dos.** They confuse models. Use a TODO.md file, or build your own with [extensions](#extensions).
402
+
403
+ **No background bash.** Use tmux. Full observability, direct interaction.
404
+
405
+ Read the [blog post](https://mariozechner.at/posts/2025-11-30-indusagi-coding-agent/) for the full rationale.
406
+
407
+ ---
408
+
409
+ ## CLI Reference
410
+
411
+ ```bash
412
+ indusagi [options] [@files...] [messages...]
413
+ ```
414
+
415
+ ### Package Commands
416
+
417
+ ```bash
418
+ indusagi install <source> [-l] # Install package, -l for project-local
419
+ indusagi remove <source> [-l] # Remove package
420
+ indusagi update [source] # Update packages (skips pinned)
421
+ indusagi list # List installed packages
422
+ indusagi config # Enable/disable package resources
423
+ ```
424
+
425
+ ### Modes
426
+
427
+ | Flag | Description |
428
+ |------|-------------|
429
+ | (default) | Interactive mode |
430
+ | `-p`, `--print` | Print response and exit |
431
+ | `--mode json` | Output all events as JSON lines (see [docs/json.md](docs/json.md)) |
432
+ | `--mode rpc` | RPC mode for process integration (see [docs/rpc.md](docs/rpc.md)) |
433
+ | `--export <in> [out]` | Export session to HTML |
434
+
435
+ ### Model Options
436
+
437
+ | Option | Description |
438
+ |--------|-------------|
439
+ | `--provider <name>` | Provider (anthropic, openai, google, etc.) |
440
+ | `--model <id>` | Model ID |
441
+ | `--api-key <key>` | API key (overrides env vars) |
442
+ | `--thinking <level>` | `off`, `minimal`, `low`, `medium`, `high`, `xhigh` |
443
+ | `--models <patterns>` | Comma-separated patterns for Ctrl+P cycling |
444
+ | `--list-models [search]` | List available models |
445
+
446
+ ### Session Options
447
+
448
+ | Option | Description |
449
+ |--------|-------------|
450
+ | `-c`, `--continue` | Continue most recent session |
451
+ | `-r`, `--resume` | Browse and select session |
452
+ | `--session <path>` | Use specific session file or partial UUID |
453
+ | `--session-dir <dir>` | Custom session storage directory |
454
+ | `--no-session` | Ephemeral mode (don't save) |
455
+
456
+ ### Tool Options
457
+
458
+ | Option | Description |
459
+ |--------|-------------|
460
+ | `--tools <list>` | Enable specific built-in tools (default: `read,bash,edit,write`) |
461
+ | `--no-tools` | Disable all built-in tools (extension tools still work) |
462
+
463
+ Available built-in tools: `read`, `bash`, `edit`, `write`, `grep`, `find`, `ls`
464
+
465
+ ### Resource Options
466
+
467
+ | Option | Description |
468
+ |--------|-------------|
469
+ | `-e`, `--extension <source>` | Load extension from path, npm, or git (repeatable) |
470
+ | `--no-extensions` | Disable extension discovery |
471
+ | `--skill <path>` | Load skill (repeatable) |
472
+ | `--no-skills` | Disable skill discovery |
473
+ | `--prompt-template <path>` | Load prompt template (repeatable) |
474
+ | `--no-prompt-templates` | Disable prompt template discovery |
475
+ | `--theme <path>` | Load theme (repeatable) |
476
+ | `--no-themes` | Disable theme discovery |
477
+
478
+ Combine `--no-*` with explicit flags to load exactly what you need, ignoring settings.json (e.g., `--no-extensions -e ./my-ext.ts`).
479
+
480
+ ### Other Options
481
+
482
+ | Option | Description |
483
+ |--------|-------------|
484
+ | `--system-prompt <text>` | Replace default prompt (context files and skills still appended) |
485
+ | `--append-system-prompt <text>` | Append to system prompt |
486
+ | `--verbose` | Force verbose startup |
487
+ | `-h`, `--help` | Show help |
488
+ | `-v`, `--version` | Show version |
489
+
490
+ ### File Arguments
491
+
492
+ Prefix files with `@` to include in the message:
493
+
494
+ ```bash
495
+ indusagi @prompt.md "Answer this"
496
+ indusagi -p @screenshot.png "What's in this image?"
497
+ indusagi @code.ts @test.ts "Review these files"
498
+ ```
499
+
500
+ ### Examples
501
+
502
+ ```bash
503
+ # Interactive with initial prompt
504
+ indusagi "List all .ts files in src/"
505
+
506
+ # Non-interactive
507
+ indusagi -p "Summarize this codebase"
508
+
509
+ # Different model
510
+ indusagi --provider openai --model gpt-4o "Help me refactor"
511
+
512
+ # Limit model cycling
513
+ indusagi --models "claude-*,gpt-4o"
514
+
515
+ # Read-only mode
516
+ indusagi --tools read,grep,find,ls -p "Review the code"
517
+
518
+ # High thinking level
519
+ indusagi --thinking high "Solve this complex problem"
520
+ ```
521
+
522
+ ### Environment Variables
523
+
524
+ | Variable | Description |
525
+ |----------|-------------|
526
+ | `INDUSAGI_CODING_AGENT_DIR` | Override config directory (default: `~/.indusagi/agent`) |
527
+ | `INDUSAGI_SKIP_VERSION_CHECK` | Skip version check at startup |
528
+ | `VISUAL`, `EDITOR` | External editor for Ctrl+G |
529
+
530
+ ---
531
+
532
+ ## Contributing & Development
533
+
534
+ See [CONTRIBUTING.md](../../CONTRIBUTING.md) for guidelines and [docs/development.md](docs/development.md) for setup, forking, and debugging.
535
+
536
+ ---
537
+
538
+ ## License
539
+
540
+ MIT
541
+
542
+ ## See Also
543
+
544
+ - [indusagi-ai](https://www.npmjs.com/package/indusagi-ai): Core LLM toolkit
545
+ - [@mariozechner/indusagi-agent](https://www.npmjs.com/package/@mariozechner/indusagi-agent): Agent framework
546
+ - [indusagi-tui](https://www.npmjs.com/package/indusagi-tui): Terminal UI components