claude-multi 0.4.3 → 0.5.1

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.
Files changed (38) hide show
  1. package/.agents/skills/three/SKILL.md +106 -0
  2. package/.agents/skills/threejs-animation/SKILL.md +552 -0
  3. package/.agents/skills/threejs-fundamentals/SKILL.md +488 -0
  4. package/.agents/skills/threejs-geometry/SKILL.md +548 -0
  5. package/.agents/skills/threejs-interaction/SKILL.md +660 -0
  6. package/.agents/skills/threejs-lighting/SKILL.md +481 -0
  7. package/.agents/skills/threejs-loaders/SKILL.md +623 -0
  8. package/.agents/skills/threejs-materials/SKILL.md +520 -0
  9. package/.agents/skills/threejs-postprocessing/SKILL.md +602 -0
  10. package/.agents/skills/threejs-shaders/SKILL.md +642 -0
  11. package/.agents/skills/threejs-textures/SKILL.md +628 -0
  12. package/.commandcode/taste/taste.md +9 -0
  13. package/CHANGELOG.md +94 -0
  14. package/README.md +62 -179
  15. package/astro.config.mjs +69 -0
  16. package/bun.lock +1353 -0
  17. package/dist/cli.js +51658 -5463
  18. package/package.json +28 -5
  19. package/public/android-chrome-192x192.png +0 -0
  20. package/public/android-chrome-512x512.png +0 -0
  21. package/public/apple-touch-icon.png +0 -0
  22. package/public/favicon-16x16.png +0 -0
  23. package/public/favicon-32x32.png +0 -0
  24. package/public/favicon-animated.svg +140 -0
  25. package/public/favicon.json +1 -0
  26. package/public/favicon.svg +14 -0
  27. package/public/logo.svg +14 -0
  28. package/public/site.webmanifest +11 -0
  29. package/screenshots-review/01-main-menu.png +0 -0
  30. package/screenshots-review/02-list-instances.png +0 -0
  31. package/screenshots-review/07-mcp-details.png +0 -0
  32. package/screenshots-review/v2-01-main-menu.png +0 -0
  33. package/scripts/capture-screens.tsx +440 -0
  34. package/scripts/gen-lottie.cjs +160 -0
  35. package/scripts/shoot-changelog.mjs +18 -0
  36. package/skills-lock.json +71 -0
  37. package/ROADMAP.md +0 -104
  38. package/development.md +0 -602
package/CHANGELOG.md CHANGED
@@ -5,6 +5,98 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.5.1] - 2026-05-22
9
+
10
+ ### Changed
11
+ - **Interactive-first launch**: Running `claude-multi` with no arguments now opens the Ink TUI directly instead of printing help text
12
+ - CLI subcommands (`add`, `remove`, `list`, etc.) continue to work as before
13
+ - `--help` and `--version` flags are unaffected
14
+ - `CLAUDE_MULTI_INK=false` still falls back to the `prompts`-based interactive mode
15
+
16
+ ## [0.5.0] - 2026-05-14
17
+
18
+ ### Added
19
+ - **Ink-based Interactive UI**: Full terminal UI built with Ink + React
20
+ - Home screen with instance list, menu, and health warning banner
21
+ - Animated components: Header, StatusBar, StepIndicator, InstanceCard, IssueCard, WarningBanner
22
+ - Screens: AddInstance, RemoveInstance, ShowInstanceInfo, ToggleAutoSync, FixSymlinks, HealthScreen, ManagePlugins, ManageMcp, ListInstances
23
+ - Keyboard navigation: arrow keys, Enter, ESC, `!` for health, `q` to quit
24
+ - `useConfig`, `useNavigation`, `useHealthCheck`, `useAnimations` hooks
25
+ - **Per-Instance Plugin Management**: Granular plugin control per instance
26
+ - `PluginInfo` interface with id, name, category (internal/external), hasMcp, mcpServerNames, enabled, isSymlink
27
+ - `scanPluginsFromDir()` discovers plugins from both `plugins/` and `external_plugins/` subdirs
28
+ - `listDefaultPlugins()` / `listInstancePlugins()` for querying available and installed plugins
29
+ - `copySinglePlugin()` / `copySelectedPlugins()` for individual or batch install with rollback
30
+ - `removeSinglePlugin()` with rename-to-backup safety pattern
31
+ - `detectMcpCollisions()` to check MCP server name conflicts before install
32
+ - `validatePluginOperation()` pre-flight checks (configDir, symlink, plugin existence, collisions)
33
+ - Handles 12 internal LSP plugins without `plugin.json` (falls back to dir name)
34
+ - Supports both flat `{"serverName": config}` and nested `{"mcpServers": {"serverName": config}}` `.mcp.json` formats
35
+ - Coordinates with `installed_plugins.json` v2 format (scope, installPath, version, timestamps)
36
+ - Symlink detection: refuses per-plugin operations when auto-sync is active
37
+ - **Migration System** (`src/migration.ts`): Safe v1 → v2 config upgrade
38
+ - `runMigration()` with 4-step procedure: backup → validate → transform → save
39
+ - PID-based lock file prevents concurrent migrations
40
+ - Automatic backup of config.json + instance settings.json (keeps last 3)
41
+ - Failure flag: sets `migrationStatus: "failed"` with error details, prevents auto-retry
42
+ - `clearMigrationFailure()` for explicit retry
43
+ - `CLAUDE_MULTI_HOME` env override for testability
44
+ - **Health Check System** (`src/health.ts`): Detects and reports issues
45
+ - Checks: migration failure, missing configDir, missing binary, corrupted settings.json, broken symlinks
46
+ - Persistent health status at `~/.claude-multi/health-status.json`
47
+ - `dismissIssue()` / `dismissAllIssues()` for acknowledging warnings
48
+ - Warning banner on home screen with `!` key to review
49
+ - HealthScreen with list/detail views, retry, dismiss actions
50
+ - **ManagePlugins Screen**: Full plugin management UI
51
+ - Install plugins from default (MultiSelect with MCP badge, [ext] tag)
52
+ - Remove installed plugins
53
+ - Enable/disable plugins
54
+ - List installed plugins with status indicators
55
+ - Symlink detection with warning
56
+ - **ManageMcp Screen**: Enhanced MCP server management
57
+ - List MCP servers with source attribution ([pluginName] or [custom])
58
+ - Add custom MCP server (name + JSON config input)
59
+ - Remove custom MCP server (select from custom servers)
60
+ - Verify MCP configuration
61
+ - Copy between instances
62
+ - **CLI Plugin Commands**: 5 new `plugins` sub-commands
63
+ - `plugins install <instance> <ids...>` — install plugins with collision detection
64
+ - `plugins remove <instance> <ids...>` — remove plugins with symlink guard
65
+ - `plugins list-defaults` — list all 50 default plugins with category/MCP badges
66
+ - `plugins list-installed [instance]` — list installed plugins per instance
67
+ - `plugins check-collisions <instance> <ids...>` — detect MCP name conflicts
68
+ - **Provider Templates**: DeepSeek provider template added
69
+ - **Instance State**: `initializeInstanceState()` creates `.claude.json` with `hasCompletedOnboarding: true`
70
+ - **Provider Env**: `mergeProviderEnv()` integrates provider template env vars into instance settings
71
+ - **Screenshot Capture**: `scripts/capture-screens.tsx` for automated UI screenshots
72
+
73
+ ### Changed
74
+ - `copyAllFromDefault()` restored `autoSync` parameter for symlink-based plugin sync
75
+ - `syncPluginsAndSkills()` creates actual symlinks instead of copying files
76
+ - Broken symlink detection uses `lstatSync` (works when `existsSync` returns false)
77
+ - `~/.claude` is strictly read-only — never modified by any operation
78
+ - Atomic file writes for both config.json and settings.json (temp-file-rename pattern)
79
+ - Lazy path resolution in migration.ts and health.ts for testability
80
+
81
+ ### Fixed
82
+ - `syncPluginsAndSkills` was doing recursive copy instead of creating symlinks
83
+ - `copyAllFromDefault` `autoSync` parameter was removed, breaking symlink-based sync
84
+ - Broken symlinks not cleaned before creating new ones (used `lstatSync` instead of `existsSync`)
85
+ - `isClaudeCodeRunning()` blocked tests — skips in `NODE_ENV=test`
86
+ - `writeFileSync` not imported in config.ts
87
+ - `McpSourceDetails` prop name mismatch in ManageMcp
88
+ - `renameSync` dynamic import in `saveConfigAtomic` replaced with top-level import
89
+ - TypeScript: `updateInstanceAutoSync` object possibly undefined after bounds check
90
+
91
+ ### Tests
92
+ - **155 tests, 0 failures** across 16 test files
93
+ - `test/plugin-management.test.ts` (18 tests): scanning, copy, remove, MCP helpers, atomic writes
94
+ - `test/e2e/plugin-flow.test.ts` (6 tests): CLI plugin operations end-to-end
95
+ - `test/migration.test.ts` (15 tests): migration, backup, lock, failure recovery
96
+ - `test/health.test.ts` (15 tests): health checks, persistence, dismiss
97
+ - `test/ink/` (31 tests): component rendering, screen navigation, animation hooks
98
+ - `test/config.test.ts` (53 tests): sync/unsync, copyAllFromDefault, symlink cycles
99
+
8
100
  ## [0.4.3] - 2026-01-26
