Commit Graph
18 Commits
Author SHA1 Message Date
kaitranntt ddf1b170b5 fix(windows): replace Unicode symbols with ASCII-safe alternatives
PowerShell may not render Unicode symbols (✓ ✗ ⚠️ ℹ️  │) correctly depending on
console font and encoding. Replaced with ASCII alternatives:

- ✓/ → [OK] or [SUCCESS]
- ✗ → [X]
- ⚠️ → [!]
- ℹ️ → [i]
- │ → |

This ensures consistent display across all PowerShell versions and consoles.
2025-11-02 02:34:22 -05:00
kaitranntt 6bc6db6f31 fix(windows): add null check for ScriptDir in uninstall script detection
Line 166 was calling Test-Path with null ScriptDir when running via irm | iex,
causing 'Cannot bind argument to parameter Path because it is null' error.

Added null check: if ($ScriptDir -and (Test-Path ...)) to safely skip to
standalone mode when ScriptDir is null.
2025-11-02 02:26:28 -05:00
kaitranntt 411d3850a2 fix(windows): handle null Path when running install.ps1 via irm | iex
When running via 'irm ccs.kaitran.ca/install.ps1 | iex', the script executes
in-memory without a file path, causing $MyInvocation.MyCommand.Path to be null.
This fix checks for null before calling Split-Path to avoid the error:
'Cannot bind argument to parameter Path because it is null'

Resolves standalone installation method detection for piped execution.
2025-11-02 02:25:19 -05:00
kaitranntt a4245e9031 feat(windows): add native PowerShell 5.1+ support with full cross-platform compatibility
- Add ccs.ps1: PowerShell core script with native JSON parsing
- Add install.ps1: Windows installer with provider auto-detection
- Add uninstall.ps1: Clean Windows uninstaller
- Update install.sh: Add platform detection to redirect Windows users
- Update README.md: Add comprehensive Windows installation docs
- Update README.vi.md: Add Vietnamese Windows documentation

Features:
- PowerShell 5.1+ compatible (Windows 10+ built-in)
- Cross-platform config: Unix paths work on all platforms
- Smart path expansion: ~/  → %USERPROFILE%\ on Windows
- Zero breaking changes: Linux/macOS unchanged
- No external dependencies: Uses PowerShell built-in JSON

Install directory: %USERPROFILE%\.ccs\
Usage: irm ccs.kaitran.ca/install.ps1 | iex (after Cloudflare setup)
2025-11-02 02:20:48 -05:00
kaitranntt 92903ddb68 feat(install): improve installation output with structured messages
Redesigned installation output for better clarity and user focus:

Output improvements:
- Add visual hierarchy with box drawing characters (┌─, │, └─)
- Organize into clear phases: Installing CCS → Configuring Profiles
- Replace verbose messages with concise success indicators (✓)
- Consolidate warnings into dedicated sections

User experience enhancements:
- Context-aware quick start examples (prioritize current provider)
- Clear "ACTION REQUIRED" section for GLM API key setup
- Remove redundant "Installation complete!" / "Setup complete!" messages
- Silent profile creation (show only results, not process)

Technical changes:
- Replace emoji () with Unicode (✗) for consistency
- Remove stderr suppression from curl for better error visibility
- Add visual section closers (└─) for clean structure
- Smart provider detection labels in configuration phase

Before: Messy, scattered messages with multiple completion notices
After: Clean, phased output with clear visual structure and actionable items
2025-11-01 19:59:30 -04:00
kaitranntt 40ff512c1b refactor: consolidate CCS files to unified ~/.ccs directory
Major reorganization to provide cleaner, more intuitive directory structure:

Directory changes:
- Move ~/.ccs.json → ~/.ccs/config.json
- Move ~/.claude/glm.settings.json → ~/.ccs/glm.settings.json
- Move ~/.claude/sonnet.settings.json → ~/.ccs/sonnet.settings.json
- Move ~/.local/share/ccs/* → ~/.ccs/
- Keep ~/.claude/settings.json unchanged (Claude CLI default)

Script improvements:
- Fix idempotency: check source != destination before cp
- Update all path references in ccs, install.sh, uninstall.sh
- Consolidate uninstall to single directory removal

Documentation updates:
- Update README badges: remove stars, modernize labels, add platform
- Update all path references in README.md and README.vi.md
- Update INSTALL-WORKFLOW.md diagram
- Update .ccs.example.json template

This provides a unified installation location that's easier to manage and understand.
2025-11-01 19:47:09 -04:00
kaitranntt 5227c0b28d fix(install): preserve Claude model preferences in sonnet profile
- add smart filtering to remove GLM vars but keep Claude models

- remove ANTHROPIC_DEFAULT_* only if value is GLM (e.g. 'glm-4.6')

- preserve ANTHROPIC_DEFAULT_* if value contains 'claude' (user preference)

- add null safety with tostring? // ""

- add case-insensitive matching with ascii_downcase

- add explanatory comments for filter logic

Fixes bug where sonnet.settings.json incorrectly had GLM model overrides
2025-11-01 19:34:06 -04:00
kaitranntt df464e0296 docs: add Vietnamese translation (README.vi.md)
- add complete Vietnamese version of README

- add language selector to both English and Vietnamese versions

- maintain same structure and content as English version
2025-11-01 19:19:15 -04:00
kaitranntt fd59801b14 docs: update URLs to use correct CloudFlare subdomain
- change from kaitran.ca/ccs/* to ccs.kaitran.ca/*

- update Quick Start, Installation, Upgrade, and Uninstall sections
2025-11-01 19:16:22 -04:00
kaitranntt 780867073d docs: update Quick Start to use short URL and correct profile key
- use kaitran.ca/ccs/install in Quick Start

- fix profile key from 'sonnet' to 'son'
2025-11-01 19:02:49 -04:00
kaitranntt 82eb688a6a docs: add short CloudFlare URLs for install/uninstall
- add kaitran.ca/ccs/install and kaitran.ca/ccs/uninstall

- keep original GitHub URLs as alternatives

- update Quick Start, Upgrade, and Uninstall sections
2025-11-01 19:00:57 -04:00
kaitranntt 84f4548dcb fix(ccs): resolve default profile shift error when no args provided
- add conditional check before shift command

- prevent failure when calling 'ccs' without arguments

- named profiles (ccs son, ccs glm) still work correctly
2025-11-01 18:51:24 -04:00
kaitranntt 08d8c1f21c fix(install): resolve critical standalone install bugs and refactor
- fix BASH_SOURCE unbound variable for piped execution (curl | bash)
- fix missing download logic for standalone installs (added GitHub fetch)
- fix installation method detection (check ccs file, not .git)
- fix git worktree detection (.git file support)
- add GLM default model env vars (ANTHROPIC_DEFAULT_*)
- enhance GLM profile creation (preserve existing API keys)
- improve error handling for mv operations
- refactor install.sh with helper functions (250 lines, cleaner)
- change profile name from 'sonnet' to 'son' (shorter)
- add installation workflow diagram (INSTALL-WORKFLOW.md)
- update documentation with troubleshooting and upgrade guides
2025-11-01 18:44:48 -04:00
kaitranntt aa04966ff4 feat: simplify templates, auto-config, task-based switching docs
Major improvements for user experience and workflow optimization:

## Template Simplification
- GLM template: reduced to 3 essential env vars (was 15 fields)
- Claude template: minimal {env: {}} (uses default auth)
- Removed non-essentials: alwaysThinkingEnabled, includeCoAuthoredBy
- Smart merging: preserves user's existing env vars via jq

## Auto-Configuration
- Auto-creates ~/.ccs.json during install (zero manual steps)
- Smart detection: identifies current provider (GLM/Claude/Custom)
- Creates missing profiles automatically
- Intelligent copying: current config → appropriate profile

## Safety Improvements
- Atomic file operations: all writes use .tmp files
- Race condition prevention: mv -n for concurrent installs
- Error handling: jq failures fall back to heredoc templates
- No corrupted JSON files on errors

## Documentation Enhancements
- Added task-based model selection use case
- Real workflow examples (planning → implementation → review)
- Emphasis on using right model for right task
- Claude Sonnet 4.5 for complex, GLM 4.6 for simple tasks
- Rate limit management as bonus feature

## User Experience
Before: 3 manual steps (copy config, edit, create profiles)
After: 0 manual steps (just add API key to generated template)

Installation time: 5 minutes → 30 seconds
2025-11-01 18:02:18 -04:00
kaitranntt 8913514361 chore: add plans/ to .gitignore
- Add plans/ directory to .gitignore to prevent tracking
- Ensures plans directory stays out of version control
2025-11-01 17:28:27 -04:00
kaitranntt 35505530d0 feat: add default profile, uninstall script, modernize docs
- Default profile: 'ccs' without args uses 'default' profile
- Uninstall script: 'ccs-uninstall' removes installation cleanly
- Install improvements: curl-compatible with uninstall bundling
- Config cleanup: removed obsolete opus profile
- README overhaul: professional badges, quick-start focus, one-liner install
- Security: maintained injection prevention, input validation
- Documentation: removed multiple accounts mention, updated URLs

Closes #1
2025-11-01 17:23:33 -04:00
kaitranntt dd85d37af8 docs: update installation URL with actual repository 2025-11-01 17:02:19 -04:00
kaitranntt c8f85a1220 feat: initial commit - ultra-simple claude code switcher
- Core ccs bash script with profile switching
- Installation script with PATH verification
- Example config template
- Comprehensive README with troubleshooting
- Security: input validation, injection prevention
- MIT license
2025-11-01 17:01:42 -04:00