claude-code-router
claude-code-router copied to clipboard
feat: Allow configuring HOME_DIR via environment variable
This change allows users to customize the application's home directory by setting the CLAUDE_CODE_ROUTER_DIR environment variable.
- Modified
src/constants.tsto usepath.resolvewith the CLAUDE_CODE_ROUTER_DIR environment variable, falling back to the default~/.claude-code-routerif not set. - Refactored
src/cli.ts,src/server.ts,src/index.ts,src/utils/index.ts, andsrc/utils/modelSelector.tsto use the centralizedHOME_DIRconstant, removing hardcoded paths. - Updated
README.md,README_zh.md, andCLAUDE.mdto document this new feature and provide generic examples. - Added a comment to
docker-compose.ymlto show how to use the environment variable. - Updated
ui/config.example.jsonto use a generic placeholder path.
@copilot open a new pull request to apply changes based on the comments in this thread