chivgent 1.0.1 → 1.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 (160) hide show
  1. package/README.md +115 -131
  2. package/README.zh-CN.md +103 -817
  3. package/dist/agent.d.ts +16 -1
  4. package/dist/agent.d.ts.map +1 -1
  5. package/dist/agent.js +95 -43
  6. package/dist/agent.js.map +1 -1
  7. package/dist/auth/oauth.d.ts +51 -0
  8. package/dist/auth/oauth.d.ts.map +1 -0
  9. package/dist/auth/oauth.js +444 -0
  10. package/dist/auth/oauth.js.map +1 -0
  11. package/dist/cli-options.d.ts +11 -6
  12. package/dist/cli-options.d.ts.map +1 -1
  13. package/dist/cli-options.js +46 -4
  14. package/dist/cli-options.js.map +1 -1
  15. package/dist/cli-runtime.d.ts +9 -0
  16. package/dist/cli-runtime.d.ts.map +1 -1
  17. package/dist/cli-runtime.js +32 -6
  18. package/dist/cli-runtime.js.map +1 -1
  19. package/dist/cli.d.ts +1 -1
  20. package/dist/cli.d.ts.map +1 -1
  21. package/dist/cli.js +129 -34
  22. package/dist/cli.js.map +1 -1
  23. package/dist/context/context-manager.d.ts +21 -0
  24. package/dist/context/context-manager.d.ts.map +1 -1
  25. package/dist/context/context-manager.js +199 -35
  26. package/dist/context/context-manager.js.map +1 -1
  27. package/dist/evals/tools.d.ts.map +1 -1
  28. package/dist/evals/tools.js +4 -2
  29. package/dist/evals/tools.js.map +1 -1
  30. package/dist/events.d.ts +5 -0
  31. package/dist/events.d.ts.map +1 -1
  32. package/dist/events.js.map +1 -1
  33. package/dist/permissions.d.ts +45 -0
  34. package/dist/permissions.d.ts.map +1 -0
  35. package/dist/permissions.js +97 -0
  36. package/dist/permissions.js.map +1 -0
  37. package/dist/prompts.d.ts +1 -1
  38. package/dist/prompts.d.ts.map +1 -1
  39. package/dist/prompts.js +1 -0
  40. package/dist/prompts.js.map +1 -1
  41. package/dist/providers/client.d.ts +1 -1
  42. package/dist/providers/client.d.ts.map +1 -1
  43. package/dist/providers/client.js +19 -1
  44. package/dist/providers/client.js.map +1 -1
  45. package/dist/providers/definitions.d.ts +2 -0
  46. package/dist/providers/definitions.d.ts.map +1 -1
  47. package/dist/providers/definitions.js +3 -1
  48. package/dist/providers/definitions.js.map +1 -1
  49. package/dist/providers/interactive.d.ts +4 -0
  50. package/dist/providers/interactive.d.ts.map +1 -1
  51. package/dist/providers/interactive.js +86 -2
  52. package/dist/providers/interactive.js.map +1 -1
  53. package/dist/providers/oauth-client.d.ts +14 -0
  54. package/dist/providers/oauth-client.d.ts.map +1 -0
  55. package/dist/providers/oauth-client.js +52 -0
  56. package/dist/providers/oauth-client.js.map +1 -0
  57. package/dist/providers/openai-compatible-chat.d.ts +1 -0
  58. package/dist/providers/openai-compatible-chat.d.ts.map +1 -1
  59. package/dist/providers/openai-compatible-chat.js +1 -0
  60. package/dist/providers/openai-compatible-chat.js.map +1 -1
  61. package/dist/providers/openai.d.ts +3 -0
  62. package/dist/providers/openai.d.ts.map +1 -1
  63. package/dist/providers/openai.js +72 -10
  64. package/dist/providers/openai.js.map +1 -1
  65. package/dist/remote/repl.d.ts.map +1 -1
  66. package/dist/remote/repl.js +9 -0
  67. package/dist/remote/repl.js.map +1 -1
  68. package/dist/repl.d.ts +43 -1
  69. package/dist/repl.d.ts.map +1 -1
  70. package/dist/repl.js +303 -21
  71. package/dist/repl.js.map +1 -1
  72. package/dist/runtime/desktop-runtime.d.ts +23 -0
  73. package/dist/runtime/desktop-runtime.d.ts.map +1 -0
  74. package/dist/runtime/desktop-runtime.js +63 -0
  75. package/dist/runtime/desktop-runtime.js.map +1 -0
  76. package/dist/session-store.d.ts +22 -1
  77. package/dist/session-store.d.ts.map +1 -1
  78. package/dist/session-store.js +80 -1
  79. package/dist/session-store.js.map +1 -1
  80. package/dist/session.d.ts +21 -0
  81. package/dist/session.d.ts.map +1 -1
  82. package/dist/session.js +110 -4
  83. package/dist/session.js.map +1 -1
  84. package/dist/shell/approval.d.ts +2 -2
  85. package/dist/shell/approval.d.ts.map +1 -1
  86. package/dist/shell/approval.js +2 -2
  87. package/dist/shell/approval.js.map +1 -1
  88. package/dist/shell/docker.d.ts +2 -0
  89. package/dist/shell/docker.d.ts.map +1 -1
  90. package/dist/shell/docker.js +17 -3
  91. package/dist/shell/docker.js.map +1 -1
  92. package/dist/shell/factory.d.ts +9 -0
  93. package/dist/shell/factory.d.ts.map +1 -0
  94. package/dist/shell/factory.js +13 -0
  95. package/dist/shell/factory.js.map +1 -0
  96. package/dist/shell/local.d.ts +4 -0
  97. package/dist/shell/local.d.ts.map +1 -1
  98. package/dist/shell/local.js +16 -1
  99. package/dist/shell/local.js.map +1 -1
  100. package/dist/shell/native.d.ts +15 -0
  101. package/dist/shell/native.d.ts.map +1 -0
  102. package/dist/shell/native.js +99 -0
  103. package/dist/shell/native.js.map +1 -0
  104. package/dist/shell/types.d.ts +1 -0
  105. package/dist/shell/types.d.ts.map +1 -1
  106. package/dist/tools/bash.d.ts +19 -0
  107. package/dist/tools/bash.d.ts.map +1 -1
  108. package/dist/tools/bash.js +30 -11
  109. package/dist/tools/bash.js.map +1 -1
  110. package/dist/tools/edit-file.d.ts.map +1 -1
  111. package/dist/tools/edit-file.js +1 -1
  112. package/dist/tools/edit-file.js.map +1 -1
  113. package/dist/tools/parallel.d.ts +2 -0
  114. package/dist/tools/parallel.d.ts.map +1 -1
  115. package/dist/tools/parallel.js +8 -0
  116. package/dist/tools/parallel.js.map +1 -1
  117. package/dist/tools/write-file.d.ts.map +1 -1
  118. package/dist/tools/write-file.js +1 -1
  119. package/dist/tools/write-file.js.map +1 -1
  120. package/dist/transcript-hash.d.ts +4 -0
  121. package/dist/transcript-hash.d.ts.map +1 -0
  122. package/dist/transcript-hash.js +6 -0
  123. package/dist/transcript-hash.js.map +1 -0
  124. package/dist/tui/activity.d.ts +1 -1
  125. package/dist/tui/activity.d.ts.map +1 -1
  126. package/dist/tui/activity.js +2 -2
  127. package/dist/tui/activity.js.map +1 -1
  128. package/dist/tui/editor-input.d.ts +8 -0
  129. package/dist/tui/editor-input.d.ts.map +1 -1
  130. package/dist/tui/editor-input.js +122 -18
  131. package/dist/tui/editor-input.js.map +1 -1
  132. package/dist/tui/editor.d.ts +11 -1
  133. package/dist/tui/editor.d.ts.map +1 -1
  134. package/dist/tui/editor.js +77 -29
  135. package/dist/tui/editor.js.map +1 -1
  136. package/dist/tui/live.d.ts +2 -0
  137. package/dist/tui/live.d.ts.map +1 -1
  138. package/dist/tui/live.js +5 -0
  139. package/dist/tui/live.js.map +1 -1
  140. package/dist/tui/selection.d.ts +24 -0
  141. package/dist/tui/selection.d.ts.map +1 -0
  142. package/dist/tui/selection.js +19 -0
  143. package/dist/tui/selection.js.map +1 -0
  144. package/dist/tui/slash.js +1 -1
  145. package/dist/tui/slash.js.map +1 -1
  146. package/dist/tui/welcome.d.ts +2 -2
  147. package/dist/tui/welcome.d.ts.map +1 -1
  148. package/dist/tui/welcome.js +14 -23
  149. package/dist/tui/welcome.js.map +1 -1
  150. package/dist/workspace/paths.d.ts.map +1 -1
  151. package/dist/workspace/paths.js +4 -0
  152. package/dist/workspace/paths.js.map +1 -1
  153. package/dist/workspace/types.d.ts +2 -2
  154. package/dist/workspace/types.d.ts.map +1 -1
  155. package/dist/workspace/types.js.map +1 -1
  156. package/dist/workspace.d.ts +2 -2
  157. package/dist/workspace.d.ts.map +1 -1
  158. package/dist/workspace.js +2 -2
  159. package/dist/workspace.js.map +1 -1
  160. package/package.json +6 -2
package/README.md CHANGED
@@ -1,170 +1,161 @@
1
1
  <p align="center">
2
- <picture>
3
- <source media="(prefers-color-scheme: dark)" srcset="docs/assets/chivgent-banner-dark.svg">
4
- <img src="docs/assets/chivgent-banner-light.svg" alt="chivgent: terminal coding agent. Read-only by default, Docker shell, OpenAI-compatible." width="100%">
5
- </picture>
2
+ <img src="docs/assets/chivgent-leaf-mark.png" width="88" alt="">
6
3
  </p>
7
4
 
5
+ <div align="center">
6
+
8
7
  # chivgent
9
8
 
10
- [English](README.md) | [简体中文](README.zh-CN.md)
9
+ ### A coding agent in your terminal.
10
+
11
+ The same category as Claude Code and Codex. You bring the model.
12
+
13
+ [![npm](https://img.shields.io/npm/v/chivgent?color=111111)](https://www.npmjs.com/package/chivgent)
14
+ [![CI](https://img.shields.io/github/actions/workflow/status/chivopic/chivgent/ci.yml?label=CI&color=111111)](https://github.com/chivopic/chivgent/actions/workflows/ci.yml)
15
+ ![Node.js >=22](https://img.shields.io/badge/Node.js-%3E%3D22-111111)
16
+ [![License](https://img.shields.io/badge/license-MIT-111111)](LICENSE)
11
17
 
12
- [![npm](https://img.shields.io/npm/v/chivgent)](https://www.npmjs.com/package/chivgent)
13
- [![CI](https://github.com/chivopic/chivgent/actions/workflows/ci.yml/badge.svg)](https://github.com/chivopic/chivgent/actions/workflows/ci.yml)
14
- ![Node.js >=22](https://img.shields.io/badge/Node.js-%3E%3D22-339933?logo=nodedotjs&logoColor=white)
18
+ **[Website ↗](https://chivgent-web.vercel.app/)** · [Architecture](docs/architecture.md) · [Shell](docs/shell-sandbox.md) · [Sign in](docs/subscription-oauth.md) · **English** · [简体中文](README.zh-CN.md)
15
19
 
16
- chivgent is a terminal coding agent you can read end to end. It asks an LLM
17
- (OpenAI, DeepSeek, or any OpenAI-compatible endpoint) about the project in your
18
- current directory, using read-only file tools by default. Writes and shell
19
- commands are separate opt-in flags, and shell commands run in an offline Docker
20
- container with per-command approval.
20
+ </div>
21
21
 
22
- It is small on purpose: a TypeScript CLI with four runtime dependencies, where
23
- the agent loop, Provider adapters, context compaction, and tool sandboxing are
24
- each a few hundred lines you can study.
22
+ chivgent is a local agent for the directory you have open. The category is the one [Claude Code](https://code.claude.com) and [Codex](https://github.com/openai/codex) occupy: read the project, change it, run it, and come back to the session. The model is yours. An API key, or a ChatGPT or xAI subscription.
25
23
 
26
- **Use it if** you want a coding agent whose every mechanism you can inspect and
27
- change, or a reference implementation for building your own.
28
- **Look elsewhere if** you want the most capable agent for daily work, a hosted
29
- product, a fine-grained permission system, or native Windows shell support.
24
+ The default that category expects is auto mode. Ordinary reads, workspace edits, and sandboxed commands proceed. The agent stops when an action leaves the workspace, or when a command needs the host. Here that policy is `workspace`. It is not a second model reviewing each action, and it is not a bypass. Local interactive rich-TUI sessions start in Ask for me unless a permission mode or legacy capability flag was selected; file changes and commands require approval. Shift+Tab cycles through Plan, Auto mode, and Ask for me. Headless, simple, and remote starts keep their existing defaults.
30
25
 
31
- ## Quick start
26
+ ## Getting started
32
27
 
33
- You need Node.js 22 or newer and an API key for one Provider.
28
+ You need Node.js 22 or newer.
34
29
 
35
30
  ```bash
36
31
  npm install -g chivgent
37
- chivgent --version
38
32
  ```
39
33
 
40
- This prints the installed version, such as `1.0.0`. Then, from the project you want to ask
41
- about:
34
+ Or, on macOS/Linux, use the [official website installer](https://chivgent-web.vercel.app/install.sh). It still requires Node.js 22+ and npm; it installs the same npm package, without using `sudo` or changing your shell configuration.
42
35
 
43
36
  ```bash
44
- export OPENAI_API_KEY="your-api-key"
45
- chivgent "What does this project do, and where is its entry point?"
37
+ curl -fsSL https://chivgent-web.vercel.app/install.sh | bash
46
38
  ```
47
39
 
48
- The answer streams to stdout. Tool activity (`list_files`, `search_text`,
49
- `read_file`) is shown on stderr. Nothing in the project is changed.
40
+ This runs a script from the Internet. To inspect it first, download it with `curl -fsSLo install.sh https://chivgent-web.vercel.app/install.sh`, read it, then run `bash install.sh`. If npm's global bin directory is missing from PATH, the installer shows the directory to add.
41
+
50
42
 
51
- Prefer DeepSeek or another Provider? Swap the key and add `--provider`:
43
+ Already installed? `chivgent update --check`, then `chivgent update`.
44
+
45
+ Start it in the project.
52
46
 
53
47
  ```bash
54
- export DEEPSEEK_API_KEY="your-api-key"
55
- chivgent --provider deepseek "Explain the architecture in src/"
48
+ cd /path/to/project
49
+ chivgent
56
50
  ```
57
51
 
58
- Run `chivgent` with no question for an interactive session. If no key is set,
59
- the session still starts: type `/provider`, pick one, and enter its key when
60
- asked. Keys are saved owner-only in `~/.chivgent/auth.json`.
52
+ No key is required to open the session. Type `/provider` and enter one when asked, or export one first. Keys are saved for your user only, in `~/.chivgent/auth.json`.
61
53
 
62
- **Try it without a key or network:** from a source checkout, `npm run demo:tui`
63
- runs the TUI against a stub Provider and does not touch the workspace.
54
+ ```bash
55
+ export OPENAI_API_KEY="your-api-key"
56
+ ```
64
57
 
65
- ## What it can do, and what it needs from you
58
+ In a session, `/login oauth openai` or `/login oauth xai` signs in with a subscription. On a normal start, a key still takes precedence. [Subscription sign-in](docs/subscription-oauth.md).
66
59
 
67
- | Capability | Flag | What it can touch |
60
+ ```bash
61
+ chivgent "Where is the entry point?" # reads, then answers
62
+ chivgent --permission-mode workspace "Run tests and fix them"
63
+ chivgent --permission-mode ask-first "Review this project"
64
+ chivgent --allow-writes "Rename sayHi to greet" # older flag, not with a mode
65
+ chivgent --allow-shell "Run the tests" # asks, then Seatbelt or Docker
66
+ chivgent --provider deepseek "Explain src/"
67
+ chivgent # rich TUI in a local interactive terminal
68
+ chivgent --simple # append-only interface
69
+ chivgent --tui # explicitly request the rich TUI
70
+ chivgent --continue # last session in this directory
71
+ ```
72
+
73
+ ## Modes
74
+
75
+ | Mode | What proceeds | This build |
68
76
  | --- | --- | --- |
69
- | Discover, search, and read files | default | The current directory only. `.gitignore`d, generated, and credential paths (such as `.env`, `id_rsa`) are skipped. |
70
- | Create and edit files (`write_file`, `edit_file`, `apply_patch`) | `--allow-writes` | Files inside the workspace. Edits are exact-match and atomic. |
71
- | Run shell commands (`bash`) | `--allow-shell` | A fresh `node:22-alpine` Docker container with no network, the workspace mounted at `/workspace`, and no API keys. Each command needs a `y` to run. Docker is required; there is no fallback to the host. |
72
- | Load project extensions | trust prompt on first run | Anything you can: extensions are in-process JavaScript. |
77
+ | `workspace` | Workspace edits and sandboxed commands. Network stays off. A command that needs the host asks once, for that command only. | Auto mode in the TUI cycle, or `--permission-mode workspace`. |
78
+ | `ask-first` | Reads. Each file change and each command asks. No answer means no action. | Ordinary local rich-TUI start, or `--permission-mode ask-first`. |
79
+ | `unrestricted` | Shell commands run with broad host file access and network, inside the OS sandbox. File tools stay in the workspace. | Explicit opt-in. |
80
+ | none | Reads. Writes and shell wait for a flag. Commands need interactive approval or explicit approval-all. | `--simple`, headless, and remote starts unless a mode or legacy flag is selected. |
81
+
82
+ `--permission-mode` replaces the flags for this process. It cannot be combined with `--allow-writes`, `--allow-shell`, `--approve-all-shell`, or `--shell-network`, and it cannot be used with `--serve` or `--connect`. `/permissions` inspects or changes the mode, only in a session that started with one. The choice is not saved in the transcript. Resuming a session uses the mode you selected at startup, not a broader one from last time.
83
+
84
+ `/plan` is separate. It keeps the agent on read tools and a plan. Writes, shell, and extension tools stay blocked even if the model asks for them.
85
+
86
+ ## How it fits together
87
+
88
+ You type in the terminal. chivgent calls the provider you picked. File tools stay inside the current directory. The shell runs in a sandbox and does not receive your provider keys. On the default start, the shell is off until you turn it on.
73
89
 
74
- Costs: chivgent calls the Provider you choose with your key, so you pay that
75
- Provider's normal token prices. It reports token counts per turn and per
76
- session (`/session`) but never converts them to money.
90
+ <picture>
91
+ <source media="(prefers-color-scheme: dark)" srcset="docs/assets/fit-dark.svg">
92
+ <img src="docs/assets/fit-light.svg" width="920" alt="The default start: you, chivgent, the provider you picked, this directory, and a sandbox only if shell is on.">
93
+ </picture>
94
+
95
+ ## What it can touch
96
+
97
+ This is the build, not the auto-style default above.
98
+
99
+ | | How | What it can reach |
100
+ | --- | --- | --- |
101
+ | Read the project | on | This directory. Ignored, generated, and credential paths are skipped. |
102
+ | Change files | `--allow-writes` | Files inside the workspace. An edit has to match exactly, and it is written atomically. |
103
+ | Run a command | `--allow-shell` | Seatbelt on macOS, Docker elsewhere. Network is off. Each command requires confirmation. |
104
+ | Pick a policy | `--permission-mode` | `ask-first`, `workspace`, or `unrestricted`. Replaces the flags for this process. |
105
+
106
+ You pay the provider you picked, at their prices. chivgent shows token counts; it does not convert them into costs.
77
107
 
78
108
  ## Providers
79
109
 
80
- | Provider | `--provider` | API key variable | Default model |
110
+ | Provider | `--provider` | Key | Model |
81
111
  | --- | --- | --- | --- |
82
- | OpenAI (Responses API) | `openai` (default) | `OPENAI_API_KEY` | `gpt-5.6` |
112
+ | OpenAI, Responses API | `openai` (default) | `OPENAI_API_KEY` | `gpt-5.6` |
83
113
  | DeepSeek | `deepseek` | `DEEPSEEK_API_KEY` | `deepseek-v4-flash` |
84
- | Any OpenAI-compatible endpoint | `openai-compatible` | `OPENAI_API_KEY` + `OPENAI_BASE_URL` | set `OPENAI_MODEL` |
114
+ | Any compatible endpoint | `openai-compatible` | `OPENAI_API_KEY` and `OPENAI_BASE_URL` | set `OPENAI_MODEL` |
85
115
  | OpenRouter | `openrouter` | `OPENROUTER_API_KEY` | set `OPENROUTER_MODEL` |
86
116
  | Groq | `groq` | `GROQ_API_KEY` | set `GROQ_MODEL` |
87
117
  | xAI | `xai` | `XAI_API_KEY` | set `XAI_MODEL` |
88
118
  | Moonshot | `moonshot` | `MOONSHOT_API_KEY` | set `MOONSHOT_MODEL` |
89
119
 
90
- `--model` overrides the model variable. Keys resolve in this order: `--api-key`,
91
- then the environment variable, then `~/.chivgent/auth.json` (literal keys only;
92
- no `$VAR` expansion or command substitution). A custom `OPENAI_BASE_URL`
93
- receives your key and prompts, so point it only at endpoints you trust.
120
+ `--model` overrides the model variable. Keys resolve in this order: `--api-key`, then the environment variable, then `~/.chivgent/auth.json`. A custom base URL receives your key and your prompts. Point it only at an endpoint you trust.
94
121
 
95
- Compatible endpoints must implement `POST /chat/completions` with function tool
96
- calling. Changing only the base URL does not guarantee full compatibility; see
97
- [architecture](docs/architecture.md#openai-compatible-providers).
122
+ A compatible endpoint must implement `POST /chat/completions` with tool calling. Changing the base URL does not guarantee full compatibility. [Architecture](docs/architecture.md#openai-compatible-providers).
98
123
 
99
- ## Everyday use
124
+ ## A session you can come back to
100
125
 
101
- ```bash
102
- chivgent # interactive session
103
- chivgent --continue # resume the latest session here
104
- chivgent --allow-writes "Rename sayHi to greet everywhere"
105
- chivgent --allow-shell "Run the tests and explain the failure"
106
- chivgent --json "List the CLI flags" > run.jsonl # machine-readable events
107
- ```
126
+ Run `chivgent` with no question for an interactive session. It is saved under `~/.chivgent/sessions`. `--continue` resumes the latest one in this directory. `/resume` lists the others, and only opens sessions from here.
127
+
128
+ `/compact` summarizes older turns and keeps the full transcript to resume later. `/status` shows the model, the permissions, and token usage. `/help` lists the rest.
108
129
 
109
- - **Interactive sessions** keep history across prompts and are saved as JSON
110
- lines under `~/.chivgent/sessions` (`--no-session` to skip). `/help` lists
111
- slash commands such as `/provider`, `/model`, `/login`, `/session`, `/diff`,
112
- and `/exit`. Ctrl+C stops a running answer; at an idle prompt it exits.
113
- - **`--tui`** adds a live status region and a multi-line editor with history,
114
- an inline `/` command menu, and `/gitdiff` review. See the
115
- [TUI guide](docs/tui-v5.md).
116
- - **Long sessions** stay inside the context window: older turns are summarised,
117
- while the list of files read and changed is kept from the tool calls
118
- themselves. See [architecture](docs/architecture.md#context-management).
119
- - **Exit codes:** `0` answered, `1` configuration or Provider failure, `2` turn
120
- limit reached, `130` interrupted.
121
- - **Updating:** `chivgent update --check`, then `chivgent update`. See
122
- [updating](docs/updating.md).
123
-
124
- `chivgent --help` prints every flag.
125
-
126
- ## Security model
127
-
128
- chivgent states its boundaries rather than pretending to enforce fine-grained
129
- ones. Capabilities are coarse, session-level switches.
130
-
131
- - File tools reject paths outside the workspace, including `..` traversal and
132
- symlink escapes, and deny common credential and private-key paths. Tool output
133
- is capped at 64 KiB.
134
- - `--allow-shell` runs each command in a new offline container (dropped
135
- capabilities, read-only root, non-root user, resource limits) and asks before
136
- each one. Headless and served sessions deny commands unless you also pass
137
- `--approve-all-shell`. Inside the container, commands can still change or
138
- delete anything in the mounted project, and Docker is not proof against
139
- kernel or VM escapes. Details: [shell sandbox](docs/shell-sandbox.md).
140
- - Writes and trusted extensions are **not** inside the container. Trusting a
141
- project's extensions means letting its authors run code as you, so chivgent
142
- asks once per directory and never loads them when there is no terminal to ask.
143
- - `auth.json`, session logs, and `trust.json` are written owner-only but in
144
- plain text. Session logs contain prompts, answers, and file excerpts.
145
- - `--serve` exposes a session on a Unix socket in an owner-only directory.
146
- Anyone who can open the socket gets every capability the server started with.
147
- There is no TCP listener; use SSH forwarding for another machine.
148
-
149
- Work on committed code, and use a disposable copy for repositories you don't
150
- trust.
151
-
152
- ## Going deeper
153
-
154
- - [Architecture](docs/architecture.md): agent loop, runtime events, context
155
- compaction, Provider adapters, the TUI live region, and the source layout.
156
- - [Evals and token usage](docs/evals.md): ten deterministic task suites that
157
- measure pass rates over repeated attempts, separate from the free, offline
158
- unit tests.
159
- - [Extensions and remote sessions](docs/extensions-and-remote.md): adding
160
- tools and slash commands, project trust, and attaching several terminals to
161
- one session.
162
- - [Patch format](docs/apply-patch.md), [scoped `AGENTS.md`](docs/scoped-agents-md.md),
163
- [parallel read tools](docs/parallel-read-tools.md),
164
- [plan tracking](docs/agent-plan-progress.md).
165
- - Design notes for each build stage, from
166
- [stage 1](docs/stage-1-minimal-agent.md) to [stage 14](docs/stage-14-tui.md),
167
- and the [release process](docs/releasing.md).
130
+ Local interactive terminals use the rich TUI by default. `--simple` selects the append-only interface; `--tui` remains available to request the rich TUI explicitly, including when stdout is redirected. Piped input or output, JSON, one-shot runs, `--serve`, and `--connect` keep their existing simple output. `TERM=dumb` selects the simple interface; `NO_COLOR` keeps the rich TUI and disables color. Without legacy capability flags or an explicit permission mode, rich TUI sessions start in Ask for me. Shift+Tab at the idle inline prompt cycles Plan → Auto mode → Ask for me; the footer shows the current mode. The compact welcome omits the session ID; use `/session` or `/status` for full session details. `/help` lists commands and keyboard controls. Explicit `--permission-mode` choices and legacy capability flags retain their behavior. [TUI](docs/tui.md). A long session stays within the context window by summarizing older turns and keeping the list of files read and changed. [Context](docs/architecture.md#context-management).
131
+
132
+ In its inline editor, type `/` to browse registered commands or keep typing to filter them. Use ↑/↓ to choose a command, then Tab or Enter to fill it into the draft; submit it with Enter afterward. A mouse click fills a visible command, and the wheel browses the menu. Esc closes the menu and keeps the draft. Fully typed commands still run with one Enter.
133
+
134
+ ## Boundaries
135
+
136
+ - Paths outside the workspace are rejected, including `..` and symlink escapes. Common credential paths are denied. Tool output is capped.
137
+ - Without a mode or legacy flag, `--simple`, headless, and remote starts retain the read-only default. A local rich-TUI start selects `ask-first` for that process unless a legacy capability flag was given. `--allow-shell` needs interactive approval; non-interactive commands are denied unless `--approve-all-shell` was set. A served session denies commands unless you also pass `--approve-all-shell`. If the sandbox cannot start, the command does not run unsandboxed.
138
+ - `workspace` runs workspace edits and sandboxed commands on its own, and asks once when a command wants host file and network access. `unrestricted` is the explicit opt-in for broad host access and network. Neither is saved with the session. [Shell safety](docs/shell-sandbox.md).
139
+ - The macOS sandbox can still read files your user can read. It restricts writes and network access. It is not confidentiality isolation.
140
+ - There is no per-command allowlist, and no native Windows shell. `workspace` is not the start mode of this build.
141
+ - Extensions are JavaScript in the chivgent process. Trusting a project means letting its authors run code as you. chivgent prompts once per directory, and does not load extensions when there is no terminal to prompt.
142
+ - Keys, subscription credentials, and session logs are owner-only and stored in plain text. Logs contain prompts, answers, and file excerpts.
143
+ - `--serve` puts the session on a Unix socket in an owner-only directory. Anyone who can open the socket gets every capability the server started with. There is no TCP listener.
144
+
145
+ Work on committed code. Use a copy for a repository you do not trust.
146
+
147
+ This repository also has an Electron desktop app. It opens a project through the native folder picker and runs the same Agent with read-only project tools and a configured Provider. API keys are read from the environment or CLI `auth.json`; the desktop does not store them. Desktop does **not** read `oauth.json` or refresh subscription OAuth tokens. If you signed in using only `/login oauth`, configure an API key before using Desktop. When choosing an OpenAI-compatible Provider, verify the displayed endpoint before sending project content. Only one in-memory conversation is available, with no history or restart recovery. For the offline demo, set `CHIVGENT_DESKTOP_DEMO=1`. Build and run the app with `npm run desktop:dev`; offline real-adapter verification uses `npm run desktop:build && node apps/desktop/scripts/verify-readonly.mjs`. [Desktop behavior and limits](docs/desktop-architecture.md).
148
+
149
+ ## Documentation
150
+
151
+ | | |
152
+ | --- | --- |
153
+ | [Architecture](docs/architecture.md) | The loop, providers, context, and where the source lives |
154
+ | [Shell safety](docs/shell-sandbox.md) | Seatbelt, Docker, and what a command can still read |
155
+ | [Subscription sign-in](docs/subscription-oauth.md) | ChatGPT and xAI: what is stored, and what a key still does |
156
+ | [TUI](docs/tui.md) | The live region, the editor, and diff review |
157
+ | [Evals](docs/evals.md) | Whether the agent finishes the task, separate from the unit tests |
158
+ | [Extensions and remote sessions](docs/extensions-and-remote.md) | Tools you add, and attaching another terminal |
168
159
 
169
160
  ## Development
170
161
 
@@ -172,17 +163,10 @@ trust.
172
163
  git clone https://github.com/chivopic/chivgent.git
173
164
  cd chivgent
174
165
  npm install
175
- npm run check
176
166
  npm test
177
- npm run build
178
167
  ```
179
168
 
180
- Tests use scripted LLM clients and never spend API credits.
181
- `npm run release:check` runs the full gate, including an `npm pack` dry run.
182
- To try the checkout as a global command: `npm install -g .`
183
-
184
- Issues and focused pull requests are welcome. Keep Provider-specific types in
185
- `src/providers/` so the agent runtime stays independent of vendor SDKs.
169
+ Tests use scripted model clients and do not spend API credits. Issues and focused pull requests are welcome. Keep provider-specific types in `src/providers/`, so the agent does not depend on a vendor SDK.
186
170
 
187
171
  ## License
188
172