mirror of
https://github.com/tiennm99/ccs.git
synced 2026-10-16 10:15:10 +00:00
feat(cli): comprehensive UX improvements for v3.5.0 (#7)
Implements 6-phase CLI UX improvement plan with comprehensive error handling, interactive features, and cross-platform consistency. ### Added - Shell auto-completion (bash, zsh, PowerShell, Fish) - Error codes (E101-E901) with documentation URLs - Fuzzy matching "Did you mean?" suggestions (Levenshtein distance) - Progress indicators (doctor [n/9] counter, GLMT proxy spinner) - Interactive confirmation prompts with --yes/-y automation flag - JSON output format (--json) for auth commands - Impact display (session count, paths) before destructive operations - Comprehensive test suite (15 tests, 100% pass rate) - Complete error documentation in docs/errors/ - Cross-platform `--shell-completion` command ### Changed - Error boxes: Unicode (╔═╗) → ASCII (===) for compatibility - JSON output uses CCS version instead of schema version - Help text includes EXAMPLES section across platforms - Test suite properly counts test cases (not assertions) ### Fixed - --yes flag bug (returned false instead of true) - Help text consistency (added Uninstall section to bash) - Test pass rate calculation (excludes skipped tests) - Help section comparison (locale-specific sort) ### Testing - 13/13 tests passing (2 legitimately skipped) - Cross-platform verified (Node.js, bash, PowerShell) - All error codes documented and tested
This commit is contained in:
1 parent
01cff1114b
commit
f40e9647ec
30 files changed
+4231
-105
No files matched your search
@@ -287,6 +287,30 @@ function createConfigFiles() {
|
||||
console.log('[OK] Kimi profile exists: ~/.ccs/kimi.settings.json (preserved)');
|
||||
}
|
||||
|
||||
// Copy shell completion files to ~/.ccs/completions/
|
||||
const completionsDir = path.join(ccsDir, 'completions');
|
||||
const scriptsCompletionDir = path.join(__dirname, '../scripts/completion');
|
||||
|
||||
if (!fs.existsSync(completionsDir)) {
|
||||
fs.mkdirSync(completionsDir, { recursive: true, mode: 0o755 });
|
||||
}
|
||||
|
||||
const completionFiles = ['ccs.bash', 'ccs.zsh', 'ccs.fish', 'ccs.ps1'];
|
||||
completionFiles.forEach(file => {
|
||||
const src = path.join(scriptsCompletionDir, file);
|
||||
const dest = path.join(completionsDir, file);
|
||||
|
||||
if (fs.existsSync(src)) {
|
||||
fs.copyFileSync(src, dest);
|
||||
}
|
||||
});
|
||||
|
||||
console.log('[OK] Installed shell completions: ~/.ccs/completions/');
|
||||
console.log('');
|
||||
console.log(' [i] Enable auto-completion:');
|
||||
console.log(' Run: ccs --shell-completion');
|
||||
console.log('');
|
||||
|
||||
// Create ~/.claude/settings.json if missing (NEW)
|
||||
const claudeDir = path.join(homedir, '.claude');
|
||||
const claudeSettingsPath = path.join(claudeDir, 'settings.json');
|
||||
|
||||
Reference in new issue
Block a user