9
101
 
10
102
  ### Added
@@ -139,6 +231,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
139
231
  - Support for custom config and binary paths
140
232
  - Command-line interface built with Commander.js
141
233
 
234
+ [0.5.0]: https://github.com/hmziqrs/claude-multi/compare/v0.4.4...v0.5.0
235
+ [0.4.4]: https://github.com/hmziqrs/claude-multi/compare/v0.4.3...v0.4.4
142
236
  [0.3.0]: https://github.com/hmziqrs/claude-multi/compare/v0.2.0...v0.3.0
143
237
  [0.2.0]: https://github.com/hmziqrs/claude-multi/compare/v0.1.0...v0.2.0
144
238
  [0.1.0]: https://github.com/hmziqrs/claude-multi/releases/tag/v0.1.0
package/README.md CHANGED
@@ -1,231 +1,114 @@
1
- # claude-multi
1
+ <div align="center">
2
2
 
3
- > Manage multiple Claude Code instances with different aliases and configurations
3
+ <img src="public/favicon-animated.svg" width="256" height="256" alt="claude-multi logo">
4
4
 
5
- ## Why?
5
+ # claude-multi
6
6
 
7
- Claude Code supports multiple AI providers (Anthropic, GLM, Minimax), but switching between them requires manually editing config files. **claude-multi** solves this by creating isolated instances with different aliases and config paths.
7
+ </div>
8
8
 
9
- ## Features
9
+ Run multiple Claude Code instances side by side — each with its own provider, config, and `claude-<name>` command.
10
10
 
11
- - 🔄 **Multiple Instances**: Run different Claude Code configs simultaneously
12
- - 🎯 **Simple CLI**: Easy-to-use commands for managing instances
13
- - 🔒 **Isolated Configs**: Each instance has its own settings and history
14
- - 🎨 **Provider Templates**: Built-in templates for GLM, MiniMax, and more
15
- - ✅ **Legal**: Uses wrapper scripts, no code modification
16
- - 🚀 **Auto-sync**: Always uses the latest official Claude Code
11
+ Switching providers (Anthropic, GLM, MiniMax, DeepSeek) normally means editing `settings.json` by hand. This tool gives each one its own isolated install instead.
17
12
 
18
- ## Installation
13
+ ## Install
19
14
 
20
15
  ```bash
21
- npm install -g claude-multi
16
+ bun add -g claude-multi
22
17
  ```
23
18
 
24
- ## Quick Start
25
-
26
- Get started with a provider template in 30 seconds:
27
-
28
19
  ```bash
29
- # Create a GLM instance
30
- claude-multi add glm --provider glm --api-key "your-glm-api-key"
31
-
32
- # Use it!
33
- claude-glm --help
20
+ npm install -g claude-multi
34
21
  ```
35
22
 
36
- **Or use interactive mode:**
37
-
38
23
  ```bash
39
- claude-multi add myinstance
40
- # Choose "Yes" when asked about provider templates
41
- # Select GLM or MiniMax
42
- # Enter your API key
43
- # Done!
24
+ pnpm add -g claude-multi
44
25
  ```
45
26
 
46
- ### Windows Setup
47
-
48
- On Windows, ensure `%APPDATA%\npm` is in your PATH to use the wrapper commands:
49
-
50
- ```cmd
51
- # Check if npm directory is in PATH
52
- echo %PATH%
53
-
54
- # Add to PATH if needed (PowerShell as Administrator)
55
- [Environment]::SetEnvironmentVariable("Path", $env:Path + ";$env:APPDATA\npm", "User")
27
+ ```bash
28
+ deno install -g -A -n claude-multi npm:claude-multi
56
29
  ```
57
30
 
58
- After adding to PATH, restart your terminal for changes to take effect.
31
+ Requires Node 18+ (or Bun 1+) and `@anthropic-ai/claude-code` installed globally.
59
32
 
60
33
  ## Usage
61
34
 
62
- ### Create instances
35
+ Just run it — the interactive TUI opens by default:
63
36
 
64
37
  ```bash
65
- # Create instance (interactive - prompts for provider templates and copying settings)
66
- claude-multi add glm
67
-
68
- # Create instance with provider template (CLI mode)
69
- claude-multi add glm --provider glm --api-key "your-api-key-here"
70
- claude-multi add minimax --provider minimax --api-key "your-api-key-here"
71
-
72
- # Create instance with custom config path
73
- claude-multi add work --config ~/configs/claude-work
74
-
75
- # Create instance with custom binary path
76
- claude-multi add minimax --binary ~/.local/bin/claude-minimax
77
-
78
- # Non-interactive modes
79
- claude-multi add glm --copy-settings # Copy only settings.json
80
- claude-multi add glm --copy-all # Copy all files (settings, CLAUDE.md, plugins)
81
- claude-multi add glm --skip-prompts # Start fresh, no prompts
38
+ claude-multi
82
39
  ```
83
40
 
84
- **Provider Templates:**
85
- - **GLM (智谱AI)**: GLM-4.5-air and GLM-4.6 models via z.ai
86
- - **MiniMax**: MiniMax-M2 model via minimax.io
87
-
88
- **Interactive prompt options:**
89
- - **Provider templates**: Choose GLM, MiniMax, or None/Custom
90
- - **Nothing - start fresh**: Empty config directory
91
- - **Only settings.json**: Copy your settings (API keys, preferences)
92
- - **All files**: Copy settings, CLAUDE.md, plugins, etc. (excludes history, debug logs)
41
+ You get a full terminal UI to add instances, manage plugins, configure MCP servers, and more. No subcommand needed.
93
42
 
94
- When using a provider template, you'll be prompted to enter your API key securely.
95
-
96
- ### Use instances
97
-
98
- Each instance gets its own command:
43
+ **Adding an instance** — pick it from the menu, or run directly:
99
44
 
100
45
  ```bash
101
- claude-glm # Uses ~/.claude-glm config
102
- claude-work # Uses ~/configs/claude-work
103
- claude-minimax # Uses ~/.claude-minimax config
104
- claude # Original command, uses ~/.claude
46
+ claude-multi add glm
105
47
  ```
106
48
 
107
- ### Manage instances
49
+ No flags = the guided wizard walks you through provider, API key, and copy options. Then use your new instance:
108
50
 
109
51
  ```bash
110
- # List all instances
111
- claude-multi list
112
-
113
- # Show instance details
114
- claude-multi info glm
115
-
116
- # Remove instance
117
- claude-multi remove glm
118
-
119
- # Remove without confirmation
120
- claude-multi remove glm --force
52
+ claude-glm
121
53
  ```
122
54
 
123
- ### Version management
55
+ ## CLI (non-interactive)
56
+
57
+ For scripting and automation, all operations are available as flags:
124
58
 
125
59
  ```bash
126
- # Check for updates
60
+ # Instances
61
+ claude-multi add <name> --provider glm --api-key "sk-..."
62
+ claude-multi add <name> --config ~/path # custom config dir
63
+ claude-multi add <name> --copy-settings # seed from ~/.claude
64
+ claude-multi add <name> --copy-all # copy everything + auto-sync
65
+ claude-multi add <name> --skip-prompts # start fresh, no wizard
66
+ claude-multi add <name> --manual # copy files instead of symlinking
67
+ claude-multi list
68
+ claude-multi info <name>
69
+ claude-multi remove <name> [--force]
70
+
71
+ # Plugins & MCP
72
+ claude-multi plugins list
73
+ claude-multi plugins enable <name> <plugin-id>
74
+ claude-multi plugins disable <name> <plugin-id>
75
+ claude-multi plugins copy <name> # copy from default ~/.claude
76
+ claude-multi mcp list
77
+ claude-multi mcp copy <src> <dst>
78
+
79
+ # Sync
80
+ claude-multi auto-sync <name> on|off # symlink plugins/skills from ~/.claude
81
+ claude-multi fix-symlinks --all
82
+
83
+ # Claude Code itself
127
84
  claude-multi version
128
-
129
- # Update Claude Code to latest
130
85
  claude-multi update
131
86
  ```
132
87
 
133
- ## Use Cases
88
+ Set `CLAUDE_MULTI_INK=false` to force the simpler prompts-based UI instead of the Ink TUI.
134
89
 
135
- ### Personal + Work
136
- ```bash
137
- claude-multi add personal
138
- claude-multi add work
139
-
140
- claude-personal # Personal projects
141
- claude-work # Work projects
142
- ```
143
-
144
- ### Different AI Providers
145
- ```bash
146
- # Interactive mode with provider template
147
- claude-multi add anthropic # Use Anthropic (prompted for API key)
148
- claude-multi add glm # Use GLM template (prompted for API key)
149
- claude-multi add minimax # Use MiniMax template (prompted for API key)
150
-
151
- # CLI mode with provider template
152
- claude-multi add glm --provider glm --api-key "sk-..."
153
- claude-multi add minimax --provider minimax --api-key "sk-..."
154
-
155
- claude-anthropic # Uses Anthropic Claude
156
- claude-glm # Uses GLM-4.6
157
- claude-minimax # Uses MiniMax-M2
158
- ```
159
-
160
- ### Multiple Environments
161
- ```bash
162
- claude-multi add prod
163
- claude-multi add staging
164
- claude-multi add dev
165
-
166
- # Different configs for each
167
- ```
168
-
169
- ## Provider Templates
90
+ ## Providers
170
91
 
171
- Built-in templates for popular AI providers. Each template auto-configures the API endpoint, model mappings, and optimal settings.
92
+ | Provider | Endpoint |
93
+ |---|---|
94
+ | GLM (智谱AI) | `api.z.ai` |
95
+ | MiniMax | `api.minimax.io` |
96
+ | DeepSeek | `api.deepseek.com` |
172
97
 
173
- ### Available Providers
98
+ Templates write `ANTHROPIC_BASE_URL`, `ANTHROPIC_MODEL`, and related env vars to `~/.claude-<name>/settings.json`. Edit that file to customize.
174
99
 
175
- **GLM (智谱AI)**: GLM-4.5-air and GLM-4.6 models via `api.z.ai`
100
+ ## How it works
176
101
 
177
- **MiniMax**: MiniMax-M2 model via `api.minimax.io`
178
-
179
- ### Usage
180
-
181
- ```bash
182
- # CLI mode
183
- claude-multi add glm --provider glm --api-key "your-api-key"
102
+ Each instance gets a config dir at `~/.claude-<name>/` and a wrapper script at `~/.local/bin/claude-<name>`. The wrapper sets `CLAUDE_CONFIG_DIR` before launching the unmodified `claude` binary — no forking, no patching.
184
103
 
185
- # Interactive mode
186
- claude-multi add myinstance
187
- # Select provider when prompted and enter API key
104
+ ```js
105
+ #!/usr/bin/env bun
106
+ process.env.CLAUDE_CONFIG_DIR = "/Users/you/.claude-glm"
107
+ spawn("claude", process.argv.slice(2), { stdio: "inherit", env: process.env })
188
108
  ```
