Commit Graph
10 Commits
Author SHA1 Message Date
Tam Nhu Tran 4df08f6d99 feat: make cliproxy provider nicknames optional by default 2026-03-23 11:02:08 -04:00
Tam Nhu Tran cf8070b5f0 fix(profile): handle km compatibility for legacy kimi api users 2026-02-19 12:43:41 +07:00
Tam Nhu Tran a71496cc3d fix(cliproxy): harden provider alias and refresh edge cases
- guard provider alias generation against ambiguous collisions

- add account-scoped Gemini token refresh with strict account checks

- warn and fallback on invalid management remote ports

- align remaining HTTP remote defaults and extend cliproxy tests
2026-02-18 04:18:39 +07:00
Tam Nhu Tran 688f3e3889 refactor(commands): share cliproxy default port for setup and help
- source setup wizard local port default from port-manager

- render help text defaults from shared constant
2026-02-18 03:10:09 +07:00
kaitranntt 596a9c6843 test(setup): add unit tests for setup_completed flag detection
- Add 3 test cases for setup_completed flag:
  - Detect flag when present and true
  - Treat missing flag as first-time eligible
  - Treat false flag as first-time eligible
- Update JSDoc to document detection priority order

Addresses code review feedback on PR #372.
2026-01-25 21:26:23 -05:00
kaitranntt 85e41a56e9 fix(setup): persist setup_completed flag to prevent repeated first-time notice
After running ccs setup with local proxy mode, the CLI was still showing
the first-time install notice because isFirstTimeInstall() only checked
for user-created content (profiles, accounts, variants, etc.). When user
chose "Local" mode and skipped API profiles, config had empty objects,
causing all checks to return false.

Added setup_completed flag to UnifiedConfig interface and set it to true
when setup wizard completes. isFirstTimeInstall() now checks this flag
first.
2026-01-25 21:21:02 -05:00
kaitranntt cc2d62db38 fix(profiles): prevent GLM auth regression from first-time install detection
- Check legacy config.json/profiles.json in isFirstTimeInstall()
- Use expandPath() for cross-platform path handling in profile-detector
- Add pre-flight API key validation for better error messages
- Enhance 401 error handling with Z.AI refresh guidance

Fixes #195
2025-12-24 18:09:09 -05:00
kaitranntt ca78993e76 fix(config): improve edge case handling for config initialization
- setup-command.ts: Add Ctrl+C handling (UserCancelledError), port
  validation (1-65535), protocol stripping from host, try-catch with
  user-friendly error messages
- postinstall.js: Add ~/.ccs file check (not directory), wrap js-yaml
  require in try-catch with JSON fallback, validate config.json before
  migration, warn when both config files exist
- recovery-manager.ts: Verify config is loadable (not just exists),
  add nested error handling for fallback write
- ccs.ts: Make first-time install hint independent of recovery status
  (shows even when user manually created empty config.yaml)

All edge cases identified by code review addressed.
2025-12-23 22:34:32 -05:00
kaitranntt b34469d75f refactor(config): migrate to config.yaml as primary format
- Update postinstall.js to create config.yaml instead of config.json
- Update recovery-manager to create config.yaml as primary config
- Fix isFirstTimeInstall() to check for meaningful config content
  (profiles, accounts, variants, oauth_accounts, remote proxy)
- Update validation to accept config.yaml OR config.json
- Preserve backward compatibility: legacy config.json is migrated
  to config.yaml on first run via autoMigrate()
- Update postinstall tests to verify config.yaml creation

Fixes #142 - remote CLIProxyAPI configuration
2025-12-23 21:54:55 -05:00
kaitranntt cec616d530 feat(setup): add first-time setup wizard for config initialization
Addresses Issue #142 - remote CLIProxyAPI configuration for Docker/server deployments.

Changes:
- Add `ccs setup` command with interactive wizard
- Support local vs remote CLIProxy mode selection
- Guide users through remote proxy config (host, port, auth token)
- Auto-detect first-time install and suggest setup wizard
- Update help command to include setup

Scenarios covered:
1. New users - wizard guides through local/remote/skip choice
2. Remote proxy users - configure host/port/protocol/auth_token
3. Local users - default auto-start behavior
4. Skip CLIProxy - only API profiles or Claude accounts
2025-12-23 21:28:38 -05:00