mirror of
https://github.com/anthropics/claude-code-sdk-python.git
synced 2025-12-23 09:19:52 +00:00
Add settings option to ClaudeCodeOptions (#100)
## Summary - Add `settings` field to `ClaudeCodeOptions` to expose the `--settings` CLI flag - Allow SDK users to specify custom settings configuration path ## Changes - Added `settings: str | None = None` field to `ClaudeCodeOptions` dataclass - Added CLI argument conversion logic in `SubprocessCLITransport` to pass `--settings` flag to Claude Code CLI ## Test plan - [x] All existing tests pass - [x] Linting passes (`python -m ruff check`) - [x] Type checking passes (`python -m mypy src/`) 🤖 Generated with [Claude Code](https://claude.ai/code) --------- Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
parent
472aa23aae
commit
df94948edc
3 changed files with 12 additions and 0 deletions
|
|
@ -1,5 +1,13 @@
|
|||
# Changelog
|
||||
|
||||
## 0.0.18
|
||||
|
||||
- Add `ClaudeCodeOptions.settings` for `--settings`
|
||||
|
||||
## 0.0.17
|
||||
|
||||
- Remove dependency on asyncio for Trio compatibility
|
||||
|
||||
## 0.0.16
|
||||
|
||||
- Introduce ClaudeSDKClient for bidirectional streaming conversation
|
||||
|
|
|
|||
|
|
@ -118,6 +118,9 @@ class SubprocessCLITransport(Transport):
|
|||
if self._options.resume:
|
||||
cmd.extend(["--resume", self._options.resume])
|
||||
|
||||
if self._options.settings:
|
||||
cmd.extend(["--settings", self._options.settings])
|
||||
|
||||
if self._options.mcp_servers:
|
||||
cmd.extend(
|
||||
["--mcp-config", json.dumps({"mcpServers": self._options.mcp_servers})]
|
||||
|
|
|
|||
|
|
@ -127,3 +127,4 @@ class ClaudeCodeOptions:
|
|||
model: str | None = None
|
||||
permission_prompt_tool_name: str | None = None
|
||||
cwd: str | Path | None = None
|
||||
settings: str | None = None
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue