Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions apps/cli/src/cli.ts
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,8 @@ async function main(): Promise<number> {
resumeId: args.resumeId,
continueSession: args.continue,
forkSession: args.forkSession,
bare: args.bare,
noPlugins: args.noPlugins,
});
}

Expand Down
56 changes: 37 additions & 19 deletions apps/cli/src/repl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,10 @@ export interface ReplOpts {
continueSession?: boolean;
/** `--fork-session` → resume into a NEW session, leaving the source intact. */
forkSession?: boolean;
/** `--bare` → suppress the startup banner (scripting / minimal output). */
bare?: boolean;
/** `--no-plugins` → skip discovering + wiring installed plugins. */
noPlugins?: boolean;
}

const DEFAULT_SYSTEM_PROMPT = `You are DeepCode, an AI coding assistant powered by DeepSeek. Help the user with their codebase using the available tools (Read, Write, Edit, Bash, Grep, Glob). Be concise and accurate. When you modify files, briefly explain what you changed and why.`;
Expand Down Expand Up @@ -274,10 +278,17 @@ export async function startRepl(opts: ReplOpts): Promise<number> {
const commands = new CommandRegistry();
// Trusted+enabled plugins contribute skills / sub-agents / commands (their
// dirs) + MCP servers. Hooks are merged separately by wirePlugins.
const pluginContrib = await collectPluginContributions({
home: opts.home,
disabled: settings.disabledPlugins,
});
// `--no-plugins` skips discovery entirely (faster start / bypass a bad plugin).
const emptyContrib: Awaited<ReturnType<typeof collectPluginContributions>> = {
dirs: [],
mcpServers: {},
};
const pluginContrib = opts.noPlugins
? emptyContrib
: await collectPluginContributions({
home: opts.home,
disabled: settings.disabledPlugins,
});
// Custom prompt-template commands from plugin + user + project commands dirs.
const customCommands = await loadSlashCommands({
cwd,
Expand Down Expand Up @@ -395,19 +406,22 @@ export async function startRepl(opts: ReplOpts): Promise<number> {
allowedHttpHookUrls: settings.allowedHttpHookUrls,
});

// M5.2: wire installed plugins (discover + spawn + merge contributed hooks)
// M5.2: wire installed plugins (discover + spawn + merge contributed hooks).
// `--no-plugins` skips this entirely.
let pluginsWire: WireResult | null = null;
try {
pluginsWire = await wirePlugins({
home: opts.home,
disabled: settings.disabledPlugins,
hooks,
capabilities: buildPluginCapabilities(cwd),
sandbox: settings.sandbox,
log: (s) => output.write(s + '\n'),
});
} catch (err) {
output.write(` ⊞ Plugins: wire-up failed — ${(err as Error).message}\n`);
if (!opts.noPlugins) {
try {
pluginsWire = await wirePlugins({
home: opts.home,
disabled: settings.disabledPlugins,
hooks,
capabilities: buildPluginCapabilities(cwd),
sandbox: settings.sandbox,
log: (s) => output.write(s + '\n'),
});
} catch (err) {
output.write(` ⊞ Plugins: wire-up failed — ${(err as Error).message}\n`);
}
}

let history: StoredMessage[] = resolved.seededHistory;
Expand Down Expand Up @@ -439,9 +453,13 @@ export async function startRepl(opts: ReplOpts): Promise<number> {
history,
};

output.write(`\n ▎ DeepCode · ${ctx.model} · mode: ${ctx.mode} · effort: ${ctx.effort}\n`);
output.write(` Working in ${cwd}\n`);
output.write(` Type /help for commands, /exit to quit.\n\n`);
if (!opts.bare) {
output.write(
`\n ▎ DeepCode · ${ctx.model} · mode: ${ctx.mode} · effort: ${ctx.effort}\n`,
);
output.write(` Working in ${cwd}\n`);
output.write(` Type /help for commands, /exit to quit.\n\n`);
}

const rl = createInterface({ input: opts.input, output, terminal: true });

Expand Down
13 changes: 7 additions & 6 deletions docs/BEHAVIOR_PARITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,10 @@ Legend: `✅` matches · `🟡` matches with caveats · `🔄` deferred · `⚠
> `/release-notes`, and `/bug` (alias `/feedback`) slash commands (PR #150);
> `--resume` / `--continue` / `--fork-session` wired to real session resume
> (PR #153); the `/init` 3-phase REPL flow; and the CLI `/effort` table reading
> its numbers from `EFFORT_PARAMS` (PR #147). Caveat: `--permission-mode` is
> parsed but **not yet wired**. The Tools table (de-staled in PR #151) was
> re-verified row-by-row this pass — all markers hold.
> its numbers from `EFFORT_PARAMS` (PR #147); `--permission-mode` wired as a
> true `--mode` alias (PR #159); and `--bare` / `--no-plugins` wired. The Tools
> table (de-staled in PR #151) was re-verified row-by-row this pass — all
> markers hold.

---

Expand Down Expand Up @@ -173,15 +174,15 @@ Specific deviations:
| ---------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------- |
| `--help` / `--version` | ✅ |
| `--mode` | ✅ |
| `--permission-mode` | 🔄parsed + validated as a `--mode` alias, but **not wired**: the value is currently ignored (pass `--mode`) |
| `--permission-mode` | true `--mode` alias (sets `mode`; last of `--mode`/`--permission-mode` wins), wired in PR #159 |
| `--model` / `--effort` | ✅ |
| `--max-turns` | ✅ |
| `-C` / `--cd <dir>` | ✅ — chdir before running (Codex parity); validated eagerly, bad path exits 2 |
| `--system-prompt` / `--append-system-prompt[-file]` | ✅ |
| `--allowedTools` / `--disallowedTools` | ✅ |
| `--bare` | 🔄 (parsed, semantics deferred) |
| `--bare` | ✅ — suppresses the REPL startup banner (scripting / minimal output) |
| `--settings` / `--agents` / `--mcp-config` / `--plugin-dir` / `--plugin-url` | 🔄 (parsed only) |
| `--no-plugins` / `--strict` | 🔄 (parsed only) |
| `--no-plugins` / `--strict` | 🟡 — `--no-plugins` skips plugin discovery + wiring; `--strict` still parsed-only |
| `-p` headless | ✅ text/json/stream-json, 5 exit codes |
| `--output-format` / `--json-schema` / `--include-partial-messages` | ✅ output-format + json-schema (lightweight top-level validation) + include-partial-messages all implemented (`headless.ts`) |
| `--resume <id>` / `--continue` / `--fork-session` | ✅ resume by id (picker if no id, `-r`), most-recent-in-cwd (`-c`), fork-into-new |
Expand Down
Loading