Skip to content

feat: show config settings and AI prompt in metadata output - #22

Merged
drugoi merged 3 commits into
mainfrom
extended-metadata
Apr 2, 2026
Merged

drugoi merged 3 commits into
mainfrom
extended-metadata

Conversation

@maximgorbatyuk

Copy link
Copy Markdown
Collaborator

Summary

  • The metadata command now displays all configuration settings after the existing database/hooks info: AI provider, model, API key (masked), CLI preference, prompt instructions, and auto-update flag
  • When no custom prompt is configured, the full default prompt is shown (labeled default); when a custom one is set via ai.prompt_instructions, it is displayed in full (labeled custom)
  • API keys are masked for security — only first 4 and last 4 characters are visible (e.g. sk-a…cdef)
  • Extracted the default prompt instructions into a DEFAULT_PROMPT_INSTRUCTIONS constant in src/ai/mod.rs, reused in both build_prompt and metadata display

Example output

Database size:   1.25 MB
Total commits:   42
Oldest commit:   2026-01-15 09:30:00

Global hooks:    /Users/me/.config/diddo/hooks (ok)
Local hooks:     not set

AI provider:     anthropic
AI model:        claude-sonnet-4-6
AI API key:      sk-a…cdef
CLI preference:  api
Prompt (default):
Using only the commit data provided, produce a concise repository-based summary of changes.

Format:
...
Guidelines:
- Group commits by repository.
- Convert commit messages into short, clear descriptions of what changed.
...

Auto-update:     true

Test plan

  • All 201 existing tests pass
  • Clippy clean
  • New tests: metadata_shows_config_settings, metadata_shows_defaults_when_config_is_empty, mask_api_key_hides_middle_of_long_keys

@maximgorbatyuk
maximgorbatyuk requested a review from drugoi April 2, 2026 14:58
@drugoi

drugoi commented Apr 2, 2026

Copy link
Copy Markdown
Owner

@cursor let's check this PR

@cursor

cursor Bot commented Apr 2, 2026 •

Copy link
Copy Markdown

Here is what I did for “let’s check this PR” on extended-metadata / #22.

Review

  • Metadata feature matches the description: format_metadata appends resolved AI settings, masked API keys (mask_api_key), default vs custom prompt via ai::DEFAULT_PROMPT_INSTRUCTIONS, and update.auto_check.
  • Tests (metadata_shows_config_settings, metadata_shows_defaults_when_config_is_empty, mask_api_key_hides_middle_of_long_keys) line up with that behavior.

Verification

  • cargo test — 201 passed
  • cargo fmt -- --check — clean
  • cargo clippy --all-targets --all-features — initially 2 warnings in src/interactive.rs tests (clippy::field_reassign_with_default), unrelated to metadata but worth fixing for strict CI.

Change pushed

  • Updated two range-form tests to use RangeFormState { from: ..., ..Default::default() } instead of default() then assigning from.
  • Commit: style: fix clippy field_reassign_with_default in interactive tests — pushed to origin/extended-metadata.

I could not update the GitHub PR description from here (platform reported the body is not agent-managed). You can paste a short note manually if you want the test plan to mention clippy --all-targets is now warning-free.

Open in Web Open in Cursor 

Co-authored-by: Nikita Bayev <nikita@bayev.kz>
@drugoi
drugoi merged commit e94e488 into main Apr 2, 2026
1 check passed
@maximgorbatyuk
maximgorbatyuk deleted the extended-metadata branch April 2, 2026 15:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants