claudeup 4.19.0 → 4.23.0
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/bin/claudeup.js +43 -19
- package/package.json +14 -19
- package/scripts/build-binaries.ts +77 -0
- package/scripts/check-optional-deps.ts +49 -0
- package/scripts/test-isolated.ts +43 -0
- package/src/__tests__/cli-router.test.ts +65 -0
- package/src/__tests__/conventions-integration.test.ts +745 -0
- package/src/__tests__/conventions-manager.test.ts +1172 -0
- package/src/__tests__/doctor-bins.test.ts +35 -0
- package/src/__tests__/doctor.test.ts +450 -0
- package/src/__tests__/dual-write-prevention.test.ts +14 -4
- package/src/__tests__/file-locking.test.ts +208 -0
- package/src/__tests__/gitignore-prerun.test.ts +1 -0
- package/src/__tests__/install-command.test.ts +81 -0
- package/src/__tests__/install-plan.test.ts +98 -0
- package/src/__tests__/manifest.test.ts +136 -0
- package/src/__tests__/marketplace-badge.test.ts +91 -0
- package/src/__tests__/marketplace-refresh.test.ts +267 -0
- package/src/__tests__/plugin-requires.test.ts +133 -0
- package/src/__tests__/plugin-setup.test.ts +7 -0
- package/src/__tests__/profile-command.test.ts +116 -0
- package/src/__tests__/profile-materializer.test.ts +82 -0
- package/src/__tests__/profile-sync.test.ts +136 -0
- package/src/__tests__/registry-version-resolution.test.ts +74 -0
- package/src/__tests__/resolve-executable.test.ts +42 -0
- package/src/__tests__/resolver.test.ts +218 -0
- package/src/__tests__/symlink-manager.test.ts +99 -0
- package/src/__tests__/toolchain.test.ts +56 -0
- package/src/cli/claude.ts +21 -0
- package/src/cli/doctor.ts +132 -0
- package/src/cli/install.ts +360 -0
- package/src/cli/profile.ts +166 -0
- package/src/cli/router.ts +107 -0
- package/src/cli/update.ts +85 -0
- package/src/data/cli-tools.ts +7 -7
- package/src/data/gitignore-defaults.ts +4 -0
- package/src/data/marketplaces.ts +12 -0
- package/src/data/predefined-profiles.ts +3 -4
- package/src/main.tsx +11 -154
- package/src/prerunner/index.ts +62 -27
- package/src/services/claude-cli.ts +19 -22
- package/src/services/claude-settings.ts +99 -26
- package/src/services/conventions-manager.ts +865 -0
- package/src/services/doctor-bins.ts +49 -0
- package/src/services/doctor.ts +509 -0
- package/src/services/install-plan.ts +107 -0
- package/src/services/manifest.ts +166 -0
- package/src/services/marketplace-refresh.ts +173 -0
- package/src/services/plugin-manager.ts +7 -1
- package/src/services/plugin-requires.ts +215 -0
- package/src/services/plugin-version-check.ts +9 -4
- package/src/services/profile-materializer.ts +61 -0
- package/src/services/profile-sync.ts +150 -0
- package/src/services/resolver.ts +293 -0
- package/src/services/symlink-manager.ts +146 -0
- package/src/services/toolchain.ts +97 -0
- package/src/services/version-check.ts +10 -11
- package/src/types/index.ts +138 -31
- package/src/ui/App.tsx +0 -4
- package/src/ui/adapters/pluginsAdapter.ts +13 -0
- package/src/ui/screens/CliToolsScreen.tsx +11 -3
- package/src/ui/screens/index.ts +0 -1
- package/src/ui/state/reducer.ts +0 -101
- package/src/ui/state/types.ts +0 -35
- package/src/utils/command-utils.ts +23 -0
- package/src/utils/file-locking.ts +144 -0
- package/src/data/alias-flags.js +0 -205
- package/src/data/cli-tools.js +0 -123
- package/src/data/gitignore-defaults.js +0 -24
- package/src/data/gitignore-reasons.js +0 -97
- package/src/data/gitignore-templates.js +0 -21
- package/src/data/marketplaces.js +0 -138
- package/src/data/mcp-servers.js +0 -509
- package/src/data/predefined-profiles.js +0 -248
- package/src/data/settings-catalog.js +0 -625
- package/src/data/skill-repos.js +0 -160
- package/src/data/statuslines.js +0 -159
- package/src/data/statuslines.ts +0 -188
- package/src/index.js +0 -4
- package/src/index.ts +0 -5
- package/src/main.js +0 -170
- package/src/prerunner/index.js +0 -252
- package/src/services/alias-settings.js +0 -51
- package/src/services/alias-shell-writer.js +0 -1018
- package/src/services/alias-store.js +0 -129
- package/src/services/claude-cli.js +0 -189
- package/src/services/claude-runner.js +0 -28
- package/src/services/claude-settings.js +0 -1223
- package/src/services/gitignore-detector.js +0 -155
- package/src/services/gitignore-fixer.js +0 -231
- package/src/services/gitignore-prerun.js +0 -46
- package/src/services/gitignore-resolver.js +0 -143
- package/src/services/gitignore-service.js +0 -117
- package/src/services/local-marketplace.js +0 -339
- package/src/services/marketplace-fetcher.js +0 -96
- package/src/services/marketplace-sync.js +0 -94
- package/src/services/mcp-registry.js +0 -87
- package/src/services/plugin-manager.js +0 -473
- package/src/services/plugin-mcp-config.js +0 -177
- package/src/services/plugin-setup.js +0 -499
- package/src/services/plugin-version-check.js +0 -262
- package/src/services/profiles.js +0 -161
- package/src/services/settings-manager.js +0 -243
- package/src/services/skills-manager.js +0 -393
- package/src/services/skillsmp-client.js +0 -87
- package/src/services/update-cache.js +0 -52
- package/src/services/version-check.js +0 -99
- package/src/types/gitignore.js +0 -6
- package/src/types/index.js +0 -1
- package/src/ui/App.js +0 -355
- package/src/ui/adapters/pluginsAdapter.js +0 -139
- package/src/ui/adapters/settingsAdapter.js +0 -111
- package/src/ui/adapters/skillsAdapter.js +0 -154
- package/src/ui/components/CategoryHeader.js +0 -9
- package/src/ui/components/EmptyFilterState.js +0 -4
- package/src/ui/components/FlagDetailEditor.js +0 -0
- package/src/ui/components/ScopeIndicator.js +0 -30
- package/src/ui/components/ScrollableList.js +0 -36
- package/src/ui/components/SearchInput.js +0 -19
- package/src/ui/components/StyledText.js +0 -39
- package/src/ui/components/TabBar.js +0 -19
- package/src/ui/components/layout/FooterHints.js +0 -29
- package/src/ui/components/layout/Panel.js +0 -6
- package/src/ui/components/layout/ProgressBar.js +0 -14
- package/src/ui/components/layout/ScopeTabs.js +0 -6
- package/src/ui/components/layout/ScreenLayout.js +0 -16
- package/src/ui/components/layout/index.js +0 -5
- package/src/ui/components/modals/ConfirmModal.js +0 -14
- package/src/ui/components/modals/InputModal.js +0 -5
- package/src/ui/components/modals/LoadingModal.js +0 -17
- package/src/ui/components/modals/MessageModal.js +0 -16
- package/src/ui/components/modals/ModalContainer.js +0 -137
- package/src/ui/components/modals/SelectModal.js +0 -18
- package/src/ui/components/modals/VersionMismatchModal.js +0 -36
- package/src/ui/components/modals/index.js +0 -6
- package/src/ui/components/primitives/ActionHints.js +0 -13
- package/src/ui/components/primitives/DetailSection.js +0 -7
- package/src/ui/components/primitives/KeyValueLine.js +0 -8
- package/src/ui/components/primitives/ListCategoryRow.js +0 -8
- package/src/ui/components/primitives/MetaText.js +0 -8
- package/src/ui/components/primitives/ScopeDetail.js +0 -32
- package/src/ui/components/primitives/ScopeSquares.js +0 -11
- package/src/ui/components/primitives/SelectableRow.js +0 -5
- package/src/ui/components/primitives/index.js +0 -8
- package/src/ui/hooks/index.js +0 -4
- package/src/ui/hooks/useAsyncData.js +0 -77
- package/src/ui/hooks/useGitignoreModal.js +0 -74
- package/src/ui/hooks/useKeyboard.js +0 -13
- package/src/ui/hooks/useKeyboardHandler.js +0 -39
- package/src/ui/hooks/useMismatchModal.js +0 -77
- package/src/ui/registry.js +0 -1
- package/src/ui/renderers/cliToolRenderers.js +0 -54
- package/src/ui/renderers/gitignoreRenderers.js +0 -46
- package/src/ui/renderers/mcpRenderers.js +0 -26
- package/src/ui/renderers/pluginRenderers.js +0 -124
- package/src/ui/renderers/profileRenderers.js +0 -177
- package/src/ui/renderers/settingsRenderers.js +0 -73
- package/src/ui/renderers/skillRenderers.js +0 -138
- package/src/ui/screens/AliasScreen.js +0 -1111
- package/src/ui/screens/CliToolsScreen.js +0 -338
- package/src/ui/screens/EnvVarsScreen.js +0 -152
- package/src/ui/screens/GitignoreScreen.js +0 -328
- package/src/ui/screens/McpRegistryScreen.js +0 -238
- package/src/ui/screens/McpScreen.js +0 -176
- package/src/ui/screens/ModelSelectorScreen.js +0 -296
- package/src/ui/screens/ModelSelectorScreen.tsx +0 -444
- package/src/ui/screens/PluginsScreen.js +0 -769
- package/src/ui/screens/ProfilesScreen.js +0 -298
- package/src/ui/screens/SkillsScreen.js +0 -549
- package/src/ui/screens/StatusLineScreen.js +0 -206
- package/src/ui/screens/StatusLineScreen.tsx +0 -416
- package/src/ui/screens/index.js +0 -10
- package/src/ui/state/AnimationContext.js +0 -34
- package/src/ui/state/AppContext.js +0 -162
- package/src/ui/state/DimensionsContext.js +0 -71
- package/src/ui/state/reducer.js +0 -547
- package/src/ui/state/types.js +0 -1
- package/src/ui/theme.js +0 -47
- package/src/utils/clipboard.js +0 -56
- package/src/utils/command-utils.js +0 -19
- package/src/utils/fuzzy-search.js +0 -101
- package/src/utils/string-utils.js +0 -62
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* File locking utilities for concurrent write protection
|
|
3
|
+
*
|
|
4
|
+
* Prevents race conditions when multiple processes modify settings files
|
|
5
|
+
* Uses lock files for cross-platform compatibility
|
|
6
|
+
*/
|
|
7
|
+
|
|
8
|
+
import { open, mkdir } from 'node:fs/promises';
|
|
9
|
+
import { dirname } from 'node:path';
|
|
10
|
+
import { existsSync } from 'node:fs';
|
|
11
|
+
import type { FileHandle } from 'node:fs/promises';
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Maximum time to wait for a lock (milliseconds)
|
|
15
|
+
*/
|
|
16
|
+
const LOCK_TIMEOUT_MS = 10000;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* Lock retry interval (milliseconds)
|
|
20
|
+
*/
|
|
21
|
+
const LOCK_RETRY_INTERVAL_MS = 100;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Acquire exclusive lock on file and execute operation
|
|
25
|
+
* Uses lock files for cross-platform compatibility
|
|
26
|
+
*
|
|
27
|
+
* @param filePath - Path to file to lock
|
|
28
|
+
* @param operation - Async operation to execute with lock held
|
|
29
|
+
* @returns Result of the operation
|
|
30
|
+
* @throws Error if lock cannot be acquired within timeout
|
|
31
|
+
*/
|
|
32
|
+
export async function withFileLock<T>(
|
|
33
|
+
filePath: string,
|
|
34
|
+
operation: () => Promise<T>,
|
|
35
|
+
): Promise<T> {
|
|
36
|
+
const lockPath = `${filePath}.lock`;
|
|
37
|
+
const lockDir = dirname(lockPath);
|
|
38
|
+
|
|
39
|
+
// Ensure lock directory exists
|
|
40
|
+
if (!existsSync(lockDir)) {
|
|
41
|
+
await mkdir(lockDir, { recursive: true });
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const startTime = Date.now();
|
|
45
|
+
let fileHandle: FileHandle | null = null;
|
|
46
|
+
|
|
47
|
+
// Try to acquire lock with retries
|
|
48
|
+
while (Date.now() - startTime < LOCK_TIMEOUT_MS) {
|
|
49
|
+
try {
|
|
50
|
+
// Try to create lock file exclusively (fails if exists)
|
|
51
|
+
fileHandle = await open(lockPath, 'wx');
|
|
52
|
+
|
|
53
|
+
// Write PID to lock file for debugging
|
|
54
|
+
await fileHandle.write(`${process.pid}\n${new Date().toISOString()}\n`);
|
|
55
|
+
|
|
56
|
+
break;
|
|
57
|
+
} catch (error: unknown) {
|
|
58
|
+
// Lock file exists, retry after interval
|
|
59
|
+
if ((error as NodeJS.ErrnoException).code === 'EEXIST') {
|
|
60
|
+
await new Promise((resolve) => setTimeout(resolve, LOCK_RETRY_INTERVAL_MS));
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
throw error;
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
if (fileHandle === null) {
|
|
68
|
+
throw new Error(
|
|
69
|
+
`Failed to acquire lock on ${filePath} after ${LOCK_TIMEOUT_MS}ms. ` +
|
|
70
|
+
`Another process may be holding the lock. Lock file: ${lockPath}`,
|
|
71
|
+
);
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
try {
|
|
75
|
+
// Execute operation with lock held
|
|
76
|
+
return await operation();
|
|
77
|
+
} finally {
|
|
78
|
+
// Release lock
|
|
79
|
+
try {
|
|
80
|
+
await fileHandle.close();
|
|
81
|
+
// Delete lock file
|
|
82
|
+
const fs = await import('node:fs/promises');
|
|
83
|
+
await fs.unlink(lockPath);
|
|
84
|
+
} catch (error) {
|
|
85
|
+
// Log error but don't throw - operation succeeded
|
|
86
|
+
console.error(`Warning: Failed to release lock ${lockPath}:`, error);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* Check if file is currently locked
|
|
93
|
+
*
|
|
94
|
+
* @param filePath - Path to file to check
|
|
95
|
+
* @returns True if lock file exists
|
|
96
|
+
*/
|
|
97
|
+
export function isFileLocked(filePath: string): boolean {
|
|
98
|
+
const lockPath = `${filePath}.lock`;
|
|
99
|
+
return existsSync(lockPath);
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* Force remove lock file (use with caution)
|
|
104
|
+
* Only use if you're certain the lock is stale
|
|
105
|
+
*
|
|
106
|
+
* @param filePath - Path to file whose lock to remove
|
|
107
|
+
*/
|
|
108
|
+
export async function forceRemoveLock(filePath: string): Promise<void> {
|
|
109
|
+
const lockPath = `${filePath}.lock`;
|
|
110
|
+
try {
|
|
111
|
+
const fs = await import('node:fs/promises');
|
|
112
|
+
await fs.unlink(lockPath);
|
|
113
|
+
} catch (error: unknown) {
|
|
114
|
+
// Ignore ENOENT (lock doesn't exist)
|
|
115
|
+
if ((error as NodeJS.ErrnoException).code !== 'ENOENT') {
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
/**
|
|
122
|
+
* Get information about current lock
|
|
123
|
+
*
|
|
124
|
+
* @param filePath - Path to file to check
|
|
125
|
+
* @returns Lock info or null if not locked
|
|
126
|
+
*/
|
|
127
|
+
export async function getLockInfo(
|
|
128
|
+
filePath: string,
|
|
129
|
+
): Promise<{ pid: string; timestamp: string } | null> {
|
|
130
|
+
const lockPath = `${filePath}.lock`;
|
|
131
|
+
|
|
132
|
+
if (!existsSync(lockPath)) {
|
|
133
|
+
return null;
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
try {
|
|
137
|
+
const fs = await import('node:fs/promises');
|
|
138
|
+
const content = await fs.readFile(lockPath, 'utf-8');
|
|
139
|
+
const [pid, timestamp] = content.trim().split('\n');
|
|
140
|
+
return { pid, timestamp };
|
|
141
|
+
} catch (error) {
|
|
142
|
+
return null;
|
|
143
|
+
}
|
|
144
|
+
}
|
package/src/data/alias-flags.js
DELETED
|
@@ -1,205 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Catalog of `claude` CLI flags that the Alias tab can compose into a managed
|
|
3
|
-
* shell alias. Verified against `claude --help` output and binary string scan
|
|
4
|
-
* of the shipped Claude Code 2.1.x binary.
|
|
5
|
-
*
|
|
6
|
-
* The catalog drives both the UI editor for each flag and the renderer that
|
|
7
|
-
* emits the final `alias claude='claude …'` string per shell.
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Tokens supported in `templated: true` flag values. Description text is
|
|
11
|
-
* shown to the user; the actual shell-substitution code lives in the writer
|
|
12
|
-
* because it needs per-shell variants.
|
|
13
|
-
*
|
|
14
|
-
* Intentionally excludes `{hash}` for v1 — its only portable form is
|
|
15
|
-
* `od -An -N4 -tx1 /dev/urandom | tr -d ' \n'`, which looks frightening in a
|
|
16
|
-
* shell rc file. Users who want randomness can pair this prefix with bare
|
|
17
|
-
* `--remote-control` (which already auto-generates a unique suffix).
|
|
18
|
-
*/
|
|
19
|
-
export const TEMPLATE_TOKENS = [
|
|
20
|
-
{ token: "{folder}", description: "current directory's basename" },
|
|
21
|
-
{ token: "{day}", description: "day of month, zero-padded (01-31)" },
|
|
22
|
-
{ token: "{month}", description: "month, zero-padded (01-12)" },
|
|
23
|
-
{ token: "{year}", description: "4-digit year" },
|
|
24
|
-
];
|
|
25
|
-
export const FLAG_GROUPS = [
|
|
26
|
-
{ id: "danger", label: "Permissions" },
|
|
27
|
-
{ id: "session", label: "Session" },
|
|
28
|
-
{ id: "context", label: "Context" },
|
|
29
|
-
{ id: "channels", label: "Development channels" },
|
|
30
|
-
{ id: "debug", label: "Debug" },
|
|
31
|
-
{ id: "integration", label: "Integrations" },
|
|
32
|
-
{ id: "worktree", label: "Worktree" },
|
|
33
|
-
];
|
|
34
|
-
export const ALIAS_FLAGS = [
|
|
35
|
-
{
|
|
36
|
-
id: "dangerously-skip-permissions",
|
|
37
|
-
label: "Skip permission checks",
|
|
38
|
-
flag: "--dangerously-skip-permissions",
|
|
39
|
-
kind: "boolean",
|
|
40
|
-
group: "danger",
|
|
41
|
-
description: "Bypass all permission checks. Recommended only for sandboxes with no internet access.",
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "allow-dangerously-skip-permissions",
|
|
45
|
-
label: "Allow skip-permissions opt-in",
|
|
46
|
-
flag: "--allow-dangerously-skip-permissions",
|
|
47
|
-
kind: "boolean",
|
|
48
|
-
group: "danger",
|
|
49
|
-
description: "Enable the skip-permissions option without making it the default.",
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
id: "remote-control",
|
|
53
|
-
label: "Remote control",
|
|
54
|
-
flag: "--remote-control",
|
|
55
|
-
kind: "boolean",
|
|
56
|
-
group: "session",
|
|
57
|
-
description: "Start an interactive session with Remote Control enabled. Claude Code auto-generates a unique session name; use --remote-control-session-name-prefix to customize it.",
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
id: "remote-control-session-name-prefix",
|
|
61
|
-
label: "Remote control name prefix",
|
|
62
|
-
flag: "--remote-control-session-name-prefix",
|
|
63
|
-
kind: "text",
|
|
64
|
-
templated: true,
|
|
65
|
-
group: "session",
|
|
66
|
-
description: "Prefix for auto-generated Remote Control session names. Default: hostname. Supports template tokens that expand on each shell invocation: {folder} (basename of $PWD), {day}, {month}, {year}. Example: dev-{folder}-{day} → dev-myproject-15.",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: "ide",
|
|
70
|
-
label: "Auto-connect to IDE",
|
|
71
|
-
flag: "--ide",
|
|
72
|
-
kind: "boolean",
|
|
73
|
-
group: "integration",
|
|
74
|
-
description: "Automatically connect to IDE on startup if exactly one valid IDE is available.",
|
|
75
|
-
},
|
|
76
|
-
{
|
|
77
|
-
id: "chrome",
|
|
78
|
-
label: "Chrome integration",
|
|
79
|
-
flag: "--chrome",
|
|
80
|
-
triStateOff: "--no-chrome",
|
|
81
|
-
kind: "tri-state",
|
|
82
|
-
group: "integration",
|
|
83
|
-
description: "Enable or disable Claude in Chrome integration. Unset leaves the project default in place.",
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
id: "effort",
|
|
87
|
-
label: "Effort level",
|
|
88
|
-
flag: "--effort",
|
|
89
|
-
kind: "select",
|
|
90
|
-
group: "session",
|
|
91
|
-
description: "Effort level for the current session.",
|
|
92
|
-
options: [
|
|
93
|
-
{ label: "low", value: "low" },
|
|
94
|
-
{ label: "medium", value: "medium" },
|
|
95
|
-
{ label: "high", value: "high" },
|
|
96
|
-
{ label: "xhigh", value: "xhigh" },
|
|
97
|
-
{ label: "max", value: "max" },
|
|
98
|
-
],
|
|
99
|
-
},
|
|
100
|
-
{
|
|
101
|
-
id: "system-prompt",
|
|
102
|
-
label: "System prompt",
|
|
103
|
-
flag: "--system-prompt",
|
|
104
|
-
kind: "text",
|
|
105
|
-
group: "context",
|
|
106
|
-
xorGroup: "system-prompt",
|
|
107
|
-
description: "System prompt text to use for the session. Mutually exclusive with --system-prompt-file.",
|
|
108
|
-
},
|
|
109
|
-
{
|
|
110
|
-
id: "system-prompt-file",
|
|
111
|
-
label: "System prompt file",
|
|
112
|
-
flag: "--system-prompt-file",
|
|
113
|
-
kind: "text",
|
|
114
|
-
group: "context",
|
|
115
|
-
xorGroup: "system-prompt",
|
|
116
|
-
description: "Path to a file whose contents replace the default system prompt. Mutually exclusive with --system-prompt.",
|
|
117
|
-
},
|
|
118
|
-
{
|
|
119
|
-
id: "append-system-prompt",
|
|
120
|
-
label: "Append system prompt",
|
|
121
|
-
flag: "--append-system-prompt",
|
|
122
|
-
kind: "text",
|
|
123
|
-
group: "context",
|
|
124
|
-
description: "Text appended to the default system prompt. Composes with --system-prompt.",
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
id: "append-system-prompt-file",
|
|
128
|
-
label: "Append system prompt file",
|
|
129
|
-
flag: "--append-system-prompt-file",
|
|
130
|
-
kind: "text",
|
|
131
|
-
group: "context",
|
|
132
|
-
description: "Path to a file whose contents are appended to the default system prompt.",
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
id: "channels",
|
|
136
|
-
label: "Channels (approved)",
|
|
137
|
-
flag: "--channels",
|
|
138
|
-
kind: "text-list",
|
|
139
|
-
group: "channels",
|
|
140
|
-
description: "Approved channel plugins/MCP servers to run this session (the allowlist). Channels derived from --dangerously-load appear in a separate section here and are unioned in on write; add your own approved channels on top.",
|
|
141
|
-
defaultValues: [],
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
id: "dangerously-load-development-channels",
|
|
145
|
-
label: "Load development channels",
|
|
146
|
-
flag: "--dangerously-load-development-channels",
|
|
147
|
-
kind: "text-list",
|
|
148
|
-
group: "channels",
|
|
149
|
-
description: "Sideload development channels not on the approved allowlist (local dev only). Also shown under --channels and unioned into it on write. Default seed: claudish (the only magus plugin currently shipping channels).",
|
|
150
|
-
defaultValues: ["plugin:claudish@magus"],
|
|
151
|
-
},
|
|
152
|
-
{
|
|
153
|
-
id: "debug",
|
|
154
|
-
label: "Debug categories",
|
|
155
|
-
flag: "--debug",
|
|
156
|
-
shortFlag: "-d",
|
|
157
|
-
kind: "multi-with-custom",
|
|
158
|
-
group: "debug",
|
|
159
|
-
description: "Enable debug mode with optional category filter. Pick from common categories or add custom tokens (including negations like !file).",
|
|
160
|
-
picklist: [
|
|
161
|
-
"api",
|
|
162
|
-
"hooks",
|
|
163
|
-
"mcp",
|
|
164
|
-
"tools",
|
|
165
|
-
"plugins",
|
|
166
|
-
"skills",
|
|
167
|
-
"settings",
|
|
168
|
-
"permissions",
|
|
169
|
-
"auth",
|
|
170
|
-
"cache",
|
|
171
|
-
"statsig",
|
|
172
|
-
"file",
|
|
173
|
-
"1p",
|
|
174
|
-
],
|
|
175
|
-
defaultValues: [],
|
|
176
|
-
},
|
|
177
|
-
{
|
|
178
|
-
id: "worktree",
|
|
179
|
-
label: "Use worktree",
|
|
180
|
-
flag: "--worktree",
|
|
181
|
-
kind: "boolean",
|
|
182
|
-
group: "worktree",
|
|
183
|
-
description: "Create a git worktree for the session. Prerequisite for --tmux.",
|
|
184
|
-
},
|
|
185
|
-
{
|
|
186
|
-
id: "tmux",
|
|
187
|
-
label: "tmux session",
|
|
188
|
-
flag: "--tmux",
|
|
189
|
-
kind: "select",
|
|
190
|
-
group: "worktree",
|
|
191
|
-
requires: "worktree",
|
|
192
|
-
description: "Create a tmux session for the worktree. Requires --worktree. iTerm2 native panes when available; classic for traditional tmux.",
|
|
193
|
-
options: [
|
|
194
|
-
{ label: "auto (iTerm2 native)", value: "" },
|
|
195
|
-
{ label: "classic", value: "classic" },
|
|
196
|
-
],
|
|
197
|
-
},
|
|
198
|
-
];
|
|
199
|
-
/** Look up a flag by id. Throws if missing — keeps callers honest. */
|
|
200
|
-
export function getFlagById(id) {
|
|
201
|
-
const f = ALIAS_FLAGS.find((flag) => flag.id === id);
|
|
202
|
-
if (!f)
|
|
203
|
-
throw new Error(`Unknown alias flag id: ${id}`);
|
|
204
|
-
return f;
|
|
205
|
-
}
|
package/src/data/cli-tools.js
DELETED
|
@@ -1,123 +0,0 @@
|
|
|
1
|
-
export const cliTools = [
|
|
2
|
-
{
|
|
3
|
-
name: "claudeup",
|
|
4
|
-
displayName: "claudeup",
|
|
5
|
-
description: "TUI tool for managing Claude Code plugins, MCPs, and configuration",
|
|
6
|
-
installCommand: "npm install -g claudeup",
|
|
7
|
-
checkCommand: "claudeup --version",
|
|
8
|
-
website: "https://github.com/MadAppGang/magus/tree/main/tools/claudeup",
|
|
9
|
-
category: "ai-coding",
|
|
10
|
-
packageManager: "npm",
|
|
11
|
-
packageName: "claudeup",
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
name: "mnemex",
|
|
15
|
-
displayName: "Mnemex",
|
|
16
|
-
description: "AST-aware code search with PageRank, callers/callees, and semantic embeddings",
|
|
17
|
-
installCommand: "npm install -g mnemex",
|
|
18
|
-
checkCommand: "mnemex --version",
|
|
19
|
-
website: "https://github.com/MadAppGang/mnemex",
|
|
20
|
-
category: "ai-coding",
|
|
21
|
-
packageManager: "npm",
|
|
22
|
-
packageName: "mnemex",
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
name: "claudish",
|
|
26
|
-
displayName: "Claudish",
|
|
27
|
-
description: "Run Claude Code with OpenRouter models (Grok, GPT-5, Gemini)",
|
|
28
|
-
installCommand: "npm install -g claudish",
|
|
29
|
-
checkCommand: "claudish --version",
|
|
30
|
-
website: "https://github.com/MadAppGang/claudish",
|
|
31
|
-
category: "ai-coding",
|
|
32
|
-
packageManager: "npm",
|
|
33
|
-
packageName: "claudish",
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
name: "claude",
|
|
37
|
-
displayName: "Claude Code",
|
|
38
|
-
description: "Anthropic official agentic coding tool",
|
|
39
|
-
installCommand: "npm install -g @anthropic-ai/claude-code",
|
|
40
|
-
checkCommand: "claude --version",
|
|
41
|
-
website: "https://claude.ai/code",
|
|
42
|
-
category: "ai-coding",
|
|
43
|
-
packageManager: "npm",
|
|
44
|
-
packageName: "@anthropic-ai/claude-code",
|
|
45
|
-
},
|
|
46
|
-
{
|
|
47
|
-
name: "codex",
|
|
48
|
-
displayName: "OpenAI Codex",
|
|
49
|
-
description: "Lightweight coding agent from OpenAI that runs in your terminal",
|
|
50
|
-
installCommand: "npm install -g @openai/codex",
|
|
51
|
-
checkCommand: "codex --version",
|
|
52
|
-
website: "https://github.com/openai/codex",
|
|
53
|
-
category: "ai-coding",
|
|
54
|
-
packageManager: "npm",
|
|
55
|
-
packageName: "@openai/codex",
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
name: "gemini",
|
|
59
|
-
displayName: "Gemini CLI",
|
|
60
|
-
description: "Google AI agent with 1M token context, free tier available",
|
|
61
|
-
installCommand: "npm install -g @google/gemini-cli",
|
|
62
|
-
checkCommand: "gemini --version",
|
|
63
|
-
website: "https://github.com/google-gemini/gemini-cli",
|
|
64
|
-
category: "ai-coding",
|
|
65
|
-
packageManager: "npm",
|
|
66
|
-
packageName: "@google/gemini-cli",
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
name: "qwen",
|
|
70
|
-
displayName: "Qwen Code",
|
|
71
|
-
description: "Alibaba coding agent optimized for Qwen3-Coder models",
|
|
72
|
-
installCommand: "npm install -g @qwen-code/qwen-code",
|
|
73
|
-
checkCommand: "qwen --version",
|
|
74
|
-
website: "https://github.com/QwenLM/qwen-code",
|
|
75
|
-
category: "ai-coding",
|
|
76
|
-
packageManager: "npm",
|
|
77
|
-
packageName: "@qwen-code/qwen-code",
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
name: "cline",
|
|
81
|
-
displayName: "Cline",
|
|
82
|
-
description: "Autonomous coding agent with plan & act, checkpoints, browser use",
|
|
83
|
-
installCommand: "npm install -g cline",
|
|
84
|
-
checkCommand: "cline --version",
|
|
85
|
-
website: "https://cline.bot",
|
|
86
|
-
category: "ai-coding",
|
|
87
|
-
packageManager: "npm",
|
|
88
|
-
packageName: "cline",
|
|
89
|
-
},
|
|
90
|
-
{
|
|
91
|
-
name: "opencode",
|
|
92
|
-
displayName: "OpenCode",
|
|
93
|
-
description: "Open source AI coding agent trusted by 400k+ developers",
|
|
94
|
-
installCommand: "npm install -g opencode-ai",
|
|
95
|
-
checkCommand: "opencode --version",
|
|
96
|
-
website: "https://opencode.ai",
|
|
97
|
-
category: "ai-coding",
|
|
98
|
-
packageManager: "npm",
|
|
99
|
-
packageName: "opencode-ai",
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
name: "aider",
|
|
103
|
-
displayName: "Aider",
|
|
104
|
-
description: "AI pair programming - works with Claude, GPT-4, local models",
|
|
105
|
-
installCommand: "pip install aider-install && aider-install",
|
|
106
|
-
checkCommand: "aider --version",
|
|
107
|
-
website: "https://aider.chat",
|
|
108
|
-
category: "ai-coding",
|
|
109
|
-
packageManager: "pip",
|
|
110
|
-
packageName: "aider-chat",
|
|
111
|
-
},
|
|
112
|
-
{
|
|
113
|
-
name: "crush",
|
|
114
|
-
displayName: "Crush",
|
|
115
|
-
description: "AI coding assistant from Charm with terminal-native UX",
|
|
116
|
-
installCommand: "npm install -g @charmland/crush",
|
|
117
|
-
checkCommand: "crush --version",
|
|
118
|
-
website: "https://github.com/charmbracelet/crush",
|
|
119
|
-
category: "ai-coding",
|
|
120
|
-
packageManager: "npm",
|
|
121
|
-
packageName: "@charmland/crush",
|
|
122
|
-
},
|
|
123
|
-
];
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Conservative built-in defaults. These ship inside claudeup and apply to
|
|
3
|
-
* every project unless overridden by a global or project manifest. Kept narrow
|
|
4
|
-
* on purpose — broader patterns (node_modules, .env, .DS_Store, …) live in the
|
|
5
|
-
* "common-dev" template which users opt into via `extends`.
|
|
6
|
-
*/
|
|
7
|
-
export const BUILTIN_DEFAULTS = {
|
|
8
|
-
ignore: [
|
|
9
|
-
".claude/settings.local.json",
|
|
10
|
-
".claude/scheduled_tasks.lock",
|
|
11
|
-
".claude/cache/",
|
|
12
|
-
".claude/.statusline-worktree-*",
|
|
13
|
-
"ai-docs/sessions/",
|
|
14
|
-
".mnemex/",
|
|
15
|
-
".claudemem/",
|
|
16
|
-
"gtd/sessions/",
|
|
17
|
-
".agents/",
|
|
18
|
-
],
|
|
19
|
-
track: [
|
|
20
|
-
".claude/settings.json",
|
|
21
|
-
".mcp.json",
|
|
22
|
-
"plugin.json",
|
|
23
|
-
],
|
|
24
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
const RULE_REASONS = new Map([
|
|
2
|
-
[
|
|
3
|
-
key("ignore", ".claude/settings.local.json"),
|
|
4
|
-
"Personal Claude settings belong to each developer and should not be shared.",
|
|
5
|
-
],
|
|
6
|
-
[
|
|
7
|
-
key("ignore", ".claude/scheduled_tasks.lock"),
|
|
8
|
-
"Runtime lock files are local process state and should be regenerated locally.",
|
|
9
|
-
],
|
|
10
|
-
[
|
|
11
|
-
key("ignore", ".claude/cache/"),
|
|
12
|
-
"Claude cache contents are local generated data and can grow quickly.",
|
|
13
|
-
],
|
|
14
|
-
[
|
|
15
|
-
key("ignore", ".claude/.statusline-worktree-*"),
|
|
16
|
-
"Statusline worktree markers are local runtime state.",
|
|
17
|
-
],
|
|
18
|
-
[
|
|
19
|
-
key("ignore", "ai-docs/sessions/"),
|
|
20
|
-
"Session transcripts and scratch notes are local working artifacts.",
|
|
21
|
-
],
|
|
22
|
-
[
|
|
23
|
-
key("ignore", ".mnemex/"),
|
|
24
|
-
"Local memory/index data is machine-specific and regenerated by tooling.",
|
|
25
|
-
],
|
|
26
|
-
[
|
|
27
|
-
key("ignore", ".claudemem/"),
|
|
28
|
-
"Local claudemem indexes are generated from the repo and should not be committed.",
|
|
29
|
-
],
|
|
30
|
-
[
|
|
31
|
-
key("ignore", "gtd/sessions/"),
|
|
32
|
-
"Local GTD session artifacts are personal workflow state.",
|
|
33
|
-
],
|
|
34
|
-
[
|
|
35
|
-
key("ignore", ".agents/"),
|
|
36
|
-
"Local agent workspaces and runtime artifacts should stay out of team history.",
|
|
37
|
-
],
|
|
38
|
-
[
|
|
39
|
-
key("ignore", "node_modules/"),
|
|
40
|
-
"Installed dependencies are restored from the package manager lockfile.",
|
|
41
|
-
],
|
|
42
|
-
[
|
|
43
|
-
key("ignore", ".env"),
|
|
44
|
-
"Environment files commonly contain local secrets and machine-specific values.",
|
|
45
|
-
],
|
|
46
|
-
[
|
|
47
|
-
key("ignore", ".env.local"),
|
|
48
|
-
"Local environment overrides commonly contain secrets or developer-specific values.",
|
|
49
|
-
],
|
|
50
|
-
[
|
|
51
|
-
key("ignore", ".DS_Store"),
|
|
52
|
-
"macOS Finder metadata is machine-generated noise.",
|
|
53
|
-
],
|
|
54
|
-
[
|
|
55
|
-
key("ignore", "dist/"),
|
|
56
|
-
"Distribution output is generated from source during builds.",
|
|
57
|
-
],
|
|
58
|
-
[
|
|
59
|
-
key("ignore", "build/"),
|
|
60
|
-
"Build output is generated from source during builds.",
|
|
61
|
-
],
|
|
62
|
-
[
|
|
63
|
-
key("ignore", "*.log"),
|
|
64
|
-
"Log files are runtime output and usually contain noisy local details.",
|
|
65
|
-
],
|
|
66
|
-
[
|
|
67
|
-
key("ignore", "coverage/"),
|
|
68
|
-
"Coverage reports are generated by test runs.",
|
|
69
|
-
],
|
|
70
|
-
[
|
|
71
|
-
key("ignore", ".cache/"),
|
|
72
|
-
"Tool cache contents are local generated data.",
|
|
73
|
-
],
|
|
74
|
-
[
|
|
75
|
-
key("track", ".claude/settings.json"),
|
|
76
|
-
"Team Claude settings should be committed so everyone gets the same project behavior.",
|
|
77
|
-
],
|
|
78
|
-
[
|
|
79
|
-
key("track", ".mcp.json"),
|
|
80
|
-
"Team MCP configuration should be committed so shared tools are discoverable.",
|
|
81
|
-
],
|
|
82
|
-
[
|
|
83
|
-
key("track", "plugin.json"),
|
|
84
|
-
"The plugin manifest is source metadata required by the plugin system.",
|
|
85
|
-
],
|
|
86
|
-
]);
|
|
87
|
-
export function getGitignoreRuleReason(action, pattern) {
|
|
88
|
-
const reason = RULE_REASONS.get(key(action, pattern));
|
|
89
|
-
if (reason)
|
|
90
|
-
return reason;
|
|
91
|
-
return action === "ignore"
|
|
92
|
-
? "A managed rule says this path should stay out of git."
|
|
93
|
-
: "A managed rule says this path should stay tracked in git.";
|
|
94
|
-
}
|
|
95
|
-
function key(action, pattern) {
|
|
96
|
-
return `${action}:${pattern}`;
|
|
97
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Opt-in templates a user manifest can pull in via `extends`. Kept separate
|
|
3
|
-
* from BUILTIN_DEFAULTS so the active baseline stays minimal — these only
|
|
4
|
-
* apply when explicitly requested.
|
|
5
|
-
*/
|
|
6
|
-
export const BUILTIN_TEMPLATES = {
|
|
7
|
-
"common-dev": {
|
|
8
|
-
ignore: [
|
|
9
|
-
"node_modules/",
|
|
10
|
-
".env",
|
|
11
|
-
".env.local",
|
|
12
|
-
".DS_Store",
|
|
13
|
-
"dist/",
|
|
14
|
-
"build/",
|
|
15
|
-
"*.log",
|
|
16
|
-
"coverage/",
|
|
17
|
-
".cache/",
|
|
18
|
-
],
|
|
19
|
-
track: [],
|
|
20
|
-
},
|
|
21
|
-
};
|