mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 06:04:40 +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 |
|
||||
| `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` |
|
||||
| `quietStartup` | Hide startup info (keybindings, loaded skills/extensions) | `false` |
|
||||
| `collapseChangelog` | Show condensed changelog after update | `false` |
|
||||
| `compaction.enabled` | Enable auto-compaction | `true` |
|
||||
| `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-themes` | Disable theme discovery and loading |
|
||||
| `--export <file> [output]` | Export session to HTML |
|
||||
| `--verbose` | Force verbose startup (overrides `quietStartup` setting) |
|
||||
| `--help`, `-h` | Show help |
|
||||
| `--version`, `-v` | Show version |
|
||||
|
||||
|
|
|
|||
|
|
@ -38,6 +38,7 @@ export interface Args {
|
|||
themes?: string[];
|
||||
noThemes?: boolean;
|
||||
listModels?: string | true;
|
||||
verbose?: boolean;
|
||||
messages: string[];
|
||||
fileArgs: string[];
|
||||
/** 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 {
|
||||
result.listModels = true;
|
||||
}
|
||||
} else if (arg === "--verbose") {
|
||||
result.verbose = true;
|
||||
} else if (arg.startsWith("@")) {
|
||||
result.fileArgs.push(arg.slice(1)); // Remove @ prefix
|
||||
} else if (arg.startsWith("--") && extensionFlags) {
|
||||
|
|
@ -211,6 +214,7 @@ ${chalk.bold("Options:")}
|
|||
--no-themes Disable theme discovery and loading
|
||||
--export <file> Export session file to HTML and exit
|
||||
--list-models [search] List available models (with optional fuzzy search)
|
||||
--verbose Force verbose startup (overrides quietStartup setting)
|
||||
--help, -h Show this help
|
||||
--version, -v Show version number
|
||||
|
||||
|
|
|
|||
|
|
@ -582,7 +582,7 @@ export async function main(args: string[]) {
|
|||
if (mode === "rpc") {
|
||||
await runRpcMode(session);
|
||||
} else if (isInteractive) {
|
||||
if (scopedModels.length > 0 && !settingsManager.getQuietStartup()) {
|
||||
if (scopedModels.length > 0 && (parsed.verbose || !settingsManager.getQuietStartup())) {
|
||||
const modelList = scopedModels
|
||||
.map((sm) => {
|
||||
const thinkingStr = sm.thinkingLevel ? `:${sm.thinkingLevel}` : "";
|
||||
|
|
@ -599,6 +599,7 @@ export async function main(args: string[]) {
|
|||
initialMessage,
|
||||
initialImages,
|
||||
initialMessages: parsed.messages,
|
||||
verbose: parsed.verbose,
|
||||
});
|
||||
await mode.run();
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -138,6 +138,8 @@ export interface InteractiveModeOptions {
|
|||
initialImages?: ImageContent[];
|
||||
/** Additional messages to send after the initial message */
|
||||
initialMessages?: string[];
|
||||
/** Force verbose startup (overrides quietStartup setting) */
|
||||
verbose?: boolean;
|
||||
}
|
||||
|
||||
export class InteractiveMode {
|
||||
|
|
@ -373,7 +375,7 @@ export class InteractiveMode {
|
|||
this.setupAutocomplete(this.fdPath);
|
||||
|
||||
// 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}`);
|
||||
|
||||
// Build startup instructions using keybinding hint helpers
|
||||
|
|
@ -642,7 +644,7 @@ export class InteractiveMode {
|
|||
}
|
||||
|
||||
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) {
|
||||
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", () => {
|
||||
test("parses --no-tools flag", () => {
|
||||
const result = parseArgs(["--no-tools"]);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue