cc-hub-cli 1.1.1 → 1.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +3 -3
- package/dist/index.js +32 -21
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,13 +148,13 @@ cc-hub session clean -d 60 --dry-run
|
|
|
148
148
|
|
|
149
149
|
```bash
|
|
150
150
|
# zsh — add to ~/.zshrc
|
|
151
|
-
eval "$(cc-hub
|
|
151
|
+
eval "$(cc-hub completion zsh)"
|
|
152
152
|
|
|
153
153
|
# bash — add to ~/.bashrc
|
|
154
|
-
eval "$(cc-hub
|
|
154
|
+
eval "$(cc-hub completion bash)"
|
|
155
155
|
|
|
156
156
|
# PowerShell — add to $PROFILE
|
|
157
|
-
Invoke-Expression (& cc-hub
|
|
157
|
+
Invoke-Expression (& cc-hub completion powershell | Out-String)
|
|
158
158
|
```
|
|
159
159
|
|
|
160
160
|
Completes subcommands, profile names, and event types.
|
package/dist/index.js
CHANGED
|
@@ -58,22 +58,33 @@ var MacOSDesktopApp = class {
|
|
|
58
58
|
}
|
|
59
59
|
};
|
|
60
60
|
var WindowsDesktopApp = class {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
61
|
+
_buildCandidates() {
|
|
62
|
+
const candidates = [
|
|
63
|
+
path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"), "Claude"),
|
|
64
|
+
path.join(process.env.APPDATA || path.join(os.homedir(), "AppData", "Roaming"), "Claude-3p"),
|
|
65
|
+
path.join(process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"), "Claude"),
|
|
66
|
+
path.join(process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"), "Claude-3p")
|
|
67
|
+
];
|
|
68
|
+
const packagesDir = path.join(
|
|
67
69
|
process.env.LOCALAPPDATA || path.join(os.homedir(), "AppData", "Local"),
|
|
68
|
-
"Packages"
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
70
|
+
"Packages"
|
|
71
|
+
);
|
|
72
|
+
if (fs.existsSync(packagesDir)) {
|
|
73
|
+
try {
|
|
74
|
+
const entries = fs.readdirSync(packagesDir);
|
|
75
|
+
for (const entry of entries) {
|
|
76
|
+
if (entry.startsWith("Claude_")) {
|
|
77
|
+
candidates.push(path.join(packagesDir, entry, "LocalCache", "Roaming", "Claude"));
|
|
78
|
+
candidates.push(path.join(packagesDir, entry, "LocalCache", "Roaming", "Claude-3p"));
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
return candidates;
|
|
85
|
+
}
|
|
75
86
|
_findSupportDir() {
|
|
76
|
-
for (const dir of this.
|
|
87
|
+
for (const dir of this._buildCandidates()) {
|
|
77
88
|
if (fs.existsSync(dir)) return dir;
|
|
78
89
|
}
|
|
79
90
|
return void 0;
|
|
@@ -1746,7 +1757,7 @@ function sessionCommand() {
|
|
|
1746
1757
|
}
|
|
1747
1758
|
|
|
1748
1759
|
// src/complete/index.ts
|
|
1749
|
-
import { Command as Command5 } from "commander";
|
|
1760
|
+
import { Command as Command5, Argument } from "commander";
|
|
1750
1761
|
|
|
1751
1762
|
// src/complete/zsh.ts
|
|
1752
1763
|
var ZSH_COMPLETION = `#compdef cc-hub
|
|
@@ -1760,7 +1771,7 @@ _cc-hub() {
|
|
|
1760
1771
|
'hook:Manage Claude Code hooks in settings.json'
|
|
1761
1772
|
'session:Manage Claude Code sessions'
|
|
1762
1773
|
'provider:Manage provider types'
|
|
1763
|
-
'
|
|
1774
|
+
'completion:Print shell completion functions'
|
|
1764
1775
|
'help:Display help for a command'
|
|
1765
1776
|
)
|
|
1766
1777
|
|
|
@@ -1929,7 +1940,7 @@ _cc-hub() {
|
|
|
1929
1940
|
COMPREPLY=()
|
|
1930
1941
|
cur="\${COMP_WORDS[COMP_CWORD]}"
|
|
1931
1942
|
prev="\${COMP_WORDS[COMP_CWORD-1]}"
|
|
1932
|
-
commands="profile use run hook session provider
|
|
1943
|
+
commands="profile use run hook session provider completion help"
|
|
1933
1944
|
|
|
1934
1945
|
local profile_subcmds="add update list view remove rename default sync"
|
|
1935
1946
|
local provider_subcmds="list"
|
|
@@ -2007,7 +2018,7 @@ var POWERSHELL_COMPLETION = `Register-ArgumentCompleter -Native -CommandName cc-
|
|
|
2007
2018
|
'hook:Manage Claude Code hooks in settings.json'
|
|
2008
2019
|
'session:Manage Claude Code sessions'
|
|
2009
2020
|
'provider:Manage provider types'
|
|
2010
|
-
'
|
|
2021
|
+
'completion:Print shell completion functions'
|
|
2011
2022
|
'help:Display help for a command'
|
|
2012
2023
|
)
|
|
2013
2024
|
|
|
@@ -2054,8 +2065,8 @@ var POWERSHELL_COMPLETION = `Register-ArgumentCompleter -Native -CommandName cc-
|
|
|
2054
2065
|
}`;
|
|
2055
2066
|
|
|
2056
2067
|
// src/complete/index.ts
|
|
2057
|
-
function
|
|
2058
|
-
return new Command5("
|
|
2068
|
+
function completionCommand() {
|
|
2069
|
+
return new Command5("completion").description("Print shell completion script").addArgument(new Argument("<shell>", "Shell type: bash, zsh, or powershell").choices(["bash", "zsh", "powershell"])).action((shell) => {
|
|
2059
2070
|
switch (shell) {
|
|
2060
2071
|
case "zsh":
|
|
2061
2072
|
process.stdout.write(ZSH_COMPLETION);
|
|
@@ -2083,6 +2094,6 @@ program.addCommand(useCommand());
|
|
|
2083
2094
|
program.addCommand(runCommand());
|
|
2084
2095
|
program.addCommand(hooksCommand());
|
|
2085
2096
|
program.addCommand(sessionCommand());
|
|
2086
|
-
program.addCommand(
|
|
2097
|
+
program.addCommand(completionCommand());
|
|
2087
2098
|
program.addCommand(providerCommand());
|
|
2088
2099
|
program.parse();
|