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
3 changes: 3 additions & 0 deletions src/commands/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,9 @@ export async function configCommand(options: ConfigCommandOptions = {}): Promise
console.log(` Endpoint: ${pc.dim(resolveEndpoint(config))}`);
console.log(` History size: ${pc.bold(String(config.historySize))}`);
console.log(` Max diff size: ${pc.bold(String(config.maxDiffSize))}`);
console.log(
` Prompt templates: system ${pc.dim(config.systemPromptTemplate ? 'custom' : 'default')}, user ${pc.dim(config.userPromptTemplate ? 'custom' : 'default')}`,
);
console.log(` API key: ${pc.dim(maskApiKey(config.apiKey))}`);
console.log();

Expand Down
28 changes: 28 additions & 0 deletions tests/config-command.test.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ test('config command displays the current configuration with a masked API key',
assert.match(output, /Endpoint:\s+https:\/\/api\.openai\.com\/v1/);
assert.match(output, /History size:\s+12/);
assert.match(output, /Max diff size:\s+4000/);
assert.match(output, /Prompt templates:\s+system default, user default/);
assert.match(output, /API key:\s+sk-t••••/);
assert.doesNotMatch(output, /sk-test-secret-value/);
});
Expand All @@ -129,6 +130,33 @@ test('config command displays a custom endpoint from the config file', async ()
});
});

test('config command reports custom prompt template status', async () => {
await withTempHome(async (homeDir) => {
writeConfig(homeDir, {
systemPromptTemplate: 'Use system instructions.',
userPromptTemplate: 'Use user instructions for {{diff}}.',
});

const { stdout, stderr } = await runConfig(homeDir);
const output = stdout + stderr;

assert.match(output, /Prompt templates:\s+system custom, user custom/);
Comment thread
404-Page-Found marked this conversation as resolved.
});
});

test('config command reports mixed prompt template status', async () => {
await withTempHome(async (homeDir) => {
writeConfig(homeDir, {
userPromptTemplate: 'Use user instructions for {{diff}}.',
});

const { stdout, stderr } = await runConfig(homeDir);
const output = stdout + stderr;

assert.match(output, /Prompt templates:\s+system default, user custom/);
});
});

test('config command reports when no API key is stored in config', async () => {
await withTempHome(async (homeDir) => {
writeConfig(homeDir, { apiKey: undefined });
Expand Down