mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-20 21:02:02 +00:00
Merge pull request #906 from Perlence/feat/verbose-cli-flag
feat(coding-agent): add --verbose CLI flag to override quietStartup setting (round 2)
This commit is contained in:
commit
b0d4d1717e
5 changed files with 19 additions and 3 deletions
|
|
@ -827,6 +827,7 @@ Global `~/.pi/agent/settings.json` stores persistent preferences:
|
||||||
| `shellPath` | Custom bash path (Windows) | auto-detected |
|
| `shellPath` | Custom bash path (Windows) | auto-detected |
|
||||||
| `shellCommandPrefix` | Command prefix for bash (e.g., `shopt -s expand_aliases` for alias support) | - |
|
| `shellCommandPrefix` | Command prefix for bash (e.g., `shopt -s expand_aliases` for alias support) | - |
|
||||||
| `hideThinkingBlock` | Hide thinking blocks in output (Ctrl+T to toggle) | `false` |
|
| `hideThinkingBlock` | Hide thinking blocks in output (Ctrl+T to toggle) | `false` |
|
||||||
|
| `quietStartup` | Hide startup info (keybindings, loaded skills/extensions) | `false` |
|
||||||
| `collapseChangelog` | Show condensed changelog after update | `false` |
|
| `collapseChangelog` | Show condensed changelog after update | `false` |
|
||||||
| `compaction.enabled` | Enable auto-compaction | `true` |
|
| `compaction.enabled` | Enable auto-compaction | `true` |
|
||||||
| `compaction.reserveTokens` | Tokens to reserve before compaction triggers | `16384` |
|
| `compaction.reserveTokens` | Tokens to reserve before compaction triggers | `16384` |
|
||||||
|
|
@ -1278,6 +1279,7 @@ pi [options] [@files...] [messages...]
|
||||||
| `--no-prompt-templates` | Disable prompt template discovery and loading |
|
| `--no-prompt-templates` | Disable prompt template discovery and loading |
|
||||||
| `--no-themes` | Disable theme discovery and loading |
|
| `--no-themes` | Disable theme discovery and loading |
|
||||||
| `--export <file> [output]` | Export session to HTML |
|
| `--export <file> [output]` | Export session to HTML |
|
||||||
|
| `--verbose` | Force verbose startup (overrides `quietStartup` setting) |
|
||||||
| `--help`, `-h` | Show help |
|
| `--help`, `-h` | Show help |
|
||||||
| `--version`, `-v` | Show version |
|
| `--version`, `-v` | Show version |
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -38,6 +38,7 @@ export interface Args {
|
||||||
themes?: string[];
|
themes?: string[];
|
||||||
noThemes?: boolean;
|
noThemes?: boolean;
|
||||||
listModels?: string | true;
|
listModels?: string | true;
|
||||||
|
verbose?: boolean;
|
||||||
messages: string[];
|
messages: string[];
|
||||||
fileArgs: string[];
|
fileArgs: string[];
|
||||||
/** Unknown flags (potentially extension flags) - map of flag name to value */
|
/** Unknown flags (potentially extension flags) - map of flag name to value */
|
||||||
|
|
@ -148,6 +149,8 @@ export function parseArgs(args: string[], extensionFlags?: Map<string, { type: "
|
||||||
} else {
|
} else {
|
||||||
result.listModels = true;
|
result.listModels = true;
|
||||||
}
|
}
|
||||||
|
} else if (arg === "--verbose") {
|
||||||
|
result.verbose = true;
|
||||||
} else if (arg.startsWith("@")) {
|
} else if (arg.startsWith("@")) {
|
||||||
result.fileArgs.push(arg.slice(1)); // Remove @ prefix
|
result.fileArgs.push(arg.slice(1)); // Remove @ prefix
|
||||||
} else if (arg.startsWith("--") && extensionFlags) {
|
} else if (arg.startsWith("--") && extensionFlags) {
|
||||||
|
|
@ -211,6 +214,7 @@ ${chalk.bold("Options:")}
|
||||||
--no-themes Disable theme discovery and loading
|
--no-themes Disable theme discovery and loading
|
||||||
--export <file> Export session file to HTML and exit
|
--export <file> Export session file to HTML and exit
|
||||||
--list-models [search] List available models (with optional fuzzy search)
|
--list-models [search] List available models (with optional fuzzy search)
|
||||||
|
--verbose Force verbose startup (overrides quietStartup setting)
|
||||||
--help, -h Show this help
|
--help, -h Show this help
|
||||||
--version, -v Show version number
|
--version, -v Show version number
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -582,7 +582,7 @@ export async function main(args: string[]) {
|
||||||
if (mode === "rpc") {
|
if (mode === "rpc") {
|
||||||
await runRpcMode(session);
|
await runRpcMode(session);
|
||||||
} else if (isInteractive) {
|
} else if (isInteractive) {
|
||||||
if (scopedModels.length > 0 && !settingsManager.getQuietStartup()) {
|
if (scopedModels.length > 0 && (parsed.verbose || !settingsManager.getQuietStartup())) {
|
||||||
const modelList = scopedModels
|
const modelList = scopedModels
|
||||||
.map((sm) => {
|
.map((sm) => {
|
||||||
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
||||||
|
|
@ -599,6 +599,7 @@ export async function main(args: string[]) {
|
||||||
initialMessage,
|
initialMessage,
|
||||||
initialImages,
|
initialImages,
|
||||||
initialMessages: parsed.messages,
|
initialMessages: parsed.messages,
|
||||||
|
verbose: parsed.verbose,
|
||||||
});
|
});
|
||||||
await mode.run();
|
await mode.run();
|
||||||
} else {
|
} else {
|
||||||
|
|
|
||||||
|
|
@ -138,6 +138,8 @@ export interface InteractiveModeOptions {
|
||||||
initialImages?: ImageContent[];
|
initialImages?: ImageContent[];
|
||||||
/** Additional messages to send after the initial message */
|
/** Additional messages to send after the initial message */
|
||||||
initialMessages?: string[];
|
initialMessages?: string[];
|
||||||
|
/** Force verbose startup (overrides quietStartup setting) */
|
||||||
|
verbose?: boolean;
|
||||||
}
|
}
|
||||||
|
|
||||||
export class InteractiveMode {
|
export class InteractiveMode {
|
||||||
|
|
@ -373,7 +375,7 @@ export class InteractiveMode {
|
||||||
this.setupAutocomplete(this.fdPath);
|
this.setupAutocomplete(this.fdPath);
|
||||||
|
|
||||||
// Add header with keybindings from config (unless silenced)
|
// Add header with keybindings from config (unless silenced)
|
||||||
if (!this.settingsManager.getQuietStartup()) {
|
if (this.options.verbose || !this.settingsManager.getQuietStartup()) {
|
||||||
const logo = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
|
const logo = theme.bold(theme.fg("accent", APP_NAME)) + theme.fg("dim", ` v${this.version}`);
|
||||||
|
|
||||||
// Build startup instructions using keybinding hint helpers
|
// Build startup instructions using keybinding hint helpers
|
||||||
|
|
@ -642,7 +644,7 @@ export class InteractiveMode {
|
||||||
}
|
}
|
||||||
|
|
||||||
private showLoadedResources(options?: { extensionPaths?: string[]; force?: boolean }): void {
|
private showLoadedResources(options?: { extensionPaths?: string[]; force?: boolean }): void {
|
||||||
const shouldShow = options?.force || !this.settingsManager.getQuietStartup();
|
const shouldShow = options?.force || this.options.verbose || !this.settingsManager.getQuietStartup();
|
||||||
if (!shouldShow) {
|
if (!shouldShow) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -220,6 +220,13 @@ describe("parseArgs", () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe("--verbose flag", () => {
|
||||||
|
test("parses --verbose flag", () => {
|
||||||
|
const result = parseArgs(["--verbose"]);
|
||||||
|
expect(result.verbose).toBe(true);
|
||||||
|
});
|
||||||
|
});
|
||||||
|
|
||||||
describe("--no-tools flag", () => {
|
describe("--no-tools flag", () => {
|
||||||
test("parses --no-tools flag", () => {
|
test("parses --no-tools flag", () => {
|
||||||
const result = parseArgs(["--no-tools"]);
|
const result = parseArgs(["--no-tools"]);
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue