Commit Graph
61 Commits
Author SHA1 Message Date
kaitranntt 6decd157e5 fix(agy): remove max_thinking_tokens when switching to non-claude model
Cleans up the thinking token limit setting when user switches from
a Claude model to a Gemini model via ccs agy --config.
2025-12-05 17:41:41 -05:00
kaitranntt 6f19440472 fix(agy): enable claude model thinking via antigravity profile
- Removed broken: true and issueUrl from Claude thinking models
- Added MAX_THINKING_TOKENS=8191 for Antigravity-proxied Claude models
- Removed alwaysThinkingEnabled:false requirement
- Updated info message explaining thinking token limit

Claude models now work with extended thinking when using Antigravity
proxy (MAX_THINKING_TOKENS < 8192 is required).
2025-12-05 17:37:19 -05:00
kaitranntt ace5ba8750 fix(cliproxy): consolidate download ui to single spinner
Use single spinner with update() instead of multiple spinners.
Prevents UI jumping during download/verify/extract phases.
2025-12-05 17:24:12 -05:00
kaitranntt 47700474a4 fix(cliproxy): only remove provider-specific auth files on logout
Previously --logout cleared all files in shared auth directory.
Now filters by provider prefix or JSON type field to preserve other providers.
2025-12-05 17:23:28 -05:00
kaitranntt f5c31dab55 fix(agy): preserve user settings during model switch
Model configuration now uses selective merge instead of full replacement:
- Preserves all user customizations (includeCoAuthoredBy, MAX_TOKENS, etc.)
- Only updates CCS-controlled fields (model selection, base URL, auth token)
- Still enforces alwaysThinkingEnabled: false for Claude models
2025-12-05 17:02:19 -05:00
kaitranntt f5a1b81e55 feat(agy): disable thinking toggle for claude models via antigravity
Claude models routed through Google's Antigravity protocol don't support
the thinking toggle due to protocol conversion limitations.

Changes:
- Add alwaysThinkingEnabled: false when selecting Claude models
- Show warning about thinking toggle limitation after model selection
- Reference GitHub issue #415 for technical details
2025-12-05 16:44:33 -05:00
kaitranntt 26d72cfa5b feat(delegation): add passthrough args for claude cli flags
Support passing through additional CLI flags like --agent, --system-prompt-file
to the underlying Claude CLI when using delegation mode.
2025-12-05 16:43:08 -05:00
kaitranntt 3bb1ea7541 fix(types): add forceversion to binarymanagerconfig interface 2025-12-05 13:35:29 -05:00
20bf6266d2 feat(cliproxy): add iFlow OAuth provider support (#55)
Add iFlow as a new OAuth-based provider for CLIProxy.

Changes:
- Add config/base-iflow.settings.json with iFlow provider configuration
- Add iFlow to CLIProxyProvider type
- Add iFlow OAuth config (authUrl, scopes, authFlag)
- Add iFlow to provider display names, auth prefixes, and type values
- Update config-generator to support iFlow provider
- Update base-qwen.settings.json models (qwen3-coder-plus)

Co-authored-by: kaitranntt <kaitran.ntt@gmail.com>
2025-12-05 13:31:42 -05:00
kaitranntt 1471bd2152 fix(doctor): repair shared settings.json symlink broken by claude cli
claude cli's atomic writes (toggle thinking, etc.) replace symlinks with
regular files, breaking the settings sync chain. this adds:

- `ccs doctor --fix` to detect and repair broken shared symlinks
- `ccs sync` now also repairs shared symlinks automatically

fixes #57
2025-12-05 13:29:10 -05:00
kaitranntt 7e07615eed feat(cliproxy): add version management command
Allow users to install specific versions or update to latest CLIProxy
via 'ccs cliproxy' command with install/update subcommands.
2025-12-04 06:36:06 -05:00
kaitranntt 0e11426daa feat(cliproxy): add warning for broken claude proxy models on agy
- add broken flag to model catalog for models with known issues
- display [BROKEN] badge in model selection and config display
- show warning message when starting with a broken model
- link to tracking issue: CLIProxyAPI#415

Claude proxy models (gemini-claude-*) currently fail with tool calls
due to upstream CLIProxyAPI bug. Warning helps users know to switch
to gemini-3-pro-preview until fixed.
2025-12-04 06:22:38 -05:00
kaitranntt fdb8761cfa fix(cliproxy): correct model selection default and update fallback version
- Fix --config showing wrong default star position by using current
  user model instead of catalog default when reconfiguring
- Update CLIPROXY_FALLBACK_VERSION from 6.5.31 to 6.5.40
2025-12-04 06:14:14 -05:00
kaitranntt 848fbf4686 fix(cliproxy): clarify paid tier messaging to reference google account tier
Replace misleading "[Paid API]" and "API key" references with "[Paid Tier]"
and clarify that paid tier refers to a paid Google account (not free tier),
not an API key purchase. Updates model descriptions in both catalog and
configuration to accurately reflect the tier requirement.
2025-12-04 05:41:10 -05:00
kaitranntt 20b7bae046 refactor(cliproxy): use centralized ui system for model config display
Replace custom formatting with ui.ts imports (color, bold, dim, ok, info,
header, initUI) to maintain consistent styling with ccs doctor. Add model
descriptions to catalog and clarify [Paid API] tier labeling. Update
showCurrentConfig to async for UI initialization. Improves code reuse and
visual consistency across CLI commands.
2025-12-04 05:29:55 -05:00
kaitranntt df31ffcee7 fix(prompt): strip bracketed paste escape sequences from password input
Terminals using bracketed paste mode wrap pasted content with ESC[200~
(start) and ESC[201~ (end) sequences. These were incorrectly passed
through to API keys, causing "[200~API_KEY[201~" instead of "API_KEY".

Now buffers ESC sequences and discards recognized paste markers.
2025-12-04 05:05:45 -05:00
kaitranntt 3bdbff9345 feat(prompt): add password input utility with masking
Adds new password prompt utility with customizable masking for secure
credential collection. Integrates with help command for improved UX.
2025-12-04 04:45:26 -05:00
kaitranntt 4654c15577 feat(cliproxy): add model catalog with configuration management
Introduces new model-catalog and model-config modules to manage LLM
provider configurations and aliases. Enables dynamic model selection
with validated configuration per provider.
2025-12-04 04:45:11 -05:00
kaitranntt b18163c57b fix(update): add --help support and --dev alias for update command 2025-12-04 03:24:17 -05:00
kaitranntt e3edcf613e fix(doctor): use actual installed clipproxy version instead of hardcoded 2025-12-04 03:19:01 -05:00
kaitranntt f85eb74771 chore(merge): sync dev with main v5.4.3 2025-12-03 22:07:48 -05:00
semantic-release-botandkaitranntt bd46c8de12 fix(tests): migrate test suite from mocha to bun test runner
- Replace before()/after() with beforeAll()/afterAll()
- Remove this.timeout() calls (unsupported by bun)
- Update package.json scripts to use bun test
- Fix error message regex for cross-runtime compatibility
- Skip integration tests requiring network/child process mocking
- Format source files with prettier
2025-12-03 21:43:29 -05:00
kaitranntt 6b3f93a80a fix(sync): implement copy fallback for windows when symlinks unavailable
When symlink creation fails on Windows (due to Developer Mode being
disabled or insufficient permissions), fall back to copying files
and directories instead.

Changes:
- Add copyFallback() method for Windows symlink failures
- Add copyDirRecursive() helper for directory copying
- Update checkHealth() to recognize copied files as valid on Windows
- Add isCopiedItem() helper to validate copied content
- Update uninstall() to handle both symlinks and copied files

Fixes #45
2025-12-02 22:01:50 -05:00
kaitranntt cfe9ba05a4 fix(doctor): resolve windows claude cli detection failure
Windows .cmd/.bat wrapper scripts require shell: true in spawn options.
Uses same pattern as other files (ccs.ts, cliproxy-executor.ts, shell-executor.ts):
- getClaudeCliInfo() returns needsShell flag
- Concatenate command string when shell needed to avoid DEP0190 warning

Closes #41
2025-12-02 21:16:45 -05:00
kaitranntt af4d6cff89 fix(cliproxy): resolve windows auth browser not opening
- skip TTY check on Windows (process.stdin.isTTY returns undefined)
- Windows desktop environments always have browser capability
- also fix help-command version to read from package.json

Closes #42
2025-12-02 21:10:38 -05:00
kaitranntt a6663cbd04 fix(cliproxy): convert windows backslashes to forward slashes in config.yaml auth-dir
Fixes #36

Windows paths with backslashes caused YAML parsing failures because
backslashes are escape characters in double-quoted strings. Forward
slashes work correctly on all platforms and avoid escape sequence issues.

Changes:
- src/cliproxy/config-generator.ts: Add .replace(/\\/g, '/') to authDir
- tests/unit/cliproxy/config-generator.test.js: Add 12 unit tests

Tests: 169/169 unit tests passing
2025-12-02 16:16:21 -05:00
kaitranntt 13d13dab51 fix(auth): prevent default profile from using stale glm env vars
Issue #37: When running `ccs` (default profile), users were unknowingly
using GLM API instead of their Claude subscription because:

1. config.json had `default: '~/.claude/settings.json'` entry
2. ProfileDetector treated this as settings-based profile
3. CCS passed `--settings ~/.claude/settings.json` flag to Claude
4. Any stale ANTHROPIC_* env vars in that file got applied

Fix (3-pronged approach):
- Remove `default` entry from new config.json template
- Add migration to remove existing `default: ~/.claude/settings.json`
- Add ProfileDetector safety net: if default points to ~/.claude/settings.json,
  treat as pass-through to Claude's native auth (no --settings flag)

Now `ccs` (no profile) correctly uses Claude's native OAuth authentication
without loading potentially polluted env vars from previous sessions.

Closes #37
2025-12-02 15:55:10 -05:00
kaitranntt 073a5e15ee feat(ui): enhance section headers with gradient and rename profile to api
- Add sectionHeader() with gradient + bold styling
- Rename profile-command.ts to api-command.ts
- Update help command layout
- Change command color from italic to bold
2025-12-02 15:12:53 -05:00
kaitranntt 716193a682 feat(ui): enhance delegation with listr2 task lists and styled output
Phase 5 of CLI UI/UX Enhancement - Delegation + Listr2

Added Listr2 integration for enhanced delegation progress display:
- Intelligent renderer selection (TTY/CI/Claude Code context detection)
- Styled result boxes and tables using ui layer
- Graceful fallback chain: Listr2 → Spinners → Plain text
- All delegation formatters converted to async

Changes:
- src/utils/ui.ts: Added taskList wrapper, isClaudeCodeContext detection
- src/delegation/result-formatter.ts: Async formatting with styled boxes/tables
- src/delegation/delegation-handler.ts: Async format calls
- src/delegation/headless-executor.ts: UI layer progress messages
- tests: Updated all formatter tests to handle async
- docs: Enhanced code standards and codebase summary

All validation passing (157/157 tests)
Phase 5 complete - All 5 phases delivered
2025-12-01 20:53:04 -05:00
kaitranntt 57016f3f76 feat(ui): enhance doctor and error manager with new ui layer
- doctor.ts: add styled header box, semantic status indicators,
  formatted summary table, grouped check sections
- error-manager.ts: add boxed error messages, styled solution
  sections, semantic color coding for all error types
- ccs.ts, shell-executor.ts: await async error methods

Phase 4 of CLI UI Enhancement plan complete.
2025-12-01 19:54:44 -05:00
kaitranntt 6f42a6527b feat(ui): enhance auth commands with new ui layer
- Use table formatting for auth list with status column
- Add relative time display for last used (verbose mode)
- Use styled headers, subheaders, and examples in help
- Add info box display for profile creation success
- Maintain JSON output mode unchanged for scripting
2025-12-01 19:34:34 -05:00
kaitranntt f3ed359050 feat(ui): enhance help and profile commands with new ui layer
- Redesign help command with hero box and styled sections
- Add table formatting for profile list with status indicators
- Use semantic colors consistently (command, path, success, warning)
- Profile create shows info box on success
- Maintain NO_COLOR compliance for all output
2025-12-01 19:29:58 -05:00
kaitranntt 6e49e0e7e1 feat(ui): add central ui abstraction layer for cli styling
- create src/utils/ui.ts with semantic colors, status indicators, boxes, tables, spinners
- add ui types (SemanticColor, BoxOptions, TableOptions, SpinnerOptions) to src/types/utils.ts
- add deprecation notice to src/utils/helpers.ts for legacy color functions
- add unit tests for ui module (11 test cases)
- install chalk@5.6.2, boxen@8.0.1, gradient-string@3.0.0

features:
- semantic color system (success, error, warning, info, primary, secondary)
- ascii-only status indicators: [OK], [X], [!], [i]
- tty-aware with NO_COLOR/FORCE_COLOR support
- styled boxes with boxen (round, double, bold borders)
- formatted tables with cli-table3
- animated spinners with ora (fallback to plain text in non-tty)
- gradient text for headers (cyan-to-blue)
- lazy esm module loading for chalk/boxen/gradient-string
2025-12-01 19:22:51 -05:00
kaitranntt bc56d2e135 fix(prompt): improve password input handling with raw mode and buffer support 2025-12-01 17:54:55 -05:00
kaitranntt 7faed1d84b feat(shell-completion): add --force flag and fix zsh profile coloring 2025-12-01 17:54:41 -05:00
kaitranntt 53d7a15c04 feat(profile): add profile command with configuration display 2025-12-01 17:54:26 -05:00
kaitranntt 7e0b0feca8 fix(cliproxy): improve qwen oauth error handling
- Updated OAuth port documentation with correct flow types per provider
- Removed Qwen from port cleanup logic (Device Code Flow has no callback)
- Fixed Qwen error messages to show Device Code Flow troubleshooting tips

Fixes #29
2025-12-01 05:16:05 -05:00
kaitranntt 8873ccd981 feat(cliproxy): auto-update cliproxyapi to latest release on startup
- add github api integration to fetch latest release version
- check for updates on every startup (cached for 1 hour)
- auto-download newer versions when available
- rename CLIPROXY_VERSION to CLIPROXY_FALLBACK_VERSION (safety net)
- add version tracking (.version file) and caching (.version-cache.json)
- non-blocking: startup continues if update check fails
2025-12-01 04:03:03 -05:00
Kai (Tam Nhu) TranandGitHub a3f1e52ac6 feat(cliproxy): add qwen code oauth provider support (#31)
Add 'qwen' as new CLIProxy OAuth provider with --qwen-login flag.
Support qwen3-coder model with base config at config/base-qwen.settings.json.
Register qwen OAuth endpoints and token prefix handling.
Update help documentation across all CLI entry points.

Implements issue #29
2025-12-01 03:51:47 -05:00
Kai (Tam Nhu) TranandGitHub c95338232a fix(glmt): handle 401 errors and headers-already-sent exception (#30)
- add res.headersSent check before writing error headers
- write error as SSE event when headers already sent (streaming mode)
- add parseUpstreamError() for user-friendly error messages
- return proper HTTP status codes (401, 403, 429, 502, 504)
- clear auth error: check ANTHROPIC_AUTH_TOKEN in config

Fixes #26
2025-12-01 03:18:53 -05:00
kaitranntt 4c81f28f0b fix(cliproxy): use double-dash flags for cliproxyapi auth (#24)
CLIProxyAPI updated from single-dash to double-dash CLI flags.
Changed -login to --login, -codex-login to --codex-login,
-antigravity-login to --antigravity-login, -config to --config,
and -no-browser to --no-browser.
2025-11-30 20:02:50 -05:00
kaitranntt 72c2b08715 refactor: consolidate test structure and remove backup files
- Move ux-integration-test.sh to tests/integration/ directory
- Consolidate tests/fixtures/ into tests/shared/fixtures/
- Fix import paths in cli.test.js and postinstall.test.js
- Remove src/ccs.ts.backup file (958 lines)
- Remove empty src/scripts/ directory
- Remove non-existent test:edge-cases script from package.json
- Update tests/README.md with accurate structure
- Update CONTRIBUTING.md with correct test commands
- Update docs/system-architecture.md with correct test paths
2025-11-30 17:54:04 -05:00
kaitranntt ce9d60d0ca feat(cliproxy): add user-defined CLIProxy variants
Allow users to create custom profile names that route through CLIProxy
providers with different model configurations.

Config example:
{
  "cliproxy": {
    "flash": { "provider": "gemini", "settings": "~/.ccs/gemini-flash.settings.json" },
    "pro": { "provider": "gemini", "settings": "~/.ccs/gemini-pro.settings.json" }
  }
}

Usage: ccs flash "quick task" or ccs pro "complex analysis"

Changes:
- Add CLIProxyVariantConfig types to src/types/config.ts
- Update profile-detector to check config.cliproxy section (Priority 1)
- Pass customSettingsPath through executor chain
- Update getEffectiveEnvVars to support custom settings path
- Document feature in README.md and CLAUDE.md
- Bump version to 5.0.2
2025-11-30 04:02:43 -05:00
kaitranntt 93b38d8550 fix(cliproxy): detect Gemini tokens by JSON type field
Root cause: CLIProxyAPI saves Gemini tokens without prefix
({email}-{projectID}.json), but CCS was only looking for
gemini-* files. Added content-based detection as fallback.

Changes:
- Added PROVIDER_TYPE_VALUES map for JSON type detection
- Added isTokenFileForProvider() for content-based detection
- Updated isAuthenticated() and getAuthStatus() with dual strategy
- Fixed triggerOAuth() success messaging and error hints
- Bumped patch version (3.0.8 -> 3.0.9)
2025-11-29 02:27:57 -05:00
kaitranntt e0df6aa900 fix(cliproxy): ensure provider-specific OAuth token detection
Fixes critical auth bug where checking any JSON file in the auth
directory would incorrectly mark providers as authenticated. Now
validates that token files match provider-specific prefixes (gemini-,
codex-, antigravity-) to prevent OAuth skipping across providers.

Updates help command examples to use placeholder syntax and updates
CHANGELOG to reflect Qwen -> Antigravity provider name change.
2025-11-28 20:53:20 -05:00
kaitranntt e54d401656 feat(cliproxy): refactor config loading and enhance base settings support
- Introduce `BaseConfigLoader` for centralized configuration management
- Add `base-agy.settings.json` configuration
- Refactor `ConfigGenerator` to utilize new loading patterns
- Update help command with improved documentation
- Clean up lint violations file
- Enhance postinstall script
2025-11-28 20:43:11 -05:00
kaitranntt 50d32ca7da feat(cliproxy): add user settings override for model customization
- Add getEffectiveEnvVars() to read user overrides from ~/.ccs/{provider}.settings.json
- Add ensureProviderSettings() to create settings file from defaults on first run
- Update cliproxy-executor to use effective env vars with override support
- Export new functions from index.ts

Users can now customize model mappings by editing ~/.ccs/gemini.settings.json
or ~/.ccs/codex.settings.json. This enables:
- Using gemini-3-pro-preview for all model types
- Easy migration when new models release (gemini 4, 5, etc.)
- User takes full responsibility for custom settings

Default behavior unchanged - works out of box with bundled defaults.
2025-11-28 19:49:28 -05:00
kaitranntt efb966c96d feat(cliproxy): unified config for concurrent gemini/codex usage
- Add unified CLIProxy config supporting all providers concurrently
- Move CLIProxy files to ~/.ccs/cliproxy/ subdirectory
- Use flat auth directory structure for OAuth tokens
- Add provider-specific URL routing via /api/provider/{provider}
- Add base settings templates for gemini and codex
- Fix model registration with proper auth file discovery

Enables users to run `ccs gemini` and `ccs codex` concurrently
without config conflicts.
2025-11-28 19:41:28 -05:00
kaitranntt 5f71eba6f6 feat(cliproxy): add CLIProxyAPI integration for OAuth profiles
Complete integration of CLIProxyAPI for zero-config OAuth profiles.

New profiles:
- ccs gemini: Gemini via OAuth
- ccs chatgpt: ChatGPT via OAuth
- ccs qwen: Qwen via OAuth

Implementation:
- Phase 1: Binary infrastructure (download-on-demand)
- Phase 2: Proxy executor (spawn/kill pattern)
- Phase 3: OAuth integration (browser-based auth)
- Phase 4: Profile registration (routing + help text)
- Phase 5: Diagnostics (doctor command + errors)

Files added:
- src/cliproxy/*.ts (binary-manager, platform-detector, executor, auth-handler, config-generator, types, index)

Files modified:
- src/ccs.ts (CLIProxy routing)
- src/auth/profile-detector.ts (cliproxy profile type)
- src/commands/help-command.ts (new profiles in help)
- src/management/doctor.ts (CLIProxy health checks)
- src/utils/error-manager.ts (OAuth/port/download errors)
- CHANGELOG.md (v5.0.0 release notes)

Tests: 42/42 passed
2025-11-28 16:28:15 -05:00
kaitranntt 296d5661d0 docs: mark native shell installers as deprecated across all documentation
Phase 02 of "Deprecate Native Installers" plan:

Documentation updates (10 files, 3 languages):
- README.md: Mark curl/irm installers as deprecated in collapsed section
- docs/en/installation.md: Add deprecation warnings, emphasize npm as primary
- docs/en/troubleshooting.md: Add FAQ for deprecation warning users see
- docs/en/usage.md: Update uninstall to show npm first, legacy second
- docs/version-management.md: Strikethrough deprecated release checklist items
- docs/ja/README.md: Japanese deprecation notice
- docs/vi/README.md: Vietnamese deprecation notice
- docs/vi/installation.vi.md: Vietnamese installation deprecation
- docs/vi/troubleshooting.vi.md: Vietnamese troubleshooting deprecation
- src/commands/help-command.ts: npm as recommended uninstall method

Code quality:
- Fixed emoji violations: replaced ⚠️ with [!] per CLAUDE.md ASCII-only rule
- Consistent messaging across EN/JA/VI translations
- Updated codebase-summary.md with Phase 02 achievements

All documentation now consistently recommends:
  npm install -g @kaitranntt/ccs

Legacy installers (curl/irm) show deprecation warning and auto-redirect
to npm installation when Node.js is available.
2025-11-28 02:39:48 -05:00