Skip to content

feat(cli): add config --dump to print fully resolved config as TOML#597

Merged
cpcloud merged 1 commit intomainfrom
worktree-melodic-watching-gadget
Mar 4, 2026
Merged

feat(cli): add config --dump to print fully resolved config as TOML#597
cpcloud merged 1 commit intomainfrom
worktree-melodic-watching-gadget

Conversation

@cpcloud
Copy link
Copy Markdown
Collaborator

@cpcloud cpcloud commented Mar 4, 2026

Summary

  • Add micasa config --dump to print the fully resolved configuration as valid, annotated TOML
  • Each field shows its env var (# env: MICASA_...) and marks active overrides (# src(env): ...)
  • API keys are omitted entirely from output to prevent accidental leakage
  • Deprecated fields (cache_ttl_days, extraction.model, extraction.thinking) show warnings with the replacement key and its resolved value (e.g. # DEPRECATED: use documents.cache_ttl = "14d")
  • Inline comments are column-aligned within each TOML section
  • Section headers include descriptions from doc struct tags (e.g. [llm] # LLM provider, model, and connection settings.)
  • Per-pipeline override sections ([llm.chat], [llm.extraction]) are only shown when non-empty
  • Add MarshalText to Duration and ByteSize for human-friendly TOML encoding
  • Document [llm.chat] and [llm.extraction] sections in reference docs; mark deprecated extraction fields

closes #415

@codecov
Copy link
Copy Markdown

codecov Bot commented Mar 4, 2026

Codecov Report

❌ Patch coverage is 79.21147% with 58 lines in your changes missing coverage. Please review.
✅ Project coverage is 76.25%. Comparing base (6b5594b) to head (15d37f2).
⚠️ Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
internal/config/show.go 80.66% 40 Missing and 12 partials ⚠️
cmd/micasa/main.go 0.00% 6 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #597      +/-   ##
==========================================
+ Coverage   76.20%   76.25%   +0.05%     
==========================================
  Files          63       64       +1     
  Lines       18776    19052     +276     
==========================================
+ Hits        14309    14529     +220     
- Misses       3788     3831      +43     
- Partials      679      692      +13     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@cpcloud cpcloud force-pushed the worktree-melodic-watching-gadget branch 2 times, most recently from 751a324 to 8f42ae8 Compare March 4, 2026 13:27
cpcloud added a commit that referenced this pull request Mar 4, 2026
Reflection-based walker produces annotated TOML directly from struct
tags (toml, env, doc), avoiding an encode-then-reparse pipeline. Each
field gets an inline comment showing its env var (and whether it's
actively overriding). Hidden paths (api_key) are redacted, deprecated
fields warn with the replacement key and its current value, and empty
override sections ([llm.chat], [llm.extraction]) are elided.

closes #597

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cpcloud cpcloud force-pushed the worktree-melodic-watching-gadget branch from 8f42ae8 to 12517e6 Compare March 4, 2026 14:16
cpcloud added a commit that referenced this pull request Mar 4, 2026
Reflection-based walker produces annotated TOML directly from struct
tags (toml, env, doc), avoiding an encode-then-reparse pipeline. Each
field gets an inline comment showing its env var (and whether it's
actively overriding). Hidden paths (api_key) are redacted, deprecated
fields warn with the replacement key and its current value, and empty
override sections ([llm.chat], [llm.extraction]) are elided.

closes #597

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cpcloud cpcloud force-pushed the worktree-melodic-watching-gadget branch 3 times, most recently from fce6572 to 60fb2cf Compare March 4, 2026 14:44
Reflection-based walker produces annotated TOML directly from struct
tags (toml, env, doc), avoiding an encode-then-reparse pipeline. Each
field gets an inline comment showing its env var (and whether it's
actively overriding). Hidden paths (api_key) are redacted, deprecated
fields warn with the replacement key and its current value, and empty
override sections ([llm.chat], [llm.extraction]) are elided.

closes #415

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@cpcloud cpcloud force-pushed the worktree-melodic-watching-gadget branch from 60fb2cf to 15d37f2 Compare March 4, 2026 14:46
@cpcloud cpcloud merged commit 13253ca into main Mar 4, 2026
18 checks passed
@cpcloud cpcloud deleted the worktree-melodic-watching-gadget branch March 4, 2026 14:57
cpcloud added a commit that referenced this pull request Mar 19, 2026
…597)

## Summary

- Add `micasa config --dump` to print the fully resolved configuration
as valid, annotated TOML
- Each field shows its env var (`# env: MICASA_...`) and marks active
overrides (`# src(env): ...`)
- API keys are omitted entirely from output to prevent accidental
leakage
- Deprecated fields (`cache_ttl_days`, `extraction.model`,
`extraction.thinking`) show warnings with the replacement key and its
resolved value (e.g. `# DEPRECATED: use documents.cache_ttl = "14d"`)
- Inline comments are column-aligned within each TOML section
- Section headers include descriptions from `doc` struct tags (e.g.
`[llm] # LLM provider, model, and connection settings.`)
- Per-pipeline override sections (`[llm.chat]`, `[llm.extraction]`) are
only shown when non-empty
- Add `MarshalText` to `Duration` and `ByteSize` for human-friendly TOML
encoding
- Document `[llm.chat]` and `[llm.extraction]` sections in reference
docs; mark deprecated extraction fields

closes #415

Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
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.

feat(cli): add --show-config flag to dump fully resolved config as TOML

1 participant