diff --git a/src/commands/config.ts b/src/commands/config.ts index 8fcb2da..5d78b91 100644 --- a/src/commands/config.ts +++ b/src/commands/config.ts @@ -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(); diff --git a/tests/config-command.test.mjs b/tests/config-command.test.mjs index 726e3f4..6b39ff7 100644 --- a/tests/config-command.test.mjs +++ b/tests/config-command.test.mjs @@ -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/); }); @@ -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/); + }); +}); + +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 });