@cjhyy/code-shell 0.1.5 → 0.1.6

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 (48) hide show
  1. package/CHANGELOG.md +30 -0
  2. package/dist/arena/index.cjs +4 -4
  3. package/dist/arena/index.js +3 -3
  4. package/dist/{arena-O2L4TN6A.js → arena-2LTLIXOL.js} +3 -3
  5. package/dist/{arena-KBQOPLFV.cjs → arena-ADB7DRFI.cjs} +17 -17
  6. package/dist/{chunk-XDIQWQJ4.js → chunk-3QO25N6E.js} +2 -2
  7. package/dist/{chunk-5ECBT4YA.js → chunk-3SBSUOWZ.js} +0 -3
  8. package/dist/{chunk-YUI524OE.cjs → chunk-7BI3V74Y.cjs} +0 -3
  9. package/dist/{chunk-2EP3CLEN.js → chunk-7QIM3BKD.js} +1 -1
  10. package/dist/{chunk-YJ77GQK5.js → chunk-ABRRONJ7.js} +1 -1
  11. package/dist/{chunk-C5YQBIRK.js → chunk-BZ5TNE7L.js} +1 -1
  12. package/dist/{chunk-VYL4EFRC.cjs → chunk-DDB6QOKJ.cjs} +7 -7
  13. package/dist/{chunk-SNT563K3.cjs → chunk-ILHE7XLT.cjs} +6 -6
  14. package/dist/{chunk-76W334S4.js → chunk-KAQHULYN.js} +1 -1
  15. package/dist/{chunk-W22P377T.js → chunk-KE4EQOWA.js} +6 -11
  16. package/dist/{chunk-R47ROHGL.cjs → chunk-MV7YI4WO.cjs} +6 -11
  17. package/dist/{chunk-7K6SDRRF.js → chunk-PKGRTCCY.js} +54 -9
  18. package/dist/{chunk-RMYKO74M.js → chunk-QARL3IDQ.js} +1 -1
  19. package/dist/{chunk-A5LCRPDP.cjs → chunk-S754JHLR.cjs} +2 -2
  20. package/dist/{chunk-HS2MFNUC.cjs → chunk-TNLGBJYS.cjs} +3 -3
  21. package/dist/{chunk-BUU5PZK2.cjs → chunk-UXOCVJJ6.cjs} +200 -156
  22. package/dist/{chunk-BWTOS5BH.cjs → chunk-WZJV6DJC.cjs} +4 -4
  23. package/dist/{chunk-QRM7IF2S.cjs → chunk-YKIAELDZ.cjs} +2 -2
  24. package/dist/cli/main.cjs +211 -188
  25. package/dist/cli/main.js +44 -21
  26. package/dist/cli/updater.d.ts +8 -0
  27. package/dist/engine/engine.d.ts +7 -0
  28. package/dist/index.cjs +8 -8
  29. package/dist/index.js +9 -9
  30. package/dist/{manager-C2IUXKRC.js → manager-D65VFAPX.js} +1 -1
  31. package/dist/manager-TTF5VHJC.cjs +7 -0
  32. package/dist/{openrouter-models-TGKDKY52.js → openrouter-models-H56GHBHN.js} +1 -1
  33. package/dist/openrouter-models-TWUFWZ5T.cjs +15 -0
  34. package/dist/openrouter-sync-5VMGN6C2.cjs +11 -0
  35. package/dist/{openrouter-sync-UXUSJCIR.js → openrouter-sync-ALEMF5IU.js} +2 -2
  36. package/dist/product/index.cjs +7 -7
  37. package/dist/product/index.js +6 -6
  38. package/dist/run/index.cjs +7 -7
  39. package/dist/run/index.js +6 -6
  40. package/dist/tool-system/investigation-guard.d.ts +9 -0
  41. package/dist/updater-I7QBW4DP.cjs +17 -0
  42. package/dist/{updater-VFUAHCVY.js → updater-NVME5S3Z.js} +1 -1
  43. package/package.json +2 -1
  44. package/skills-builtin/codeshell-help.md +135 -0
  45. package/dist/manager-YYKWYTRM.cjs +0 -7
  46. package/dist/openrouter-models-OU4GRZQY.cjs +0 -15
  47. package/dist/openrouter-sync-BBHUM3R6.cjs +0 -11
  48. package/dist/updater-QW473OF4.cjs +0 -17
@@ -0,0 +1,135 @@
1
+ ---
2
+ name: codeshell-help
3
+ description: Use when the user asks how to use code-shell itself — slash commands, login/model setup, settings.json keys, hooks, MCP servers, debugging flags, or "how do I X in code-shell". Skip for general programming questions.
4
+ when_to_use: User asks about code-shell features, configuration, slash commands, or runtime behavior. Not for code questions in the user's own project.
5
+ ---
6
+
7
+ # Using code-shell
8
+
9
+ You are running inside **code-shell**, a terminal coding agent. This skill answers user questions about code-shell itself. Quote sections directly where helpful. If a topic isn't covered, say so — don't invent commands.
10
+
11
+ ## Getting started
12
+
13
+ - `code-shell` — start an interactive REPL in the current directory.
14
+ - `code-shell run "<prompt>"` — one-shot non-interactive run, prints final answer and exits.
15
+ - `code-shell runs <sid>` — resume a saved session by id.
16
+ - First launch shows an onboarding flow that walks through provider + model setup.
17
+
18
+ ## Slash commands (run inside the REPL)
19
+
20
+ Type `/` and the menu appears. The full list:
21
+
22
+ ### Core
23
+ - `/help` — show the slash menu.
24
+ - `/exit` — quit the REPL.
25
+ - `/clear` — clear the conversation (keeps session id).
26
+ - `/compact` — manually trigger context compaction.
27
+ - `/status` — current model, effort, token usage, working dir.
28
+ - `/version` — code-shell version.
29
+ - `/cost` — token cost summary for the session.
30
+ - `/sid` — print the current session id.
31
+ - `/session` — open the session picker.
32
+ - `/resume` — resume the most recent session.
33
+ - `/diff` — show working-tree diff.
34
+ - `/tasks` — current task list (TaskCreate/TaskUpdate state).
35
+ - `/tools` — list available tools.
36
+ - `/memory` — open the per-project memory file.
37
+ - `/export markdown` — export the current conversation to a markdown file.
38
+
39
+ ### Models / providers
40
+ - `/login` — add a new provider + model via the unified ProviderModelFlow.
41
+ - `/logout` — remove a provider's stored credentials.
42
+ - `/model` — quick-switch the active model.
43
+ - `/models` — open the ModelManager (add, refresh, delete providers and models).
44
+
45
+ ### Configuration
46
+ - `/config` — open `settings.json` for the active scope.
47
+ - `/permissions` — manage tool permission rules.
48
+ - `/hooks` — list hooks configured in settings.
49
+ - `/mcp` — list and manage MCP servers.
50
+ - `/skills` — list discovered skills.
51
+ - `/effort` — set reasoning effort (low / medium / high) for reasoning models.
52
+
53
+ ### Git / review
54
+ - `/commit` — agent drafts a commit from staged changes.
55
+ - `/branch` — branch operations.
56
+ - `/review` — review pending changes.
57
+ - `/pr-comments` — fetch GitHub PR comments.
58
+ - `/autofix-pr` — apply review suggestions.
59
+ - `/security-review` — run a security-focused review of pending changes.
60
+
61
+ ### Misc
62
+ - `/init` — scaffold or refresh `CODESHELL.md` / project rules based on repo state.
63
+ - `/copy` — copy last response to clipboard.
64
+ - `/undo` — undo the most recent file edit done by the agent.
65
+ - `/update` — check for and install code-shell updates (auto-installs on exit when npm prefix is writable).
66
+ - `/log` — open the session log file.
67
+ - `/files` — list files the agent has touched this session.
68
+ - `/release-notes` — show CHANGELOG for the running version.
69
+ - `/feedback` — open the feedback URL.
70
+ - `/voice` — voice input (if enabled).
71
+
72
+ ## Provider + model setup
73
+
74
+ code-shell uses a **two-layer config**: `providers[]` holds credentials and base URLs; `models[]` references a provider by key.
75
+
76
+ - New users: `/login` runs the full wizard — pick provider kind (anthropic / openai / openrouter / deepseek / custom), enter API key, optional base URL, then pick a model from the fetched list.
77
+ - Existing users with the legacy flat `models[]` shape: auto-migrated on startup with a `.bak` snapshot written next to `settings.json`.
78
+ - Refresh a provider's model list: `/models` → select provider → Refresh. Cached for 7 days under `~/.code-shell/cache/`.
79
+
80
+ ## settings.json — key fields
81
+
82
+ Located at `~/.code-shell/settings.json` (user scope) or `.code-shell/settings.json` (project scope, takes precedence).
83
+
84
+ - `providers[]` — `[{ key, kind, baseUrl, apiKey }]`. Source of credentials.
85
+ - `models[]` — `[{ id, providerKey, displayName, contextLength, ... }]`.
86
+ - `model` — the default active model id.
87
+ - `autoUpdates` — `false` disables the background updater.
88
+ - `permissions` — allow/deny rules for the Bash tool and others.
89
+ - `hooks` — shell commands to run on events (SessionStart, PreToolUse, etc.).
90
+ - `mcpServers` — `{ name: { command, args, env } }` map of MCP servers.
91
+
92
+ ## Hooks
93
+
94
+ Hooks are shell commands the harness runs on events. Configured in `settings.json` under `hooks`. Common events: `SessionStart`, `UserPromptSubmit`, `PreToolUse`, `PostToolUse`, `Stop`. Use them for automated behaviors ("each time X happens, run Y") — memory or preferences can't do this because the model doesn't fire actions on schedule, the harness does.
95
+
96
+ ## MCP servers
97
+
98
+ `code-shell` speaks the Model Context Protocol. Add servers in `settings.json` under `mcpServers`. Each entry is a stdio command code-shell spawns; its tools/resources become available to the agent automatically. List with `/mcp`.
99
+
100
+ ## Debugging
101
+
102
+ - `CODE_SHELL_DEV=1 code-shell` — dev mode: enables the per-session verbose recorder (JSONL traces under `log/<date>/session-<sid>.jsonl`, 7-day retention), disables auto-update, shows extra UI.
103
+ - `--debug` flag has the same effect as `CODE_SHELL_DEV=1`.
104
+ - Logs: `~/.code-shell/log/` for general logs; per-session JSONL traces appear there when dev mode is on.
105
+ - Investigation guard: re-reading the same file 3× is hard-blocked. 4+ consecutive read-only tool calls inject a "change strategy" reminder. This is intentional — break the loop, don't fight it.
106
+ - Update install log: `~/.code-shell/update.log`.
107
+
108
+ ## Memory
109
+
110
+ code-shell has a per-project memory system at `.code-shell/memory/` (relative to project root) and a global one at `~/.code-shell/memory/`. The `MEMORY.md` index is auto-loaded into context every session. Individual memory files are loaded on demand. Edit with `/memory` or directly.
111
+
112
+ ## Skills
113
+
114
+ Skills are markdown files with frontmatter that get discovered automatically. Locations scanned:
115
+ - `<cwd>/.code-shell/skills/` — project-level
116
+ - `<cwd>/.claude/skills/` — project-level (Claude Code compat)
117
+ - `~/.code-shell/skills/` — user-level
118
+ - `~/.claude/skills/` — user-level (Claude Code compat)
119
+ - Built-in skills shipped with the package (e.g. this one).
120
+
121
+ List discovered skills with `/skills`. Invoke a skill with the `Skill` tool by name. Frontmatter `description` tells the model when to use it.
122
+
123
+ ## Common questions
124
+
125
+ **"How do I switch models?"** — `/model <id>` or pick from `/models`.
126
+
127
+ **"How do I add a new provider?"** — `/login`, then follow the wizard. Or edit `settings.json` `providers[]` directly.
128
+
129
+ **"Why is auto-update not working?"** — `/update` shows the disabled reason. Common: dev build, `DISABLE_AUTOUPDATER=1`, `settings.autoUpdates: false`, or the npm global prefix isn't writable (use the shown `sudo` command).
130
+
131
+ **"Where's my session saved?"** — `~/.code-shell/sessions/<sid>/`. State, messages, and tool results all there.
132
+
133
+ **"How do I see what tools an agent has?"** — `/tools`.
134
+
135
+ **"How do I limit what Bash commands the agent can run?"** — `/permissions` or edit `settings.permissions` directly.
@@ -1,7 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkYUI524OEcjs = require('./chunk-YUI524OE.cjs');
4
- require('./chunk-KS3RYAYL.cjs');
5
-
6
-
7
- exports.SettingsManager = _chunkYUI524OEcjs.SettingsManager;
@@ -1,15 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
- var _chunkQRM7IF2Scjs = require('./chunk-QRM7IF2S.cjs');
8
- require('./chunk-KS3RYAYL.cjs');
9
-
10
-
11
-
12
-
13
-
14
-
15
- exports.findOpenRouterModel = _chunkQRM7IF2Scjs.findOpenRouterModel; exports.getOpenRouterModels = _chunkQRM7IF2Scjs.getOpenRouterModels; exports.getOpenRouterSnapshot = _chunkQRM7IF2Scjs.getOpenRouterSnapshot; exports.listOpenRouterModelsByVendor = _chunkQRM7IF2Scjs.listOpenRouterModelsByVendor; exports.setOpenRouterSnapshot = _chunkQRM7IF2Scjs.setOpenRouterSnapshot;
@@ -1,11 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
- var _chunkA5LCRPDPcjs = require('./chunk-A5LCRPDP.cjs');
4
-
5
-
6
- var _chunkQRM7IF2Scjs = require('./chunk-QRM7IF2S.cjs');
7
- require('./chunk-KS3RYAYL.cjs');
8
-
9
-
10
-
11
- exports.getOpenRouterSnapshot = _chunkQRM7IF2Scjs.getOpenRouterSnapshot; exports.syncOpenRouterCatalog = _chunkA5LCRPDPcjs.syncOpenRouterCatalog;
@@ -1,17 +0,0 @@
1
- "use strict";Object.defineProperty(exports, "__esModule", {value: true});
2
-
3
-
4
-
5
-
6
-
7
-
8
- var _chunkR47ROHGLcjs = require('./chunk-R47ROHGL.cjs');
9
- require('./chunk-KS3RYAYL.cjs');
10
-
11
-
12
-
13
-
14
-
15
-
16
-
17
- exports.__internal = _chunkR47ROHGLcjs.__internal; exports.checkForUpdate = _chunkR47ROHGLcjs.checkForUpdate; exports.getAutoUpdateDisabledReason = _chunkR47ROHGLcjs.getAutoUpdateDisabledReason; exports.getCurrentVersion = _chunkR47ROHGLcjs.getCurrentVersion; exports.getUpdateAvailable = _chunkR47ROHGLcjs.getUpdateAvailable; exports.scheduleAutoInstallOnExit = _chunkR47ROHGLcjs.scheduleAutoInstallOnExit;