@comradery64/cc-mirror 2.3.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,309 @@
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
+ <h2 align="center">Provider-native coding variants</h2>
14
+
15
+ <p align="center">
16
+ Pre-configured coding variants with custom providers,<br>
17
+ prompt packs, and battle-tested enhancements.<br><br>
18
+ <strong>One command. Instant power-up.</strong>
19
+ </p>
20
+
21
+ ---
22
+
23
+ ## Contributions
24
+
25
+ cc-mirror is maintained as issues-first. Please open issues with provider docs, reproduction steps, and patch/design links; external pull requests are not accepted directly.
26
+
27
+ ---
28
+
29
+ ## Quick Start
30
+
31
+ ```bash
32
+ # Fastest path to a configured provider-native variant
33
+ npx cc-mirror quick --provider mirror --name mirror
34
+
35
+ # Run it
36
+ mirror
37
+ ```
38
+
39
+ That's it. You now have an isolated coding variant ready to run.
40
+
41
+ ### Runtime Version (Stable/Latest/Pin)
42
+
43
+ By default, CC-MIRROR installs the **latest** native runtime release. You can pin a channel or version:
44
+
45
+ ```bash
46
+ # Track upstream stable channel
47
+ npx cc-mirror quick --provider mirror --name mirror --claude-version stable
48
+
49
+ # Track upstream latest channel
50
+ npx cc-mirror update mirror --claude-version latest
51
+
52
+ # Pin a specific version
53
+ npx cc-mirror update mirror --claude-version 2.1.37
54
+ ```
55
+
56
+ Notes:
57
+
58
+ - `stable` and `latest` are upstream channels. `stable` may lag behind `latest` (that is normal).
59
+ - cc-mirror resolves the channel to a concrete version during install/update and stores it in `variant.json`.
60
+
61
+ ### Update Policy
62
+
63
+ `npx cc-mirror update [name]` refreshes the native runtime install and cc-mirror-managed defaults for that variant, including provider endpoints, model slots, update/install/privacy flags, provider-managed MCP servers, and managed tweakcc startup/banner settings. Credentials and custom env keys are preserved.
64
+
65
+ Managed variants default to cc-mirror-controlled updates, disabled upstream install checks, privacy-oriented hosted-provider traffic settings, and hidden upstream startup branding where tweakcc can control it.
66
+
67
+ <p align="center">
68
+ <img src="./assets/cc-mirror-home.png" alt="CC-MIRROR Home Screen" width="600">
69
+ </p>
70
+
71
+ ### Or use the interactive wizard
72
+
73
+ ```bash
74
+ npx cc-mirror
75
+ ```
76
+
77
+ ---
78
+
79
+ ## What is CC-MIRROR?
80
+
81
+ CC-MIRROR is an **opinionated provider-native coding distribution**. We did the wiring; you get the useful defaults.
82
+
83
+ At its core, CC-MIRROR:
84
+
85
+ 1. **Creates** isolated runtime instances
86
+ 2. **Configures** provider endpoints, model slots, and env defaults
87
+ 3. **Applies** prompt packs and tweakcc themes
88
+ 4. **Installs** optional skills (dev-browser, opt-in)
89
+ 5. **Packages** everything into a single command
90
+
91
+ Each variant is completely isolated — its own config, sessions, MCP servers, and credentials. Your main installation stays untouched.
92
+
93
+ ```
94
+ ┌─────────────────────────────────────────────────────────────────────────┐
95
+ │ ~/.cc-mirror/ │
96
+ │ │
97
+ │ ├── mirror/ ← Mirror variant │
98
+ │ │ ├── native/ Runtime installation │
99
+ │ │ ├── config/ API keys, sessions, MCP servers │
100
+ │ │ ├── tweakcc/ Theme customization │
101
+ │ │ └── variant.json Metadata │
102
+ │ │ │
103
+ │ ├── zai/ ← Z.ai variant (GLM models) │
104
+ │ ├── minimax/ ← MiniMax variant (M2.7) │
105
+ │ └── kimi/ ← Kimi Code variant │
106
+ │ │
107
+ │ Wrappers: <bin-dir>/mirror, <bin-dir>/zai, ... │
108
+ └─────────────────────────────────────────────────────────────────────────┘
109
+ ```
110
+
111
+ Default `<bin-dir>` is `~/.local/bin` on macOS/Linux and `~/.cc-mirror/bin` on Windows.
112
+
113
+ **Windows tip:** add `%USERPROFILE%\.cc-mirror\bin` to your `PATH`, or run the `<variant>.cmd` wrapper directly. Each wrapper has a sibling `<variant>.mjs` launcher.
114
+
115
+ ### MCP Servers
116
+
117
+ Each variant has its own Claude Code config directory. Add MCP servers to:
118
+
119
+ ```text
120
+ ~/.cc-mirror/<variant>/config/.claude.json
121
+ ```
122
+
123
+ cc-mirror keeps provider-managed MCP servers up to date during `npx cc-mirror update`, while preserving unrelated user-added MCP servers in the same file.
124
+
125
+ For a server that should load in every project for one variant, run the variant wrapper with user scope:
126
+
127
+ ```bash
128
+ openrouter mcp add-json airtable '{"command":"npx","args":["@rashidazarang/airtable-mcp"],"env":{"AIRTABLE_TOKEN":"","AIRTABLE_BASE_ID":""}}' --scope user
129
+ openrouter mcp list
130
+ ```
131
+
132
+ For a server that should live with the current project, use `--scope project`; Claude Code will write `.mcp.json` in that project. The default local scope is project-specific but private, so a server added from one working directory may not appear from another.
133
+
134
+ ---
135
+
136
+ ## Providers
137
+
138
+ ### Mirror
139
+
140
+ The clean default runtime path. No proxy, no model changes — just isolation and privacy defaults.
141
+
142
+ ```bash
143
+ npx cc-mirror quick --provider mirror --name mirror
144
+ ```
145
+
146
+ - **No proxy** — Authenticate normally inside the isolated config
147
+ - **Isolated config** — Experiment without affecting your main setup
148
+ - **Provider presets** — Clean defaults without hidden patches
149
+
150
+ ### Alternative Providers
151
+
152
+ Want to use different models? CC-MIRROR supports multiple providers:
153
+
154
+ | Provider | Models | Auth | Best For |
155
+ | -------------- | ------------------------- | ---------- | ------------------------------- |
156
+ | **Kimi** | kimi-for-coding | Auth Token | Long-context coding (Kimi Code) |
157
+ | **MiniMax** | MiniMax-M2.7 | Auth Token | Unified model experience |
158
+ | **Z.ai** | GLM-5.1, 5-Turbo, 4.5-Air | Auth Token | Heavy coding with GLM reasoning |
159
+ | **OpenRouter** | 100+ models | Auth Token | Model flexibility, pay-per-use |
160
+ | **Vercel** | Multi-provider gateway | Auth Token | Vercel AI Gateway |
161
+ | **Ollama** | Local + cloud models | Auth Token | Local-first + hybrid setups |
162
+ | **NanoGPT** | GPT-5.2 / Gemini 3 Flash | Auth Token | Pay-as-you-go model access |
163
+ | **CCRouter** | Ollama, DeepSeek, etc. | Optional | Local-first development |
164
+ | **GatewayZ** | Multi-provider gateway | Auth Token | Centralized routing |
165
+
166
+ ### Provider Setup Links
167
+
168
+ | Provider | Subscribe | Get Key/Token | Docs |
169
+ | -------------- | ------------------------------------------------------------- | ---------------------------------------------------------------- | ---------------------------------------------------------------- |
170
+ | **Kimi** | https://www.kimi.com/code | https://platform.kimi.ai/console/api-keys | https://platform.kimi.ai/docs/guide/agent-support |
171
+ | **MiniMax** | https://platform.minimax.io/subscribe/coding-plan | https://platform.minimax.io/user-center/payment/coding-plan | https://platform.minimax.io/docs |
172
+ | **Z.ai** | https://z.ai/subscribe | https://z.ai/manage-apikey/apikey-list | https://z.ai/docs |
173
+ | **OpenRouter** | https://openrouter.ai/account | https://openrouter.ai/keys | https://openrouter.ai/docs |
174
+ | **Vercel** | https://vercel.com/ai | https://vercel.com/account/tokens | https://vercel.com/docs/ai-gateway |
175
+ | **Ollama** | https://ollama.com | https://ollama.com | https://docs.ollama.com/api/anthropic-compatibility |
176
+ | **NanoGPT** | https://nano-gpt.com | https://nano-gpt.com | https://docs.nano-gpt.com/integrations |
177
+ | **CCRouter** | https://github.com/musistudio/claude-code-router#installation | https://github.com/musistudio/claude-code-router#2-configuration | https://github.com/musistudio/claude-code-router#2-configuration |
178
+ | **GatewayZ** | https://gatewayz.ai | https://gatewayz.ai | https://docs.gatewayz.ai/docs/anthropic-compatibility |
179
+
180
+ ```bash
181
+ # Kimi Code
182
+ npx cc-mirror quick --provider kimi --api-key "$KIMI_API_KEY"
183
+
184
+ # MiniMax (MiniMax-M2.7)
185
+ npx cc-mirror quick --provider minimax --api-key "$MINIMAX_API_KEY"
186
+
187
+ # Z.ai (GLM-5.1/5-Turbo/4.5-Air)
188
+ npx cc-mirror quick --provider zai --api-key "$Z_AI_API_KEY"
189
+
190
+ # OpenRouter (100+ models)
191
+ npx cc-mirror quick --provider openrouter --api-key "$OPENROUTER_API_KEY" \
192
+ --model-sonnet "provider/balanced-coding-model"
193
+
194
+ # Vercel AI Gateway
195
+ npx cc-mirror quick --provider vercel --api-key "$VERCEL_AI_GATEWAY_KEY" \
196
+ --model-sonnet "provider/balanced-coding-model"
197
+
198
+ # Ollama
199
+ npx cc-mirror quick --provider ollama --api-key "ollama" \
200
+ --model-sonnet "qwen3.5" --model-opus "qwen3.5" --model-haiku "qwen3.5"
201
+
202
+ # NanoGPT
203
+ npx cc-mirror quick --provider nanogpt --api-key "$NANOGPT_API_KEY"
204
+
205
+ # CC Router (local LLMs)
206
+ npx cc-mirror quick --provider ccrouter
207
+
208
+ # GatewayZ
209
+ npx cc-mirror quick --provider gatewayz --api-key "$GATEWAYZ_API_KEY" \
210
+ --model-sonnet "provider/balanced-coding-model"
211
+ ```
212
+
213
+ ---
214
+
215
+ ## All Commands
216
+
217
+ ```bash
218
+ # Create & manage variants
219
+ npx cc-mirror # Interactive TUI
220
+ npx cc-mirror quick [options] # Fast setup with defaults
221
+ npx cc-mirror create [options] # Full configuration wizard
222
+ npx cc-mirror list # List all variants
223
+ npx cc-mirror update [name] # Update one or all variants
224
+ npx cc-mirror apply <name> # Re-apply tweakcc patches (no reinstall)
225
+ npx cc-mirror remove <name> # Delete a variant
226
+ npx cc-mirror doctor # Health check all variants
227
+ npx cc-mirror tweak <name> # Launch tweakcc customization
228
+
229
+ # Launch your variant
230
+ mirror # Run Mirror
231
+ zai # Run Z.ai variant
232
+ minimax # Run MiniMax variant
233
+ kimi # Run Kimi Code variant
234
+ ```
235
+
236
+ ---
237
+
238
+ ## CLI Options
239
+
240
+ ```
241
+ --provider <name> kimi | minimax | zai | openrouter | vercel | ollama | nanogpt | ccrouter | mirror | gatewayz | custom
242
+ --name <name> Variant name (becomes the CLI command)
243
+ --api-key <key> Provider API key
244
+ --base-url <url> Custom API endpoint
245
+ --model-sonnet <name> Map Balanced model slot
246
+ --model-opus <name> Map Primary model slot
247
+ --model-haiku <name> Map Fast model slot
248
+ --brand <preset> Theme: auto | kimi | minimax | zai | openrouter | vercel | ollama | nanogpt | ccrouter | mirror | gatewayz
249
+ --no-tweak Skip tweakcc theme
250
+ --no-prompt-pack Skip provider prompt pack
251
+ --verbose Show full tweakcc output during update
252
+ ```
253
+
254
+ ---
255
+
256
+ ## Brand Themes
257
+
258
+ Each provider includes a custom color theme via [tweakcc](https://github.com/Piebald-AI/tweakcc):
259
+
260
+ | Brand | Style |
261
+ | -------------- | -------------------------------- |
262
+ | **kimi** | Teal/cyan gradient |
263
+ | **minimax** | Coral/red/orange spectrum |
264
+ | **zai** | Dark carbon with gold accents |
265
+ | **openrouter** | Silver/chrome with electric blue |
266
+ | **vercel** | Monochrome with green accents |
267
+ | **ollama** | Warm sandstone with earthy tones |
268
+ | **nanogpt** | Aurora green + cyan accents |
269
+ | **ccrouter** | Sky blue accents |
270
+ | **gatewayz** | Violet gradients |
271
+
272
+ ---
273
+
274
+ ## Documentation
275
+
276
+ | Document | Description |
277
+ | --------------------------------------------- | ------------------------------------ |
278
+ | [Mirror](docs/features/mirror-claude.md) | Isolated runtime with clean defaults |
279
+ | [Architecture](docs/architecture/overview.md) | How CC-MIRROR works under the hood |
280
+ | [Full Documentation](docs/README.md) | Complete documentation index |
281
+
282
+ ---
283
+
284
+ ## Related Projects
285
+
286
+ - [tweakcc](https://github.com/Piebald-AI/tweakcc) — Theme and customize the runtime
287
+ - [Claude Code Router](https://github.com/musistudio/claude-code-router) — Local and gateway routing for coding agents
288
+ - [n-skills](https://github.com/numman-ali/n-skills) — Universal skills for AI agents
289
+
290
+ ---
291
+
292
+ ## Contributing
293
+
294
+ Contributions welcome! See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup.
295
+
296
+ **Want to add a provider?** Check the [Provider Guide](docs/TWEAKCC-GUIDE.md).
297
+
298
+ ---
299
+
300
+ ## License
301
+
302
+ MIT — see [LICENSE](LICENSE)
303
+
304
+ ---
305
+
306
+ <p align="center">
307
+ <strong>Created by <a href="https://github.com/numman-ali">Numman Ali</a></strong><br>
308
+ <a href="https://twitter.com/nummanali">@nummanali</a>
309
+ </p>