cc-mirror 1.0.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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Numman Ali
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,192 @@
1
+ # CC-MIRROR
2
+
3
+ <p align="center">
4
+ <img src="./assets/cc-mirror-providers.png" alt="CC-MIRROR Provider Themes" width="800">
5
+ </p>
6
+
7
+ <p align="center">
8
+ <a href="https://www.npmjs.com/package/cc-mirror"><img src="https://img.shields.io/npm/v/cc-mirror.svg" alt="npm version"></a>
9
+ <a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/License-MIT-yellow.svg" alt="License: MIT"></a>
10
+ <a href="https://twitter.com/nummanali"><img src="https://img.shields.io/twitter/follow/nummanali?style=social" alt="Twitter Follow"></a>
11
+ </p>
12
+
13
+ <p align="center">
14
+ <strong>Create multiple isolated Claude Code variants with custom providers.</strong>
15
+ </p>
16
+
17
+ <p align="center">
18
+ Run Claude Code with Z.ai, MiniMax, OpenRouter, Claude Code Router, or any Anthropic-compatible API —<br>
19
+ each with its own config, themes, and session storage.
20
+ </p>
21
+
22
+ ---
23
+
24
+ <p align="center">
25
+ <img src="./assets/cc-mirror-home.png" alt="CC-MIRROR Home Screen" width="600">
26
+ </p>
27
+
28
+ ## Why CC-MIRROR?
29
+
30
+ Claude Code is powerful, but locked to Anthropic's API. **CC-MIRROR** lets you:
31
+
32
+ - **Use any provider** — Z.ai's GLM models, MiniMax-M2.1, OpenRouter's 100+ models, or route to local LLMs via Claude Code Router
33
+ - **Keep variants isolated** — Each variant has its own config, sessions, and themes
34
+ - **Switch instantly** — Run `zai` for Z.ai, `minimax` for MiniMax, `openrouter` for OpenRouter
35
+
36
+ ## Features
37
+
38
+ - **Multiple Providers** — Z.ai, MiniMax, OpenRouter, Claude Code Router, or custom endpoints
39
+ - **Complete Isolation** — Each variant has its own config, sessions, and themes
40
+ - **Brand Themes** — Custom color schemes per provider via [tweakcc](https://github.com/Piebald-AI/tweakcc)
41
+ - **Prompt Packs** — Enhanced system prompts for Z.ai and MiniMax
42
+ - **One-Command Updates** — Update all variants when Claude Code releases
43
+ - **Interactive TUI** — Full-screen setup wizard or CLI for automation
44
+
45
+ ## Quick Start
46
+
47
+ ### Installation
48
+
49
+ ```bash
50
+ # Run directly with npx (opens TUI by default)
51
+ npx cc-mirror
52
+
53
+ # Or install globally
54
+ npm install -g cc-mirror
55
+ cc-mirror
56
+ ```
57
+
58
+ ### Interactive TUI
59
+
60
+ Running `cc-mirror` with no arguments opens the interactive TUI:
61
+
62
+ ```bash
63
+ cc-mirror
64
+ ```
65
+
66
+ <p align="center">
67
+ <img src="./assets/cc-mirror-select.png" alt="Provider Selection" width="600">
68
+ </p>
69
+
70
+ ### CLI Quick Setup
71
+
72
+ ```bash
73
+ # Z.ai (GLM Coding Plan)
74
+ npx cc-mirror quick --provider zai --api-key "$Z_AI_API_KEY"
75
+
76
+ # MiniMax (MiniMax-M2.1)
77
+ npx cc-mirror quick --provider minimax --api-key "$MINIMAX_API_KEY"
78
+
79
+ # OpenRouter (100+ models)
80
+ npx cc-mirror quick --provider openrouter --api-key "$OPENROUTER_API_KEY" \
81
+ --model-sonnet "anthropic/claude-3.5-sonnet" \
82
+ --model-opus "anthropic/claude-3-opus" \
83
+ --model-haiku "anthropic/claude-3-haiku"
84
+
85
+ # Claude Code Router (local LLMs)
86
+ npx cc-mirror quick --provider ccrouter
87
+ ```
88
+
89
+ ## Supported Providers
90
+
91
+ | Provider | Description | Auth | Model Mapping |
92
+ | -------------- | -------------------------------------------- | ---------- | ----------------------------------------------------- |
93
+ | **Z.ai** | GLM-4.7 via GLM Coding Plan | API Key | Auto (GLM-4.7 for Sonnet/Opus, GLM-4.5-Air for Haiku) |
94
+ | **MiniMax** | MiniMax-M2.1 via MiniMax Coding Plan | API Key | Auto (single model for all tiers) |
95
+ | **OpenRouter** | Access 100+ models through one API | Auth Token | Required (you choose the models) |
96
+ | **CCRouter** | Route to local LLMs (Ollama, DeepSeek, etc.) | Optional | Handled by CCRouter config |
97
+
98
+ ## Variant Structure
99
+
100
+ Each variant is fully isolated in `~/.cc-mirror/<name>/`:
101
+
102
+ ```
103
+ ~/.cc-mirror/<variant>/
104
+ ├── npm/ # Claude Code installation
105
+ ├── config/ # CLAUDE_CONFIG_DIR
106
+ │ ├── settings.json # API keys, env overrides
107
+ │ └── .claude.json # MCP servers, approvals
108
+ ├── tweakcc/ # Theme & prompt configs
109
+ │ ├── config.json # Brand preset
110
+ │ └── system-prompts/
111
+ └── variant.json # Metadata
112
+
113
+ Wrapper: ~/.local/bin/<variant>
114
+ ```
115
+
116
+ ## Commands
117
+
118
+ ```bash
119
+ # Create/manage variants
120
+ cc-mirror create [options] # Full configuration wizard
121
+ cc-mirror quick [options] # Fast setup with defaults
122
+ cc-mirror list # List all variants
123
+ cc-mirror update [name] # Update one or all variants
124
+ cc-mirror remove <name> # Delete a variant
125
+ cc-mirror doctor # Health check all variants
126
+ cc-mirror tweak <name> # Launch tweakcc UI
127
+
128
+ # Run your variant
129
+ zai # If you named it 'zai'
130
+ minimax # If you named it 'minimax'
131
+ ```
132
+
133
+ ## CLI Options
134
+
135
+ ```
136
+ --provider <name> zai | minimax | openrouter | ccrouter | custom
137
+ --api-key <key> Provider API key
138
+ --base-url <url> Custom API endpoint
139
+ --model-sonnet <name> Map to sonnet model (for OpenRouter)
140
+ --model-opus <name> Map to opus model (for OpenRouter)
141
+ --model-haiku <name> Map to haiku model (for OpenRouter)
142
+ --brand <preset> Theme: auto | none | zai | minimax | openrouter | ccrouter
143
+ --root <path> Variants root (default: ~/.cc-mirror)
144
+ --bin-dir <path> Wrapper dir (default: ~/.local/bin)
145
+ --no-tweak Skip tweakcc theme application
146
+ --no-prompt-pack Skip prompt pack enhancements
147
+ --no-skill-install Skip dev-browser skill installation
148
+ ```
149
+
150
+ ## Brand Themes
151
+
152
+ Each provider has an optional color theme applied via [tweakcc](https://github.com/Piebald-AI/tweakcc):
153
+
154
+ - **zai** — Dark carbon with gold accents
155
+ - **minimax** — Coral/red/orange spectrum
156
+ - **openrouter** — Teal/cyan gradient
157
+ - **ccrouter** — Sky blue accents
158
+
159
+ ## Updating Variants
160
+
161
+ When Claude Code releases a new version:
162
+
163
+ ```bash
164
+ # Update all variants
165
+ cc-mirror update
166
+
167
+ # Update specific variant
168
+ cc-mirror update zai
169
+ ```
170
+
171
+ ## Contributing
172
+
173
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
174
+
175
+ **Want to add a provider?** Check the [Provider Guide](docs/TWEAKCC-GUIDE.md) for details.
176
+
177
+ ## Related Projects
178
+
179
+ - [tweakcc](https://github.com/Piebald-AI/tweakcc) — Theme and customize Claude Code
180
+ - [Claude Code Router](https://github.com/musistudio/claude-code-router) — Route Claude Code to any LLM
181
+ - [n-skills](https://github.com/numman-ali/n-skills) — Universal skills for AI agents
182
+
183
+ ## License
184
+
185
+ MIT — see [LICENSE](LICENSE)
186
+
187
+ ---
188
+
189
+ <p align="center">
190
+ <strong>Created by <a href="https://github.com/numman-ali">Numman Ali</a></strong><br>
191
+ <a href="https://twitter.com/nummanali">@nummanali</a>
192
+ </p>