anthropics / anthropics/claude-agent-sdk-python
Expose the ability to configure bash environment
- Ngôn ngữ chính
- Python
- Star
- 8.1k
- Fork
- 1.3k
- Merge trung bình
- 2 ngày 31 phút
- Pull request đã merge (30 ngày)
- 1
Mô tả
I'm trying to configure a bash alias for use by CC as wrapped by the python sdk. specifically, I'd like to alias `curl` to `curl -s`, as progress bar output is useless to Claude and only pollutes context.
I've thought of a few approaches, none of which seem to work:
- using a PreToolUse hook instead to modify the command invocation. this doesn't seem possible, as these hooks can't modify, only allow/deny.
- passing it as explicit configuration to the Bash tool or CC. doesn't seem like this is exposed.
- seeding the alias in the .bashrc in the matching $HOME of the user Claude is run under.
unfortunately none of these seem feasible - Claude only ever reports having the following set:
`alias rg='/usr/lib/node_modules/\\@anthropic-ai/claude-code/vendor/ripgrep/arm64-linux/rg'`
I haven't found reference to this `rg` alias anywhere in this SDK, which leads me to believe it's being configured upstream in CC itself, but I can't confirm that.
the odd thing is that when I run Claude locally, it captures my aliases fine. this leads me to believe there might be some interaction with the SDK, since I can't get this behavior to match what happens with a direct invocation.
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Hướng nghiên cứu
Bắt đầu bằng cách truy vết cách Python SDK cấu hình công cụ Bash và môi trường tiến trình của nó, sau đó so sánh với việc gọi trực tiếp cục bộ cũng như hành vi của các hook PreToolUse và .bashrc. Issue không nêu tệp hoặc bài kiểm thử nào. Hoàn tất khi có một cách được hỗ trợ để cấu hình alias hoặc hành vi của môi trường, để việc gọi SDK khớp với môi trường Bash được yêu cầu.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- bash, python
- Lĩnh vực
- cli, developer-experience
- Loại issue
- Tính năng
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 35/100