codemini-cli 0.5.10 → 0.5.12
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/OPERATIONS.md +242 -242
- package/README.md +588 -588
- package/codemini-web/dist/assets/{highlighted-body-OFNGDK62-7HL7yft8.js → highlighted-body-OFNGDK62-B-G99D0A.js} +1 -1
- package/codemini-web/dist/assets/{index-BK75hMb2.js → index-DIGUEzan.js} +108 -108
- package/codemini-web/dist/assets/index-Dkq1DdDX.css +2 -0
- package/codemini-web/dist/assets/mermaid-GHXKKRXX-va2Kl89u.js +1 -0
- package/codemini-web/dist/index.html +35 -23
- package/codemini-web/lib/approval-manager.js +32 -32
- package/codemini-web/lib/runtime-bridge.js +17 -11
- package/codemini-web/server.js +534 -205
- package/deployment.md +212 -212
- package/package.json +2 -2
- package/skills/brainstorm/SKILL.md +77 -77
- package/skills/codemini.skills.json +40 -40
- package/skills/grill-me/SKILL.md +30 -30
- package/skills/superpowers-lite/SKILL.md +82 -82
- package/src/cli.js +74 -74
- package/src/commands/chat.js +210 -210
- package/src/commands/run.js +313 -313
- package/src/commands/skill.js +438 -304
- package/src/commands/web.js +57 -57
- package/src/core/agent-loop.js +980 -980
- package/src/core/ast.js +309 -307
- package/src/core/chat-runtime.js +6261 -6253
- package/src/core/command-evaluator.js +72 -72
- package/src/core/command-loader.js +311 -311
- package/src/core/command-policy.js +301 -301
- package/src/core/command-risk.js +156 -156
- package/src/core/config-store.js +286 -285
- package/src/core/constants.js +18 -1
- package/src/core/context-compact.js +365 -365
- package/src/core/default-system-prompt.js +114 -107
- package/src/core/dream-audit.js +105 -105
- package/src/core/dream-consolidate.js +229 -229
- package/src/core/dream-evaluator.js +185 -185
- package/src/core/fff-adapter.js +383 -383
- package/src/core/memory-store.js +543 -543
- package/src/core/project-index.js +737 -548
- package/src/core/project-instructions.js +98 -98
- package/src/core/provider/anthropic.js +514 -514
- package/src/core/provider/openai-compatible.js +501 -501
- package/src/core/reflect-skill.js +178 -178
- package/src/core/reply-language.js +40 -40
- package/src/core/session-store.js +474 -474
- package/src/core/shell-profile.js +237 -237
- package/src/core/shell.js +323 -323
- package/src/core/soul.js +69 -69
- package/src/core/system-prompt-composer.js +52 -52
- package/src/core/tool-args.js +199 -154
- package/src/core/tool-output.js +184 -184
- package/src/core/tool-result-store.js +206 -206
- package/src/core/tools.js +3024 -2893
- package/src/core/version.js +11 -11
- package/src/tui/chat-app.js +5173 -5171
- package/src/tui/tool-activity/presenters/misc.js +30 -30
- package/src/tui/tool-activity/presenters/system.js +20 -20
- package/templates/project-requirements/report-shell.html +582 -582
- package/codemini-web/dist/assets/index-BSdIdn3L.css +0 -2
- package/codemini-web/dist/assets/mermaid-GHXKKRXX-Dg9qh8mg.js +0 -1
package/skills/grill-me/SKILL.md
CHANGED
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: grill-me
|
|
3
|
-
description: Optional pressure-test mode for plans, architecture choices, PRs, launches, and product ideas: challenge assumptions without changing the default collaborative workflow.
|
|
4
|
-
version: 0.1.0
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Use this skill only when the user explicitly asks to be grilled, challenged, pressure-tested, stress-tested, or reviewed with unusually direct scrutiny.
|
|
8
|
-
|
|
9
|
-
## Stance
|
|
10
|
-
|
|
11
|
-
Be direct, but keep the target clear: challenge the work, not the person. The goal is better judgment, not dominance or theater.
|
|
12
|
-
|
|
13
|
-
## Process
|
|
14
|
-
|
|
15
|
-
1. Identify the claim, plan, design, PR, launch, or decision under review.
|
|
16
|
-
2. State the highest-risk assumption first.
|
|
17
|
-
3. Ask 3-7 pointed questions, ordered by risk.
|
|
18
|
-
4. Call out missing evidence, weak verification, unclear ownership, rollback gaps, and hidden dependencies.
|
|
19
|
-
5. End with a short verdict:
|
|
20
|
-
- `Ship`: risks are understood and verification is credible.
|
|
21
|
-
- `Revise`: the direction is good, but one or more issues should be fixed first.
|
|
22
|
-
- `Stop`: a core assumption is unproven or the blast radius is too high.
|
|
23
|
-
|
|
24
|
-
## Boundaries
|
|
25
|
-
|
|
26
|
-
- Do not insult, mock, or psychoanalyze the user.
|
|
27
|
-
- Do not turn every normal coding task into a cross-examination.
|
|
28
|
-
- Do not invent requirements. If context is missing, ask for the missing artifact or state the assumption.
|
|
29
|
-
- Prefer concrete tests, rollback paths, and observable acceptance criteria over vague caution.
|
|
30
|
-
|
|
1
|
+
---
|
|
2
|
+
name: grill-me
|
|
3
|
+
description: Optional pressure-test mode for plans, architecture choices, PRs, launches, and product ideas: challenge assumptions without changing the default collaborative workflow.
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use this skill only when the user explicitly asks to be grilled, challenged, pressure-tested, stress-tested, or reviewed with unusually direct scrutiny.
|
|
8
|
+
|
|
9
|
+
## Stance
|
|
10
|
+
|
|
11
|
+
Be direct, but keep the target clear: challenge the work, not the person. The goal is better judgment, not dominance or theater.
|
|
12
|
+
|
|
13
|
+
## Process
|
|
14
|
+
|
|
15
|
+
1. Identify the claim, plan, design, PR, launch, or decision under review.
|
|
16
|
+
2. State the highest-risk assumption first.
|
|
17
|
+
3. Ask 3-7 pointed questions, ordered by risk.
|
|
18
|
+
4. Call out missing evidence, weak verification, unclear ownership, rollback gaps, and hidden dependencies.
|
|
19
|
+
5. End with a short verdict:
|
|
20
|
+
- `Ship`: risks are understood and verification is credible.
|
|
21
|
+
- `Revise`: the direction is good, but one or more issues should be fixed first.
|
|
22
|
+
- `Stop`: a core assumption is unproven or the blast radius is too high.
|
|
23
|
+
|
|
24
|
+
## Boundaries
|
|
25
|
+
|
|
26
|
+
- Do not insult, mock, or psychoanalyze the user.
|
|
27
|
+
- Do not turn every normal coding task into a cross-examination.
|
|
28
|
+
- Do not invent requirements. If context is missing, ask for the missing artifact or state the assumption.
|
|
29
|
+
- Prefer concrete tests, rollback paths, and observable acceptance criteria over vague caution.
|
|
30
|
+
|
|
@@ -1,82 +1,82 @@
|
|
|
1
|
-
---
|
|
2
|
-
name: superpowers-lite
|
|
3
|
-
description: Concise workflow skill tuned for 30B-class models: prefer structured code tools first, keep context tight, use sub-agents for narrow tasks, and verify before claiming success.
|
|
4
|
-
version: 0.3.0
|
|
5
|
-
---
|
|
6
|
-
|
|
7
|
-
Use this skill as the default operating style for all coding work, preferring lightweight approaches but invoking specialized skills when needed.
|
|
8
|
-
|
|
9
|
-
This is the default, not an interrogation mode. Keep help calm and direct. For decisions that affect multiple systems, involve irreversible changes, or have significant user impact only, add a light Grill Me pass: ask 1-3 sharp questions about assumptions, failure modes, or verification before proceeding. Challenge the plan, not the person.
|
|
10
|
-
|
|
11
|
-
**Announce when using a skill:** Before following any route below, say "Using [skill name] to [purpose]" in your response. This signals intent and prevents silent skill skipping.
|
|
12
|
-
|
|
13
|
-
## Mandatory Skill Check
|
|
14
|
-
|
|
15
|
-
Before responding to ANY user message, check whether a skill applies. If there is even a small chance a skill is relevant, YOU MUST invoke it. This is not optional.
|
|
16
|
-
|
|
17
|
-
**Skill check comes BEFORE:**
|
|
18
|
-
|
|
19
|
-
- Clarifying questions
|
|
20
|
-
- Code exploration
|
|
21
|
-
- Writing code
|
|
22
|
-
- Anything else
|
|
23
|
-
|
|
24
|
-
## Anti-Rationalization
|
|
25
|
-
|
|
26
|
-
If you catch yourself thinking any of the following, STOP — you are about to skip a skill incorrectly:
|
|
27
|
-
|
|
28
|
-
| Thought | Reality |
|
|
29
|
-
| ----------------------------------- | --------------------------------------------------- |
|
|
30
|
-
| "This is too simple for a skill" | Simple tasks derail too. Use the skill. |
|
|
31
|
-
| "I need more context first" | Skills tell you HOW to gather context. Check first. |
|
|
32
|
-
| "The skill is overkill here" | A lightweight pass is cheaper than rework. |
|
|
33
|
-
| "I'll just do this one thing first" | Do the skill check BEFORE anything. |
|
|
34
|
-
| "I already know what to do" | Knowing the concept ≠ following the process. |
|
|
35
|
-
|
|
36
|
-
## Routing
|
|
37
|
-
|
|
38
|
-
Evaluate the user's request and YOU MUST follow exactly one route:
|
|
39
|
-
|
|
40
|
-
| Condition | Action |
|
|
41
|
-
| ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
-
| Task is clear, small, and obvious path | Execute directly. Do NOT invoke brainstorming. |
|
|
43
|
-
| Non-trivial implementation that needs codebase exploration, touches multiple areas, or changes shared behavior | YOU MUST invoke `writing-plans` skill. Inspect first, then present an implementation plan for approval. Do NOT jump straight into coding. |
|
|
44
|
-
| Goal is clear but multiple reasonable approaches exist and the missing piece is user preference or tradeoff choice | YOU MUST invoke `brainstorm` skill. Follow brainstorm process — do NOT substitute it with ad-hoc questions. |
|
|
45
|
-
| Request is missing a key constraint or success condition | Ask exactly one clarifying question. Do NOT give options or write code. Stop and wait for the answer. |
|
|
46
|
-
| Request is greenfield and underspecified ("build a page", "make a site", "generate an app") | Treat as missing key constraints. Ask one high-value question. Do NOT assume features, scope, or storage model. Stop and wait for the answer. |
|
|
47
|
-
|
|
48
|
-
**Decision boundary:**
|
|
49
|
-
|
|
50
|
-
- Use `brainstorm` when one focused user answer will determine the direction.
|
|
51
|
-
- Use `writing-plans` when the task is implementation-shaped but needs a plan before coding.
|
|
52
|
-
- If both could apply, prefer `brainstorm` first when the core uncertainty is user intent; prefer `writing-plans` first when the core uncertainty is codebase impact.
|
|
53
|
-
|
|
54
|
-
## Tool Order
|
|
55
|
-
|
|
56
|
-
- Prefer `grep` first for content search and candidate discovery
|
|
57
|
-
- Use `read` to inspect the smallest useful code block
|
|
58
|
-
- Use `edit` for minimal focused edits or whole-file rewrites
|
|
59
|
-
- Use `glob` when you need file or directory discovery
|
|
60
|
-
- Use shell search (`rg`) only as a fallback
|
|
61
|
-
|
|
62
|
-
## Core Rules
|
|
63
|
-
|
|
64
|
-
1. **Search first.** Start with `grep`, then `read`. Fall back to shell only when structured tools aren't enough.
|
|
65
|
-
|
|
66
|
-
2. **Keep context tight.** Do not carry full conversation history into every step. Summarize and narrow scope.
|
|
67
|
-
|
|
68
|
-
3. **Prefer narrow sub-agents.** When a task splits cleanly, delegate to sub-agents with: one clear objective, tiny context, concrete expected output.
|
|
69
|
-
|
|
70
|
-
4. **Do not code against unclear requirements.** Missing constraint → ask one question. Multiple approaches → `brainstorm`. Clear enough → proceed.
|
|
71
|
-
|
|
72
|
-
5. **Verify before claiming success.** Run the relevant test or command before saying work is done.
|
|
73
|
-
|
|
74
|
-
6. **Use sharp questions sparingly.** For high-risk work, ask 1-3 sharp questions that expose assumptions or likely failure modes. For ordinary tasks, stay lightweight and keep moving.
|
|
75
|
-
|
|
76
|
-
## Sub-agent Guidance
|
|
77
|
-
|
|
78
|
-
- `planner`: break work into steps, risks, and checks
|
|
79
|
-
- `coder`: implement one bounded change
|
|
80
|
-
- `reviewer`: look for bugs, regressions, and missing verification
|
|
81
|
-
|
|
82
|
-
If the task is simple, stay lightweight. Do not expand into ceremony unless the problem needs it.
|
|
1
|
+
---
|
|
2
|
+
name: superpowers-lite
|
|
3
|
+
description: Concise workflow skill tuned for 30B-class models: prefer structured code tools first, keep context tight, use sub-agents for narrow tasks, and verify before claiming success.
|
|
4
|
+
version: 0.3.0
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
Use this skill as the default operating style for all coding work, preferring lightweight approaches but invoking specialized skills when needed.
|
|
8
|
+
|
|
9
|
+
This is the default, not an interrogation mode. Keep help calm and direct. For decisions that affect multiple systems, involve irreversible changes, or have significant user impact only, add a light Grill Me pass: ask 1-3 sharp questions about assumptions, failure modes, or verification before proceeding. Challenge the plan, not the person.
|
|
10
|
+
|
|
11
|
+
**Announce when using a skill:** Before following any route below, say "Using [skill name] to [purpose]" in your response. This signals intent and prevents silent skill skipping.
|
|
12
|
+
|
|
13
|
+
## Mandatory Skill Check
|
|
14
|
+
|
|
15
|
+
Before responding to ANY user message, check whether a skill applies. If there is even a small chance a skill is relevant, YOU MUST invoke it. This is not optional.
|
|
16
|
+
|
|
17
|
+
**Skill check comes BEFORE:**
|
|
18
|
+
|
|
19
|
+
- Clarifying questions
|
|
20
|
+
- Code exploration
|
|
21
|
+
- Writing code
|
|
22
|
+
- Anything else
|
|
23
|
+
|
|
24
|
+
## Anti-Rationalization
|
|
25
|
+
|
|
26
|
+
If you catch yourself thinking any of the following, STOP — you are about to skip a skill incorrectly:
|
|
27
|
+
|
|
28
|
+
| Thought | Reality |
|
|
29
|
+
| ----------------------------------- | --------------------------------------------------- |
|
|
30
|
+
| "This is too simple for a skill" | Simple tasks derail too. Use the skill. |
|
|
31
|
+
| "I need more context first" | Skills tell you HOW to gather context. Check first. |
|
|
32
|
+
| "The skill is overkill here" | A lightweight pass is cheaper than rework. |
|
|
33
|
+
| "I'll just do this one thing first" | Do the skill check BEFORE anything. |
|
|
34
|
+
| "I already know what to do" | Knowing the concept ≠ following the process. |
|
|
35
|
+
|
|
36
|
+
## Routing
|
|
37
|
+
|
|
38
|
+
Evaluate the user's request and YOU MUST follow exactly one route:
|
|
39
|
+
|
|
40
|
+
| Condition | Action |
|
|
41
|
+
| ------------------------------------------------------------------------------------------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
42
|
+
| Task is clear, small, and obvious path | Execute directly. Do NOT invoke brainstorming. |
|
|
43
|
+
| Non-trivial implementation that needs codebase exploration, touches multiple areas, or changes shared behavior | YOU MUST invoke `writing-plans` skill. Inspect first, then present an implementation plan for approval. Do NOT jump straight into coding. |
|
|
44
|
+
| Goal is clear but multiple reasonable approaches exist and the missing piece is user preference or tradeoff choice | YOU MUST invoke `brainstorm` skill. Follow brainstorm process — do NOT substitute it with ad-hoc questions. |
|
|
45
|
+
| Request is missing a key constraint or success condition | Ask exactly one clarifying question. Do NOT give options or write code. Stop and wait for the answer. |
|
|
46
|
+
| Request is greenfield and underspecified ("build a page", "make a site", "generate an app") | Treat as missing key constraints. Ask one high-value question. Do NOT assume features, scope, or storage model. Stop and wait for the answer. |
|
|
47
|
+
|
|
48
|
+
**Decision boundary:**
|
|
49
|
+
|
|
50
|
+
- Use `brainstorm` when one focused user answer will determine the direction.
|
|
51
|
+
- Use `writing-plans` when the task is implementation-shaped but needs a plan before coding.
|
|
52
|
+
- If both could apply, prefer `brainstorm` first when the core uncertainty is user intent; prefer `writing-plans` first when the core uncertainty is codebase impact.
|
|
53
|
+
|
|
54
|
+
## Tool Order
|
|
55
|
+
|
|
56
|
+
- Prefer `grep` first for content search and candidate discovery
|
|
57
|
+
- Use `read` to inspect the smallest useful code block
|
|
58
|
+
- Use `edit` for minimal focused edits or whole-file rewrites
|
|
59
|
+
- Use `glob` when you need file or directory discovery
|
|
60
|
+
- Use shell search (`rg`) only as a fallback
|
|
61
|
+
|
|
62
|
+
## Core Rules
|
|
63
|
+
|
|
64
|
+
1. **Search first.** Start with `grep`, then `read`. Fall back to shell only when structured tools aren't enough.
|
|
65
|
+
|
|
66
|
+
2. **Keep context tight.** Do not carry full conversation history into every step. Summarize and narrow scope.
|
|
67
|
+
|
|
68
|
+
3. **Prefer narrow sub-agents.** When a task splits cleanly, delegate to sub-agents with: one clear objective, tiny context, concrete expected output.
|
|
69
|
+
|
|
70
|
+
4. **Do not code against unclear requirements.** Missing constraint → ask one question. Multiple approaches → `brainstorm`. Clear enough → proceed.
|
|
71
|
+
|
|
72
|
+
5. **Verify before claiming success.** Run the relevant test or command before saying work is done.
|
|
73
|
+
|
|
74
|
+
6. **Use sharp questions sparingly.** For high-risk work, ask 1-3 sharp questions that expose assumptions or likely failure modes. For ordinary tasks, stay lightweight and keep moving.
|
|
75
|
+
|
|
76
|
+
## Sub-agent Guidance
|
|
77
|
+
|
|
78
|
+
- `planner`: break work into steps, risks, and checks
|
|
79
|
+
- `coder`: implement one bounded change
|
|
80
|
+
- `reviewer`: look for bugs, regressions, and missing verification
|
|
81
|
+
|
|
82
|
+
If the task is simple, stay lightweight. Do not expand into ceremony unless the problem needs it.
|
package/src/cli.js
CHANGED
|
@@ -1,74 +1,74 @@
|
|
|
1
|
-
import { handleChat } from './commands/chat.js';
|
|
2
|
-
import { handleRun } from './commands/run.js';
|
|
3
|
-
import { handleConfig } from './commands/config.js';
|
|
4
|
-
import { handleDoctor } from './commands/doctor.js';
|
|
5
|
-
import { handleSkill } from './commands/skill.js';
|
|
6
|
-
import { handleWeb } from './commands/web.js';
|
|
7
|
-
import { VERSION } from './core/version.js';
|
|
8
|
-
|
|
9
|
-
function printHelp() {
|
|
10
|
-
console.log(`codemini ${VERSION}
|
|
11
|
-
Usage:
|
|
12
|
-
codemini [prompt] [--plain] [--model <name>] [--fast]
|
|
13
|
-
codemini chat [prompt] [--plain] [--model <name>] [--fast]
|
|
14
|
-
codemini run <task> [--max-steps N] [--model <name>] [--fast]
|
|
15
|
-
codemini run --harness <role> <task> [--max-steps N] [--model <name>] [--fast]
|
|
16
|
-
codemini run --pipeline <task> [--model <name>] [--fast]
|
|
17
|
-
codemini web [--port <port>] [--project <path>] [--session <id>] [--model <name>] [--no-open]
|
|
18
|
-
codemini --web [--port <port>] [--project <path>] [--session <id>] [--model <name>] [--no-open]
|
|
19
|
-
codemini config set|get|list <key> [value]
|
|
20
|
-
codemini doctor
|
|
21
|
-
codemini skill list|install|enable|disable|inspect|reindex [--scope=project|global]
|
|
22
|
-
codemini --version
|
|
23
|
-
codemini --help`);
|
|
24
|
-
}
|
|
25
|
-
|
|
26
|
-
export async function runCli(args) {
|
|
27
|
-
const [command, ...rest] = args;
|
|
28
|
-
const knownCommands = new Set(['chat', 'run', 'config', 'doctor', 'skill', 'web']);
|
|
29
|
-
|
|
30
|
-
if (!command || command === '--help' || command === '-h') {
|
|
31
|
-
if (!command) {
|
|
32
|
-
await handleChat([]);
|
|
33
|
-
return;
|
|
34
|
-
}
|
|
35
|
-
printHelp();
|
|
36
|
-
return;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
if (command === '--version' || command === '-v' || command === 'version') {
|
|
40
|
-
console.log(VERSION);
|
|
41
|
-
return;
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (command === '--web' || command === '-web') {
|
|
45
|
-
await handleWeb(rest);
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
|
|
49
|
-
if (!knownCommands.has(command)) {
|
|
50
|
-
await handleChat(args);
|
|
51
|
-
return;
|
|
52
|
-
}
|
|
53
|
-
|
|
54
|
-
switch (command) {
|
|
55
|
-
case 'chat':
|
|
56
|
-
await handleChat(rest);
|
|
57
|
-
return;
|
|
58
|
-
case 'run':
|
|
59
|
-
await handleRun(rest);
|
|
60
|
-
return;
|
|
61
|
-
case 'config':
|
|
62
|
-
await handleConfig(rest);
|
|
63
|
-
return;
|
|
64
|
-
case 'doctor':
|
|
65
|
-
await handleDoctor();
|
|
66
|
-
return;
|
|
67
|
-
case 'skill':
|
|
68
|
-
await handleSkill(rest);
|
|
69
|
-
return;
|
|
70
|
-
case 'web':
|
|
71
|
-
await handleWeb(rest);
|
|
72
|
-
return;
|
|
73
|
-
}
|
|
74
|
-
}
|
|
1
|
+
import { handleChat } from './commands/chat.js';
|
|
2
|
+
import { handleRun } from './commands/run.js';
|
|
3
|
+
import { handleConfig } from './commands/config.js';
|
|
4
|
+
import { handleDoctor } from './commands/doctor.js';
|
|
5
|
+
import { handleSkill } from './commands/skill.js';
|
|
6
|
+
import { handleWeb } from './commands/web.js';
|
|
7
|
+
import { VERSION } from './core/version.js';
|
|
8
|
+
|
|
9
|
+
function printHelp() {
|
|
10
|
+
console.log(`codemini ${VERSION}
|
|
11
|
+
Usage:
|
|
12
|
+
codemini [prompt] [--plain] [--model <name>] [--fast]
|
|
13
|
+
codemini chat [prompt] [--plain] [--model <name>] [--fast]
|
|
14
|
+
codemini run <task> [--max-steps N] [--model <name>] [--fast]
|
|
15
|
+
codemini run --harness <role> <task> [--max-steps N] [--model <name>] [--fast]
|
|
16
|
+
codemini run --pipeline <task> [--model <name>] [--fast]
|
|
17
|
+
codemini web [--port <port>] [--project <path>] [--session <id>] [--model <name>] [--no-open]
|
|
18
|
+
codemini --web [--port <port>] [--project <path>] [--session <id>] [--model <name>] [--no-open]
|
|
19
|
+
codemini config set|get|list <key> [value]
|
|
20
|
+
codemini doctor
|
|
21
|
+
codemini skill list|install|enable|disable|inspect|reindex [--scope=project|global]
|
|
22
|
+
codemini --version
|
|
23
|
+
codemini --help`);
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function runCli(args) {
|
|
27
|
+
const [command, ...rest] = args;
|
|
28
|
+
const knownCommands = new Set(['chat', 'run', 'config', 'doctor', 'skill', 'web']);
|
|
29
|
+
|
|
30
|
+
if (!command || command === '--help' || command === '-h') {
|
|
31
|
+
if (!command) {
|
|
32
|
+
await handleChat([]);
|
|
33
|
+
return;
|
|
34
|
+
}
|
|
35
|
+
printHelp();
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
if (command === '--version' || command === '-v' || command === 'version') {
|
|
40
|
+
console.log(VERSION);
|
|
41
|
+
return;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
if (command === '--web' || command === '-web') {
|
|
45
|
+
await handleWeb(rest);
|
|
46
|
+
return;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
if (!knownCommands.has(command)) {
|
|
50
|
+
await handleChat(args);
|
|
51
|
+
return;
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
switch (command) {
|
|
55
|
+
case 'chat':
|
|
56
|
+
await handleChat(rest);
|
|
57
|
+
return;
|
|
58
|
+
case 'run':
|
|
59
|
+
await handleRun(rest);
|
|
60
|
+
return;
|
|
61
|
+
case 'config':
|
|
62
|
+
await handleConfig(rest);
|
|
63
|
+
return;
|
|
64
|
+
case 'doctor':
|
|
65
|
+
await handleDoctor();
|
|
66
|
+
return;
|
|
67
|
+
case 'skill':
|
|
68
|
+
await handleSkill(rest);
|
|
69
|
+
return;
|
|
70
|
+
case 'web':
|
|
71
|
+
await handleWeb(rest);
|
|
72
|
+
return;
|
|
73
|
+
}
|
|
74
|
+
}
|