Skip to content

Conversation

haikow
Copy link

@haikow haikow commented Oct 2, 2025

Problem
When running ccr code on Windows, users encounter the error:
Error: Settings file not found: '{env:{ANTHROPIC_AUTH_TOKEN:test,ANTHROPIC_API_KEY:,ANTHROPIC_BASE_URL:http://127.0.0.1:3456,NO_PROXY:127.0.0.1,DISABLE_TELEMETRY:true,DISABLE_COST_WARNINGS:true,API_TIMEOUT_MS:600000}

Closes #862

Root Cause

  1. The code was passing a JSON string directly to the --settings parameter instead of a file path
  2. The shell-quote library was escaping colons in Windows file paths, causing path corruption
  3. String concatenation for spawn command was causing argument parsing issues

Solution

  • Create temporary settings file: Generate a real JSON file instead of passing JSON strings
  • Fix argument handling: Use proper spawn args array instead of shell-quoted concatenated strings
  • Platform compatibility: Maintain shell: true on Windows for PATH resolution
  • Resource cleanup: Automatically clean up temporary files on process exit

- Fix settings file not found error by creating temporary JSON file instead of passing JSON string
- Remove shell-quote usage for settings argument to prevent path escaping issues
- Use proper spawn args array instead of concatenated string
- Add platform-specific shell option for Windows PATH resolution
- Clean up temporary settings file on process exit

Fixes the 'Settings file not found' error when running 'ccr code' on Windows
@haikow haikow force-pushed the fix/windows-startup branch from a352edc to d4058b0 Compare October 2, 2025 15:24
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