189
109
 
190
- Customize later by editing `~/.claude-{name}/settings.json`
191
-
192
- ## Requirements
193
-
194
- - Node.js >= 18
195
- - `@anthropic-ai/claude-code` installed globally
196
-
197
- ## Platform Support
198
-
199
- **claude-multi** supports all major operating systems:
200
-
201
- - ✅ **Linux**: Fully supported
202
- - ✅ **macOS**: Fully supported
203
- - ✅ **Windows**: Fully supported
204
-
205
- ### Platform-Specific Notes
206
-
207
- **Windows:**
208
- - Wrapper scripts are created as `.cmd` batch files
209
- - Binary path defaults to `%APPDATA%\npm`
210
- - Example: `claude-glm.cmd` instead of `claude-glm`
211
-
212
- **Unix/Linux/macOS:**
213
- - Wrapper scripts are Node.js scripts with shebangs
214
- - Binary path defaults to `~/.local/bin`
215
- - Scripts are automatically marked as executable
110
+ Instance metadata lives in `~/.claude-multi/config.json`. With auto-sync on, `plugins/` and `skills/` are symlinked from `~/.claude/`, so installing a plugin once makes it available everywhere.
216
111
 
217
112
  ## License
218
113
 
219
114
  MIT
220
-
221
- ## Credits
222
-
223
- Built with [Bun](https://bun.sh) and [Commander.js](https://github.com/tj/commander.js)
224
-
225
- Wrapper for [@anthropic-ai/claude-code](https://www.npmjs.com/package/@anthropic-ai/claude-code)
226
-
227
- ## Support
228
-
229
- For technical documentation, development setup, and contribution guidelines, see [development.md](development.md).
230
-
231
- For issues, questions, or feature requests, please visit the project's issue tracker.
@@ -0,0 +1,69 @@
1
+ import { defineConfig } from 'astro/config';
2
+ import starlight from '@astrojs/starlight';
3
+ import tailwindcss from '@tailwindcss/vite';
4
+
5
+ export default defineConfig({
6
+ site: 'https://claudemutli.hmziq.xyz',
7
+ srcDir: './src/web',
8
+ vite: {
9
+ plugins: [tailwindcss()],
10
+ build: {
11
+ rollupOptions: {
12
+ output: {
13
+ manualChunks(id) {
14
+ if (id.includes('node_modules/three')) return 'three';
15
+ },
16
+ },
17
+ },
18
+ },
19
+ },
20
+ integrations: [
21
+ starlight({
22
+ title: 'claude-multi',
23
+ description:
24
+ 'Manage multiple Claude Code instances with different AI providers and configurations',
25
+ social: [
26
+ {
27
+ icon: 'github',
28
+ label: 'GitHub',
29
+ href: 'https://github.com/hmziqrs/claude-multi',
30
+ },
31
+ ],
32
+ editLink: {
33
+ baseUrl: 'https://github.com/hmziqrs/claude-multi/edit/main/',
34
+ },
35
+ sidebar: [
36
+ {
37
+ label: 'Getting Started',
38
+ items: [{ slug: 'docs/getting-started' }],
39
+ },
40
+ {
41
+ label: 'Guides',
42
+ items: [
43
+ { slug: 'docs/usage' },
44
+ { slug: 'docs/providers' },
45
+ { slug: 'docs/how-it-works' },
46
+ { slug: 'docs/plugins-mcp' },
47
+ ],
48
+ },
49
+ {
50
+ label: 'Reference',
51
+ items: [
52
+ { slug: 'docs/configuration' },
53
+ { slug: 'docs/changelog' },
54
+ ],
55
+ },
56
+ {
57
+ label: 'Development',
58
+ collapsed: true,
59
+ items: [
60
+ { slug: 'docs/development/subagent-model-plan' },
61
+ ],
62
+ },
63
+ ],
64
+ customCss: ['/src/web/styles/starlight.css'],
65
+ lastUpdated: true,
66
+ favicon: '/favicon.svg',
67
+ }),
68
+ ],
69
+ });