Skip to content

[CTX-2246] feat(cli): inspect and scaffold per-plugin settings - #2299

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-2246/feat-plugin-config
Oct 20, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-2246/feat-plugin-config

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Priority: P2 | Area: area:config | Labels: feat,P2,area:config | Milestone: 0.0.25 | RFC: CTX-1195 per-plugin config files | Task: CTX-2246

Closes #2246

Summary

Adds bitty plugin config show <id> and bitty plugin config scaffold <id> for per-plugin settings, following the corrected resolution model (<owner>.<name>.lua canonical → unambiguous <name>.lua alias → legacy <owner>.<name>.toml → manifest defaults).

  • config show <id> prints the declared [settings] schema (key, type, default, description when present), the canonical/alias/legacy candidate paths and the selected file, and every effective value with its serving layer (manifest-default, host, user-file). The bounded plain settings VM resolves the file exactly as activation does; the plugin VM is never created or executed.
  • config scaffold <id> writes a commented canonical Lua template from manifest defaults only. --init is the issue-shape alias. It refuses to overwrite without --force, always refuses symlinked targets and symlinked plugins/ directories, keeps the write inside the environment-derived config root, and commits atomically (create_new temp + hard-link no-clobber, or atomic rename with --force, mode 0600).
  • Typed, non-zero failures after the report prints: UnknownPlugin, SchemaUnreadable, ConfigRejected, UndeclaredKey, NoSettings, AlreadyExists, SymlinkTarget, InvalidTarget, UnsafePath (exit 4), IoError (exit 4).
  • JSON (--json / --format json) envelope for scripting.

Tests

  • bitty-runtime: per-key layer attribution, selected-file kind (canonical/alias/legacy/none), config path fail-closed rules.
  • bitty-terminal unit: parser shapes/aliases/conflicts, scaffold round-trip through the plain settings VM, hostile-default escaping, refuse-overwrite, no-settings, unsafe id, symlink target + symlink dir.
  • cli_plugin end-to-end: schema/source rendering, JSON envelope, canonical vs legacy selection, unknown plugin, undeclared key, malformed file, unreadable stored schema, scaffold round-trip → show, refuse-overwrite, --force, --init, symlink refusal, owner-only mode, no temp-file leftovers.

Gates

  • cargo fmt --all
  • cargo clippy --workspace --all-targets --locked -- -D warnings
  • cargo clippy -p bitty-terminal --features dev-tools --all-targets -- -D warnings
  • cargo nextest run -p bitty-terminal -p bitty-runtime -p bitty-config --locked (4337 passed, 3 skipped)
  • cargo check --target x86_64-pc-windows-gnu --workspace --all-targets --locked

Documentation follows in a docs-only bitty-terminal-docs PR.

@Xuepoo Xuepoo added this to the 0.0.25 milestone Oct 20, 2026
@Xuepoo Xuepoo added feat Feature area:config Area: configuration P2 Priority: medium labels Oct 20, 2026
@coderabbitai

coderabbitai Bot commented Oct 20, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 35 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available.

Learn how review limits work.

Review configuration:

⚙️ Run configuration
  • Configuration used: Repository UI (base), Organization UI (inherited)
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 3ccc4dda-444a-4638-9967-e2f436ec8b23
📥 Commits

Reviewing files that changed from the base of the PR and between 470c20a and e59a15e.

📒 Files selected for processing: 3
  • crates/bitty-runtime/src/plugin_runtime/plugin_settings.rs
  • crates/bitty-terminal/src/plugin.rs
  • crates/bitty-terminal/tests/cli_plugin.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@Xuepoo
Xuepoo merged commit c986ffa into main Oct 20, 2026
18 checks passed
@Xuepoo
Xuepoo deleted the ctx-2246/feat-plugin-config branch October 20, 2026 02:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:config Area: configuration feat Feature P2 Priority: medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[0.0.25] bitty plugin config: inspect and scaffold per-plugin TOML settings

1 participant