Skip to content

fix: config set support object value#1123

Open
linjinze999 wants to merge 2 commits into
Fission-AI:mainfrom
linjinze999:feat/config_set_object
Open

fix: config set support object value#1123
linjinze999 wants to merge 2 commits into
Fission-AI:mainfrom
linjinze999:feat/config_set_object

Conversation

@linjinze999
Copy link
Copy Markdown

@linjinze999 linjinze999 commented May 25, 2026

Summary by CodeRabbit

  • New Features

    • config set gains a --json flag to parse values as JSON.
    • Added --allow-unknown flag to bypass key-path validation.
  • Improvements

    • Prevents simultaneous use of --string and --json.
    • Validates values before saving.
    • Improved confirmation output: quoted strings and JSON-stringified objects/arrays.

Review Change Stack

@linjinze999 linjinze999 requested a review from TabishB as a code owner May 25, 2026 06:47
@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 25, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 29aa7800-ab4a-4351-a734-51dfcfae4e4a

📥 Commits

Reviewing files that changed from the base of the PR and between 11ea028 and 58ff806.

📒 Files selected for processing (1)
  • src/commands/config.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • src/commands/config.ts

📝 Walkthrough

Walkthrough

The config set subcommand now accepts --json to parse values as JSON data alongside the existing --string option. The command enforces that both flags cannot be used together, validates configuration key paths unless --allow-unknown is set, and outputs stored values using explicit formatting—quoted strings, JSON-stringified objects/arrays, or String coercion.

Changes

Cohort / File(s) Summary
Configuration CLI Enhancement
src/commands/config.ts
The config set subcommand adds --json flag for JSON parsing, --allow-unknown flag to skip validation, mutual exclusivity check between --string and --json, conditional value parsing, key path validation with bypass, config validation before persistence, and revised output formatting with explicit type display.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

Poem

A config set CLI update with a hop,
Now JSON and strings both dance at the top,
Unknown keys? Simply allow them right through!
With validation and formatting—shiny and new! 🐰✨

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'fix: config set support object value' accurately describes the main change: enabling the config set command to accept object/non-string values like arrays and JSON objects.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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 and usage tips.

@linjinze999
Copy link
Copy Markdown
Author

openspec config set workflows '["propose","explore","new","continue","apply","ff","sync","archive","bulk-archive","verify","onboard"]'

Error: Invalid configuration - workflows: Invalid input: expected array, received string

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.

1 participant