feat: add --settings flag for custom Claude settings path#609
feat: add --settings flag for custom Claude settings path#609fdkubuntu wants to merge 1 commit intositeboon:mainfrom
Conversation
- Add --settings <path> CLI flag (--settings=path form also supported) - Add CLAUDE_SETTINGS_PATH env var support - Add loadCustomSettings() for reading/validating custom JSON settings - Update mapCliOptionsToSDK() to merge custom settings over defaults - Custom settings override: allowedTools, disallowedTools, skipPermissions, permissionMode, model - Graceful error handling: missing file, invalid JSON, wrong type → warn + fallback - Document in CLI help text and .env.example
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe changes add support for custom Claude settings via a new Changes
Sequence DiagramsequenceDiagram
participant User
participant CLI as CLI Handler
participant Config as Config Module
participant FileSystem as File System
participant SDK as SDK Mapper
User->>CLI: Provide --settings flag
CLI->>Config: Set CLAUDE_SETTINGS_PATH env var
CLI->>Config: Query CLAUDE_SETTINGS_PATH constant
Config->>FileSystem: Read settings JSON file
FileSystem->>SDK: Return parsed settings object
SDK->>SDK: Merge custom settings with options<br/>(precedence: CLI flag > custom settings > defaults)
SDK->>SDK: Apply permissionMode, tools, model overrides
SDK->>SDK: Build final SDK options
Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 3✅ Passed checks (3 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
Summary by CodeRabbit
Release Notes
New Features
--settingsCLI option to specify a custom Claude settings JSON file pathDocumentation
CLAUDE_SETTINGS_PATHenvironment variable--settingsCLI flag option