codeep 2.12.0 → 2.13.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.
- package/README.md +9 -1
- package/dist/acp/server.d.ts +41 -0
- package/dist/acp/server.js +36 -155
- package/dist/acp/serverHandlers.d.ts +88 -0
- package/dist/acp/serverHandlers.js +237 -0
- package/dist/acp/session.d.ts +9 -0
- package/dist/acp/session.js +6 -2
- package/dist/config/index.d.ts +2 -2
- package/dist/config/providers.d.ts +10 -0
- package/dist/config/providers.js +225 -2
- package/dist/renderer/App.js +6 -119
- package/dist/renderer/commands/registry.d.ts +92 -0
- package/dist/renderer/commands/registry.js +488 -0
- package/dist/renderer/components/Help.d.ts +12 -3
- package/dist/renderer/components/Help.js +14 -176
- package/dist/renderer/components/Settings.d.ts +5 -1
- package/dist/renderer/components/Settings.js +23 -5
- package/dist/utils/agentChat.js +5 -2
- package/dist/utils/gitHookInstaller.js +1 -1
- package/dist/utils/tokenTracker.js +37 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/package.json +3 -10
|
@@ -0,0 +1,488 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Single source of truth for Codeep slash commands.
|
|
3
|
+
*
|
|
4
|
+
* Every other place that needs command metadata — the `/` autocomplete in
|
|
5
|
+
* `App.ts`, the `/help` screen in `components/Help.ts`, the dispatcher in
|
|
6
|
+
* `commands.ts`, and the ACP command handler in `acp/commands.ts` — derives
|
|
7
|
+
* from this registry. Adding a command means adding one entry here; the
|
|
8
|
+
* autocomplete list, help screen, and command index all pick it up.
|
|
9
|
+
*
|
|
10
|
+
* ## What lives here vs. elsewhere
|
|
11
|
+
*
|
|
12
|
+
* - **`CommandDef`** is metadata only: name, aliases, description, category.
|
|
13
|
+
* The actual handler logic stays in `renderer/commands.ts` (CLI) and
|
|
14
|
+
* `acp/commands.ts` (ACP) — those files keep their per-command `case`
|
|
15
|
+
* blocks, but they now look up the canonical name/description/alias map here.
|
|
16
|
+
* - **Argument syntax** (e.g. `/rename <name>`, `/mcp browse [id]`) is
|
|
17
|
+
* documented via the optional `usage` field — surfaced in `/help` only.
|
|
18
|
+
* The autocomplete list shows just the bare command name.
|
|
19
|
+
* - **Hidden commands** (`hidden: true`) are valid and dispatched, but don't
|
|
20
|
+
* appear in the autocomplete dropdown or `/help`. Use for aliases that
|
|
21
|
+
* would clutter the list (single-letter shortcuts) and internal commands.
|
|
22
|
+
*
|
|
23
|
+
* ## Invariants (enforced by `registry.test.ts`)
|
|
24
|
+
*
|
|
25
|
+
* - No two commands share a name or alias.
|
|
26
|
+
* - Every `category` referenced exists in `CATEGORY_ORDER`.
|
|
27
|
+
* - `usage` keys never collide with a sibling command's name.
|
|
28
|
+
*/
|
|
29
|
+
/** Display categories, in the order `/help` shows them. */
|
|
30
|
+
export const CATEGORY_ORDER = [
|
|
31
|
+
'general',
|
|
32
|
+
'sessions',
|
|
33
|
+
'checkpoints',
|
|
34
|
+
'agent',
|
|
35
|
+
'git',
|
|
36
|
+
'code',
|
|
37
|
+
'skills',
|
|
38
|
+
'settings',
|
|
39
|
+
'extensions',
|
|
40
|
+
'cloud',
|
|
41
|
+
'codegen',
|
|
42
|
+
'thinking',
|
|
43
|
+
];
|
|
44
|
+
/** Human-readable title for each category (used by `/help`). */
|
|
45
|
+
export const CATEGORY_TITLES = {
|
|
46
|
+
general: 'General',
|
|
47
|
+
sessions: 'Sessions',
|
|
48
|
+
checkpoints: 'Checkpoints (2.0)',
|
|
49
|
+
agent: 'Agent Mode',
|
|
50
|
+
git: 'Git & Project',
|
|
51
|
+
code: 'Code Operations',
|
|
52
|
+
skills: 'Skills (Shortcuts)',
|
|
53
|
+
settings: 'Settings',
|
|
54
|
+
extensions: 'Extensions & MCP (2.0)',
|
|
55
|
+
cloud: 'Cloud & Account',
|
|
56
|
+
codegen: 'Code Generation',
|
|
57
|
+
thinking: 'Reasoning',
|
|
58
|
+
};
|
|
59
|
+
/**
|
|
60
|
+
* The registry. Order within a category is preserved as-is in `/help`,
|
|
61
|
+
* so keep entries grouped by category in source for readability.
|
|
62
|
+
*/
|
|
63
|
+
export const COMMANDS = [
|
|
64
|
+
// ── general ────────────────────────────────────────────────────────────────
|
|
65
|
+
{ name: 'help', description: 'Show this help', category: 'general' },
|
|
66
|
+
{ name: 'status', description: 'Current status', category: 'general' },
|
|
67
|
+
{ name: 'settings', description: 'Open settings', category: 'general' },
|
|
68
|
+
{ name: 'version', description: 'Show version', category: 'general' },
|
|
69
|
+
{ name: 'update', description: 'Check for updates', category: 'general' },
|
|
70
|
+
{
|
|
71
|
+
name: 'cost',
|
|
72
|
+
aliases: ['stats'],
|
|
73
|
+
description: 'Token usage & cost this session',
|
|
74
|
+
category: 'general',
|
|
75
|
+
aliasListed: true,
|
|
76
|
+
},
|
|
77
|
+
{ name: 'clear', description: 'Clear chat', category: 'general', hidden: true },
|
|
78
|
+
{ name: 'exit', description: 'Quit application', category: 'general', hidden: true },
|
|
79
|
+
// ── sessions ───────────────────────────────────────────────────────────────
|
|
80
|
+
{ name: 'sessions', aliases: ['session'], description: 'List and load sessions', category: 'sessions' },
|
|
81
|
+
{ name: 'new', description: 'Start new session', category: 'sessions' },
|
|
82
|
+
{ name: 'rename', description: 'Rename current session', category: 'sessions', usage: ['<name>'] },
|
|
83
|
+
{ name: 'search', description: 'Search the current session', category: 'sessions', usage: ['<term>'] },
|
|
84
|
+
{
|
|
85
|
+
name: 'recall',
|
|
86
|
+
description: 'Search across ALL saved sessions (cross-session)',
|
|
87
|
+
category: 'sessions',
|
|
88
|
+
usage: ['<query>', '<query> --resume', '<query> --summarize'],
|
|
89
|
+
},
|
|
90
|
+
{ name: 'export', description: 'Export chat', category: 'sessions', usage: ['[md|json|txt]'] },
|
|
91
|
+
{ name: 'compact', description: 'AI-summarize older messages to free up context (keeps last N)', category: 'sessions', usage: ['[keepN]'] },
|
|
92
|
+
// ── checkpoints ────────────────────────────────────────────────────────────
|
|
93
|
+
{ name: 'checkpoint', description: 'Snapshot conversation + provider/model + git HEAD', category: 'checkpoints', usage: ['[name]', 'delete <id>'] },
|
|
94
|
+
{ name: 'checkpoints', description: 'List saved checkpoints in this workspace', category: 'checkpoints' },
|
|
95
|
+
{ name: 'rewind', description: 'Restore conversation from a checkpoint', category: 'checkpoints', usage: ['<id>'] },
|
|
96
|
+
// ── agent ──────────────────────────────────────────────────────────────────
|
|
97
|
+
{ name: 'agent', description: 'Run agent with task', category: 'agent', usage: ['<task>'] },
|
|
98
|
+
{ name: 'agent-dry', description: 'Dry run (no changes)', category: 'agent', usage: ['<task>'] },
|
|
99
|
+
{ name: 'plan', description: 'Generate a plan first — review before /go executes', category: 'agent', usage: ['<task>'] },
|
|
100
|
+
{ name: 'go', description: 'Execute the pending plan from /plan', category: 'agent' },
|
|
101
|
+
{ name: 'stop', description: 'Stop running agent', category: 'agent' },
|
|
102
|
+
{ name: 'undo', description: 'Undo last agent action', category: 'agent' },
|
|
103
|
+
{ name: 'undo-all', description: 'Undo all agent actions', category: 'agent' },
|
|
104
|
+
{ name: 'history', description: 'Show agent history', category: 'agent' },
|
|
105
|
+
{ name: 'changes', description: 'Show session changes', category: 'agent' },
|
|
106
|
+
// ── git & project ──────────────────────────────────────────────────────────
|
|
107
|
+
{ name: 'diff', description: 'Review git diff with AI', category: 'git', usage: ['--staged'] },
|
|
108
|
+
{
|
|
109
|
+
name: 'commit',
|
|
110
|
+
aliases: ['c'],
|
|
111
|
+
description: 'Generate commit message',
|
|
112
|
+
category: 'git',
|
|
113
|
+
aliasListed: true,
|
|
114
|
+
},
|
|
115
|
+
{ name: 'git-commit', description: 'Commit with message', category: 'git', usage: ['<msg>'] },
|
|
116
|
+
{ name: 'push', aliases: ['p'], description: 'Git push', category: 'git', aliasListed: true },
|
|
117
|
+
{ name: 'pull', description: 'Git pull', category: 'git' },
|
|
118
|
+
{ name: 'amend', description: 'Amend last commit', category: 'git' },
|
|
119
|
+
{ name: 'branch', description: 'Create/manage branches', category: 'git' },
|
|
120
|
+
{ name: 'stash', description: 'Stash changes with a meaningful message', category: 'git' },
|
|
121
|
+
{ name: 'unstash', description: 'Apply and drop the most recent stash', category: 'git' },
|
|
122
|
+
{ name: 'pr', description: 'Create a pull request description', category: 'git' },
|
|
123
|
+
{ name: 'changelog', description: 'Generate changelog from recent commits', category: 'git' },
|
|
124
|
+
{ name: 'init', description: 'Initialize project (.codeep/ folder)', category: 'git' },
|
|
125
|
+
{ name: 'scan', description: 'Scan project structure', category: 'git' },
|
|
126
|
+
{
|
|
127
|
+
name: 'memory',
|
|
128
|
+
description: 'Add note to project intelligence',
|
|
129
|
+
category: 'git',
|
|
130
|
+
usage: ['list', 'remove <n>', 'clear', '<note>'],
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
name: 'review',
|
|
134
|
+
description: 'AI review of unstaged git changes (not full codebase)',
|
|
135
|
+
category: 'git',
|
|
136
|
+
usage: ['--staged', '--static', '<file>'],
|
|
137
|
+
},
|
|
138
|
+
// ── code operations ────────────────────────────────────────────────────────
|
|
139
|
+
{ name: 'copy', description: 'Copy code block to clipboard', category: 'code', usage: ['[n]'] },
|
|
140
|
+
{ name: 'paste', description: 'Paste from clipboard', category: 'code' },
|
|
141
|
+
{ name: 'apply', description: 'Apply file changes from AI', category: 'code' },
|
|
142
|
+
{ name: 'add', description: 'Add file to context', category: 'code', usage: ['<path>'] },
|
|
143
|
+
{ name: 'drop', description: 'Remove file (or all) from context', category: 'code', usage: ['[path]'] },
|
|
144
|
+
{ name: 'multiline', description: 'Toggle multi-line input mode', category: 'code' },
|
|
145
|
+
// ── skills (shortcuts) ─────────────────────────────────────────────────────
|
|
146
|
+
{ name: 'test', aliases: ['t'], description: 'Generate/run tests', category: 'skills', aliasListed: true },
|
|
147
|
+
{
|
|
148
|
+
name: 'docs',
|
|
149
|
+
aliases: ['d'],
|
|
150
|
+
description: 'Open web docs for a command (e.g. /docs personality)',
|
|
151
|
+
category: 'skills',
|
|
152
|
+
aliasListed: true,
|
|
153
|
+
},
|
|
154
|
+
{ name: 'refactor', aliases: ['r'], description: 'Improve code quality', category: 'skills', aliasListed: true },
|
|
155
|
+
{ name: 'fix', aliases: ['f'], description: 'Debug and fix issues', category: 'skills', aliasListed: true },
|
|
156
|
+
{ name: 'explain', aliases: ['e'], description: 'Explain code', category: 'skills', aliasListed: true },
|
|
157
|
+
{ name: 'optimize', aliases: ['o'], description: 'Optimize performance', category: 'skills', aliasListed: true },
|
|
158
|
+
{ name: 'debug', aliases: ['b'], description: 'Debug problems', category: 'skills', aliasListed: true },
|
|
159
|
+
{ name: 'security', description: 'Security audit (SQLi, XSS, secrets, auth)', category: 'skills' },
|
|
160
|
+
{ name: 'coverage', description: 'Analyze test coverage and suggest improvements', category: 'skills' },
|
|
161
|
+
{ name: 'test-fix', description: 'Fix failing tests', category: 'skills' },
|
|
162
|
+
{ name: 'e2e', description: 'Generate end-to-end tests', category: 'skills' },
|
|
163
|
+
{ name: 'mock', description: 'Generate mock data for testing', category: 'skills' },
|
|
164
|
+
{ name: 'readme', description: 'Generate or update README', category: 'skills' },
|
|
165
|
+
{ name: 'api-docs', description: 'Generate API documentation', category: 'skills' },
|
|
166
|
+
{ name: 'translate', description: 'Translate code comments to English', category: 'skills' },
|
|
167
|
+
{ name: 'types', description: 'Add or improve TypeScript types', category: 'skills' },
|
|
168
|
+
{ name: 'cleanup', description: 'Clean up code (remove unused, format)', category: 'skills' },
|
|
169
|
+
{ name: 'modernize', description: 'Update code to use modern syntax', category: 'skills' },
|
|
170
|
+
{ name: 'migrate', description: 'Migrate code to newer version', category: 'skills' },
|
|
171
|
+
{ name: 'split', description: 'Split a large file into smaller modules', category: 'skills' },
|
|
172
|
+
{ name: 'log', description: 'Add logging to code', category: 'skills' },
|
|
173
|
+
{ name: 'skills', description: 'List all 50+ skills', category: 'skills', usage: ['<query>'] },
|
|
174
|
+
{
|
|
175
|
+
name: 'skill',
|
|
176
|
+
description: 'Manage a single skill',
|
|
177
|
+
category: 'skills',
|
|
178
|
+
hidden: true,
|
|
179
|
+
usage: ['create', 'delete', 'help'],
|
|
180
|
+
},
|
|
181
|
+
// ── settings ───────────────────────────────────────────────────────────────
|
|
182
|
+
{ name: 'provider', description: 'Change AI provider', category: 'settings' },
|
|
183
|
+
{ name: 'model', description: 'Change model', category: 'settings', usage: ['<name>'] },
|
|
184
|
+
{ name: 'protocol', description: 'Switch API protocol', category: 'settings' },
|
|
185
|
+
{ name: 'lang', description: 'Set response language', category: 'settings' },
|
|
186
|
+
{ name: 'grant', description: 'Grant write permission', category: 'settings' },
|
|
187
|
+
{ name: 'login', aliases: ['apikey'], description: 'Login with API key', category: 'settings' },
|
|
188
|
+
{ name: 'logout', description: 'Logout from provider', category: 'settings' },
|
|
189
|
+
{
|
|
190
|
+
name: 'profile',
|
|
191
|
+
description: 'Save/load settings profiles',
|
|
192
|
+
category: 'settings',
|
|
193
|
+
usage: ['save <name>', 'list', 'apply <name>', 'delete <name>'],
|
|
194
|
+
},
|
|
195
|
+
{ name: 'personality', description: 'List or switch agent tone (concise / verbose / security / senior-reviewer / …)', category: 'settings', usage: ['<name>', 'off'] },
|
|
196
|
+
{
|
|
197
|
+
name: 'me',
|
|
198
|
+
description: 'Your user profile (reply language, style, stack) — adapts the agent to you',
|
|
199
|
+
category: 'settings',
|
|
200
|
+
usage: ['init [project]', 'learn [on|off]', 'sync', 'off', 'forget'],
|
|
201
|
+
},
|
|
202
|
+
{ name: 'agents', description: 'List sub-agents the agent can delegate to (researcher / reviewer / tester / your own)', category: 'settings' },
|
|
203
|
+
{ name: 'insights', description: 'Activity summary — runs, files, tools, projects over the last N days (default 7)', category: 'settings', usage: ['--days N'] },
|
|
204
|
+
{ name: 'openrouter', description: 'OpenRouter routing prefs (prefer/ignore providers, fallbacks, privacy)', category: 'settings' },
|
|
205
|
+
// ── extensions & mcp ───────────────────────────────────────────────────────
|
|
206
|
+
{
|
|
207
|
+
name: 'mcp',
|
|
208
|
+
description: 'List connected MCP servers + their tools',
|
|
209
|
+
category: 'extensions',
|
|
210
|
+
usage: ['browse [id]', 'install <id> [args]', 'add <name> <cmd>', 'remove <name>', 'resources', 'prompts'],
|
|
211
|
+
},
|
|
212
|
+
{ name: 'hooks', description: 'List installed lifecycle hooks (.codeep/hooks/<event>.sh)', category: 'extensions' },
|
|
213
|
+
{ name: 'commands', description: 'List custom slash commands in .codeep/commands/*.md', category: 'extensions' },
|
|
214
|
+
// ── cloud & account ────────────────────────────────────────────────────────
|
|
215
|
+
{ name: 'account', description: 'Link this machine to your codeep.dev account', category: 'cloud' },
|
|
216
|
+
{ name: 'tasks', description: 'List/add/done/delete codeep.dev tasks', category: 'cloud', usage: ['add <title> [--bug|--feature]'] },
|
|
217
|
+
{ name: 'sync', description: 'Sync learning preferences and profiles to codeep.dev', category: 'cloud' },
|
|
218
|
+
{ name: 'telemetry', description: 'Show or toggle automatic cloud telemetry (on/off)', category: 'cloud' },
|
|
219
|
+
{ name: 'keysync', description: 'Show or toggle syncing API keys to codeep.dev (on/off)', category: 'cloud' },
|
|
220
|
+
{ name: 'learn', description: 'Learn code preferences', category: 'cloud' },
|
|
221
|
+
{ name: 'context-save', description: 'Save conversation', category: 'cloud', hidden: true },
|
|
222
|
+
{ name: 'context-load', description: 'Load conversation', category: 'cloud', hidden: true },
|
|
223
|
+
{ name: 'context-clear', description: 'Clear saved context', category: 'cloud', hidden: true },
|
|
224
|
+
{ name: 'save', description: 'Save current session', category: 'cloud', hidden: true },
|
|
225
|
+
// ── code generation ────────────────────────────────────────────────────────
|
|
226
|
+
{ name: 'build', description: 'Build the project', category: 'codegen' },
|
|
227
|
+
{ name: 'deploy', description: 'Build and deploy', category: 'codegen' },
|
|
228
|
+
{ name: 'release', description: 'Create a new release', category: 'codegen' },
|
|
229
|
+
{ name: 'publish', description: 'Publish package to npm', category: 'codegen' },
|
|
230
|
+
{ name: 'component', description: 'Generate UI component', category: 'codegen', usage: ['<name>'] },
|
|
231
|
+
{ name: 'api', description: 'Generate API endpoint', category: 'codegen', usage: ['<name>'] },
|
|
232
|
+
{ name: 'hook', description: 'Generate a React hook', category: 'codegen' },
|
|
233
|
+
{ name: 'service', description: 'Generate a service/utility module', category: 'codegen' },
|
|
234
|
+
{ name: 'page', description: 'Generate a new page/route', category: 'codegen' },
|
|
235
|
+
{ name: 'form', description: 'Generate a form with validation', category: 'codegen' },
|
|
236
|
+
{ name: 'crud', description: 'Generate full CRUD for an entity', category: 'codegen' },
|
|
237
|
+
{ name: 'docker', description: 'Generate Dockerfile + compose', category: 'codegen' },
|
|
238
|
+
{ name: 'ci', description: 'Generate CI/CD configuration', category: 'codegen' },
|
|
239
|
+
{ name: 'env', description: 'Setup environment configuration', category: 'codegen' },
|
|
240
|
+
{ name: 'k8s', description: 'Generate Kubernetes manifests', category: 'codegen' },
|
|
241
|
+
{ name: 'terraform', description: 'Generate Terraform configuration', category: 'codegen' },
|
|
242
|
+
{ name: 'nginx', description: 'Generate Nginx configuration', category: 'codegen' },
|
|
243
|
+
{ name: 'monitor', description: 'Add monitoring and observability', category: 'codegen' },
|
|
244
|
+
// ── reasoning ──────────────────────────────────────────────────────────────
|
|
245
|
+
{
|
|
246
|
+
name: 'thinking',
|
|
247
|
+
aliases: ['effort'],
|
|
248
|
+
description: 'Set the thinking/reasoning-effort tier (auto/low/medium/high/max) for models that support it',
|
|
249
|
+
category: 'thinking',
|
|
250
|
+
aliasListed: true,
|
|
251
|
+
},
|
|
252
|
+
];
|
|
253
|
+
// ─── Derived lookup maps ─────────────────────────────────────────────────────
|
|
254
|
+
/** `name → description` for every visible (non-hidden) command + listed alias.
|
|
255
|
+
* This is the data behind the `/` autocomplete dropdown in `App.ts`.
|
|
256
|
+
*
|
|
257
|
+
* Single-letter aliases (the `c`/`t`/`d`/… shortcuts) are deliberately
|
|
258
|
+
* EXCLUDED from the dropdown — bare one-letter rows just clutter it (they
|
|
259
|
+
* stay fully routable via the dispatcher + show in `/help` as `(/c)` suffixes).
|
|
260
|
+
* Multi-letter listed aliases (`effort`, `stats`) are kept; they read as real
|
|
261
|
+
* commands, not noise. */
|
|
262
|
+
export const COMMAND_DESCRIPTIONS = (() => {
|
|
263
|
+
const out = {};
|
|
264
|
+
for (const cmd of COMMANDS) {
|
|
265
|
+
if (cmd.hidden)
|
|
266
|
+
continue;
|
|
267
|
+
out[cmd.name] = cmd.description;
|
|
268
|
+
if (cmd.aliasListed && cmd.aliases) {
|
|
269
|
+
for (const a of cmd.aliases) {
|
|
270
|
+
if (a.length > 1)
|
|
271
|
+
out[a] = cmd.description; // skip single-letter shortcuts
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
return out;
|
|
276
|
+
})();
|
|
277
|
+
/** Every valid command name, including hidden ones and aliases — used by the
|
|
278
|
+
* dispatcher to validate input before looking up a handler. */
|
|
279
|
+
export const ALL_COMMAND_NAMES = (() => {
|
|
280
|
+
const set = new Set();
|
|
281
|
+
for (const cmd of COMMANDS) {
|
|
282
|
+
set.add(cmd.name);
|
|
283
|
+
for (const a of cmd.aliases ?? [])
|
|
284
|
+
set.add(a);
|
|
285
|
+
}
|
|
286
|
+
return set;
|
|
287
|
+
})();
|
|
288
|
+
/** Resolve an input token (name or alias) to its canonical `CommandDef`,
|
|
289
|
+
* or `undefined` if unknown. */
|
|
290
|
+
const COMMAND_BY_TOKEN = (() => {
|
|
291
|
+
const map = new Map();
|
|
292
|
+
for (const cmd of COMMANDS) {
|
|
293
|
+
map.set(cmd.name, cmd);
|
|
294
|
+
for (const a of cmd.aliases ?? [])
|
|
295
|
+
map.set(a, cmd);
|
|
296
|
+
}
|
|
297
|
+
return map;
|
|
298
|
+
})();
|
|
299
|
+
export function resolveCommand(token) {
|
|
300
|
+
return COMMAND_BY_TOKEN.get(token);
|
|
301
|
+
}
|
|
302
|
+
/** All aliases (every value in `aliases` across the registry), for quick
|
|
303
|
+
* "is this a shortcut?" checks. */
|
|
304
|
+
export const ALL_ALIASES = (() => {
|
|
305
|
+
const set = new Set();
|
|
306
|
+
for (const cmd of COMMANDS) {
|
|
307
|
+
for (const a of cmd.aliases ?? [])
|
|
308
|
+
set.add(a);
|
|
309
|
+
}
|
|
310
|
+
return set;
|
|
311
|
+
})();
|
|
312
|
+
/**
|
|
313
|
+
* Hand-curated help layout. Categories appear in this order; each item's `key`
|
|
314
|
+
* is rendered verbatim. The command registry provides autocomplete + dispatch
|
|
315
|
+
* metadata; this layout provides the `/help` rendering. They overlap by design
|
|
316
|
+
* — keeping both lets the help screen document env vars, subcommand flavors,
|
|
317
|
+
* and recommended workflows that don't fit the strict command/alias shape.
|
|
318
|
+
*/
|
|
319
|
+
export const HELP_LAYOUT = [
|
|
320
|
+
{
|
|
321
|
+
title: 'General',
|
|
322
|
+
items: [
|
|
323
|
+
{ key: '/help', description: 'Show this help' },
|
|
324
|
+
{ key: '/status', description: 'Current status' },
|
|
325
|
+
{ key: '/settings', description: 'Open settings' },
|
|
326
|
+
{ key: '/version', description: 'Show version' },
|
|
327
|
+
{ key: '/update', description: 'Check for updates' },
|
|
328
|
+
{ key: '/stats (/cost)', description: 'Token usage & cost this session' },
|
|
329
|
+
{ key: '/clear', description: 'Clear chat' },
|
|
330
|
+
{ key: '/exit', description: 'Quit application' },
|
|
331
|
+
],
|
|
332
|
+
},
|
|
333
|
+
{
|
|
334
|
+
title: 'Sessions',
|
|
335
|
+
items: [
|
|
336
|
+
{ key: '/sessions', description: 'List and load sessions' },
|
|
337
|
+
{ key: '/new', description: 'Start new session' },
|
|
338
|
+
{ key: '/rename <name>', description: 'Rename current session' },
|
|
339
|
+
{ key: '/search <term>', description: 'Search the current session' },
|
|
340
|
+
{ key: '/recall <query>', description: 'Search across ALL saved sessions (cross-session)' },
|
|
341
|
+
{ key: '/recall … --resume', description: 'Load the top-matching session directly' },
|
|
342
|
+
{ key: '/recall … --summarize', description: 'LLM recap of what you did across matches' },
|
|
343
|
+
{ key: '/export [md|json|txt]', description: 'Export chat' },
|
|
344
|
+
{ key: '/compact [keepN]', description: 'AI-summarize older messages to free up context (keeps last N)' },
|
|
345
|
+
],
|
|
346
|
+
},
|
|
347
|
+
{
|
|
348
|
+
title: 'Checkpoints (2.0)',
|
|
349
|
+
items: [
|
|
350
|
+
{ key: '/checkpoint [name]', description: 'Snapshot conversation + provider/model + git HEAD' },
|
|
351
|
+
{ key: '/checkpoints', description: 'List saved checkpoints in this workspace' },
|
|
352
|
+
{ key: '/rewind <id>', description: 'Restore conversation from a checkpoint' },
|
|
353
|
+
{ key: '/checkpoint delete <id>', description: 'Delete a saved checkpoint' },
|
|
354
|
+
],
|
|
355
|
+
},
|
|
356
|
+
{
|
|
357
|
+
title: 'Agent Mode',
|
|
358
|
+
items: [
|
|
359
|
+
{ key: '/agent <task>', description: 'Run agent with task' },
|
|
360
|
+
{ key: '/agent-dry <task>', description: 'Dry run (no changes)' },
|
|
361
|
+
{ key: '/plan <task>', description: 'Generate a plan first — review before /go executes' },
|
|
362
|
+
{ key: '/go', description: 'Execute the pending plan from /plan' },
|
|
363
|
+
{ key: '/stop', description: 'Stop running agent' },
|
|
364
|
+
{ key: '/undo', description: 'Undo last agent action' },
|
|
365
|
+
{ key: '/undo-all', description: 'Undo all agent actions' },
|
|
366
|
+
{ key: '/history', description: 'Show agent history' },
|
|
367
|
+
{ key: '/changes', description: 'Show session changes' },
|
|
368
|
+
],
|
|
369
|
+
},
|
|
370
|
+
{
|
|
371
|
+
title: 'Git & Project',
|
|
372
|
+
items: [
|
|
373
|
+
{ key: '/diff', description: 'Review git diff with AI' },
|
|
374
|
+
{ key: '/diff --staged', description: 'Review staged changes' },
|
|
375
|
+
{ key: '/commit (/c)', description: 'Generate commit message' },
|
|
376
|
+
{ key: '/git-commit <msg>', description: 'Commit with message' },
|
|
377
|
+
{ key: '/push (/p)', description: 'Git push' },
|
|
378
|
+
{ key: '/pull', description: 'Git pull' },
|
|
379
|
+
{ key: '/amend', description: 'Amend last commit' },
|
|
380
|
+
{ key: '/branch', description: 'Create/manage branches' },
|
|
381
|
+
{ key: '/stash', description: 'Stash changes' },
|
|
382
|
+
{ key: '/init', description: 'Initialize project (.codeep/ folder)' },
|
|
383
|
+
{ key: '/scan', description: 'Scan project structure' },
|
|
384
|
+
{ key: '/memory <note>', description: 'Add note to project intelligence' },
|
|
385
|
+
{ key: '/memory list', description: 'Show all memory notes' },
|
|
386
|
+
{ key: '/memory remove <n>', description: 'Remove note by index' },
|
|
387
|
+
{ key: '/memory clear', description: 'Clear all memory notes' },
|
|
388
|
+
{ key: '/review', description: 'AI review of unstaged git changes (not full codebase)' },
|
|
389
|
+
{ key: '/review --staged', description: 'AI review of staged git changes' },
|
|
390
|
+
{ key: '/review --static', description: 'Static analysis — changed files, or whole src/ if clean' },
|
|
391
|
+
{ key: '/review <file>', description: 'Static analysis of specific file(s)' },
|
|
392
|
+
],
|
|
393
|
+
},
|
|
394
|
+
{
|
|
395
|
+
title: 'Code Operations',
|
|
396
|
+
items: [
|
|
397
|
+
{ key: '/copy [n]', description: 'Copy code block to clipboard' },
|
|
398
|
+
{ key: '/paste', description: 'Paste from clipboard' },
|
|
399
|
+
{ key: '/apply', description: 'Apply file changes from AI' },
|
|
400
|
+
{ key: '/add <path>', description: 'Add file to context' },
|
|
401
|
+
{ key: '/drop [path]', description: 'Remove file (or all) from context' },
|
|
402
|
+
{ key: '/multiline', description: 'Toggle multi-line input mode' },
|
|
403
|
+
],
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
title: 'Skills (Shortcuts)',
|
|
407
|
+
items: [
|
|
408
|
+
{ key: '/test (/t)', description: 'Generate/run tests' },
|
|
409
|
+
{ key: '/docs (/d)', description: 'Open web docs for a command' },
|
|
410
|
+
{ key: '/refactor (/r)', description: 'Improve code quality' },
|
|
411
|
+
{ key: '/fix (/f)', description: 'Debug and fix issues' },
|
|
412
|
+
{ key: '/explain (/e)', description: 'Explain code' },
|
|
413
|
+
{ key: '/optimize (/o)', description: 'Optimize performance' },
|
|
414
|
+
{ key: '/debug (/b)', description: 'Debug problems' },
|
|
415
|
+
{ key: '/security', description: 'Security audit (SQLi, XSS, secrets, auth)' },
|
|
416
|
+
{ key: '/coverage', description: 'Run/analyze test coverage' },
|
|
417
|
+
{ key: '/component <name>', description: 'Generate UI component' },
|
|
418
|
+
{ key: '/api <name>', description: 'Generate API endpoint' },
|
|
419
|
+
{ key: '/docker', description: 'Generate Dockerfile + compose' },
|
|
420
|
+
{ key: '/skills', description: 'List all 50+ skills' },
|
|
421
|
+
{ key: '/skills <query>', description: 'Search skills by keyword' },
|
|
422
|
+
],
|
|
423
|
+
},
|
|
424
|
+
{
|
|
425
|
+
title: 'Settings',
|
|
426
|
+
items: [
|
|
427
|
+
{ key: '/provider', description: 'Change AI provider' },
|
|
428
|
+
{ key: '/model', description: 'Change model' },
|
|
429
|
+
{ key: '/model <name>', description: 'Load saved profile (e.g. /model fast)' },
|
|
430
|
+
{ key: '/protocol', description: 'Switch API protocol' },
|
|
431
|
+
{ key: '/lang', description: 'Set response language' },
|
|
432
|
+
{ key: '/grant', description: 'Grant write permission' },
|
|
433
|
+
{ key: '/login', description: 'Login with API key' },
|
|
434
|
+
{ key: '/logout', description: 'Logout from provider' },
|
|
435
|
+
{ key: '/profile save <name>', description: 'Save current provider+model as profile' },
|
|
436
|
+
{ key: '/profile list', description: 'List saved profiles' },
|
|
437
|
+
{ key: '/openrouter', description: 'OpenRouter routing prefs (prefer/ignore providers, fallbacks, privacy)' },
|
|
438
|
+
{ key: '/personality', description: 'List or switch agent tone (concise / verbose / security / senior-reviewer / …)' },
|
|
439
|
+
{ key: '/personality <name>', description: 'Activate a personality. /personality off to clear.' },
|
|
440
|
+
{ key: '/me', description: 'Your user profile (reply language, style, stack) — adapts the agent to you' },
|
|
441
|
+
{ key: '/me init [project]', description: 'Scaffold a profile template (global, or for this project). /me off to disable' },
|
|
442
|
+
{ key: '/me learn [on|off]', description: 'Learn durable prefs from this session now; on/off toggles auto-learn. /me forget clears it' },
|
|
443
|
+
{ key: '/me sync', description: 'Push your profile to the codeep.dev dashboard (and pull on a fresh machine)' },
|
|
444
|
+
{ key: '/agents', description: 'List sub-agents the agent can delegate to (researcher / reviewer / tester / your own)' },
|
|
445
|
+
{ key: '/insights [--days N]', description: 'Activity summary — runs, files, tools, projects over the last N days (default 7)' },
|
|
446
|
+
],
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
title: 'Extensions & MCP (2.0)',
|
|
450
|
+
items: [
|
|
451
|
+
{ key: '/mcp', description: 'List connected MCP servers + their tools' },
|
|
452
|
+
{ key: '/mcp browse [id]', description: 'Browse marketplace (12 servers) or show one' },
|
|
453
|
+
{ key: '/mcp install <id> [args]', description: 'Install a marketplace server into this project' },
|
|
454
|
+
{ key: '/mcp add <name> <cmd>', description: 'Add a custom MCP server (npx, binary, etc.)' },
|
|
455
|
+
{ key: '/mcp remove <name>', description: 'Remove a project-scoped MCP server' },
|
|
456
|
+
{ key: '/mcp reload', description: 'Re-read .codeep/mcp_servers.json (after manual edit)' },
|
|
457
|
+
{ key: '/mcp resources', description: 'List resources exposed by connected servers' },
|
|
458
|
+
{ key: '/mcp read <uri>', description: 'Read one MCP resource' },
|
|
459
|
+
{ key: '/mcp prompts', description: 'List prompt templates exposed by servers' },
|
|
460
|
+
{ key: '/mcp prompt <server> <name>', description: 'Materialize a prompt with arguments (key=value)' },
|
|
461
|
+
{ key: '/hooks', description: 'List installed lifecycle hooks (.codeep/hooks/<event>.sh)' },
|
|
462
|
+
{ key: '/commands', description: 'List custom slash commands (.codeep/commands/*.md)' },
|
|
463
|
+
],
|
|
464
|
+
},
|
|
465
|
+
{
|
|
466
|
+
title: 'Context',
|
|
467
|
+
items: [
|
|
468
|
+
{ key: '/context-save', description: 'Save conversation' },
|
|
469
|
+
{ key: '/context-load', description: 'Load conversation' },
|
|
470
|
+
{ key: '/context-clear', description: 'Clear saved context' },
|
|
471
|
+
{ key: '/learn', description: 'Learn code preferences' },
|
|
472
|
+
{ key: '/learn status', description: 'Show learned prefs' },
|
|
473
|
+
{ key: '/learn rule <text>', description: 'Add custom rule' },
|
|
474
|
+
],
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
title: 'Ollama (Local AI)',
|
|
478
|
+
items: [
|
|
479
|
+
{ key: '/provider', description: 'Select "ollama" for local models' },
|
|
480
|
+
{ key: '/settings > Ollama URL', description: 'Set URL (default: http://localhost:11434)' },
|
|
481
|
+
{ key: '/model', description: 'Pick installed Ollama model dynamically' },
|
|
482
|
+
{ key: '/model pull <model>', description: 'Pull an Ollama model (local Ollama only)' },
|
|
483
|
+
{ key: '/model browse', description: 'Browse recommended local coding models and pull one' },
|
|
484
|
+
{ key: '/model rm <model>', description: 'Remove a locally-installed Ollama model (local only)' },
|
|
485
|
+
{ key: 'OLLAMA_HOST=0.0.0.0', description: 'Required env var for remote Ollama access' },
|
|
486
|
+
],
|
|
487
|
+
},
|
|
488
|
+
];
|
|
@@ -1,5 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Help screen component
|
|
2
|
+
* Help screen component.
|
|
3
|
+
*
|
|
4
|
+
* The `/help` layout lives in `../commands/registry.ts` as `HELP_LAYOUT`
|
|
5
|
+
* (single source of truth, alongside the command metadata). This file
|
|
6
|
+
* re-exports it under the historical `helpCategories` name so existing
|
|
7
|
+
* callers (`App.ts`, `handlers.ts`) keep working, and owns the keyboard-
|
|
8
|
+
* shortcuts panel (which is independent of commands). The actual rendering
|
|
9
|
+
* is done by `App.ts`, which iterates `helpCategories` directly.
|
|
3
10
|
*/
|
|
4
11
|
export interface HelpCategory {
|
|
5
12
|
title: string;
|
|
@@ -9,11 +16,13 @@ export interface HelpCategory {
|
|
|
9
16
|
}>;
|
|
10
17
|
}
|
|
11
18
|
/**
|
|
12
|
-
* Codeep command help data
|
|
19
|
+
* Codeep command help data — re-exported from the registry so there's a
|
|
20
|
+
* single source of truth for both `/help` rendering and `/` autocomplete.
|
|
13
21
|
*/
|
|
14
22
|
export declare const helpCategories: HelpCategory[];
|
|
15
23
|
/**
|
|
16
|
-
* Keyboard shortcuts
|
|
24
|
+
* Keyboard shortcuts (independent of the command registry — raw key
|
|
25
|
+
* bindings, not slash commands).
|
|
17
26
|
*/
|
|
18
27
|
export declare const keyboardShortcuts: {
|
|
19
28
|
key: string;
|