claude-china 0.2.1__tar.gz
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.
- claude_china-0.2.1/PKG-INFO +256 -0
- claude_china-0.2.1/README.md +238 -0
- claude_china-0.2.1/pyproject.toml +36 -0
- claude_china-0.2.1/setup.cfg +4 -0
- claude_china-0.2.1/src/claude_china/__init__.py +1 -0
- claude_china-0.2.1/src/claude_china/buddy.py +465 -0
- claude_china-0.2.1/src/claude_china/cli.py +359 -0
- claude_china-0.2.1/src/claude_china/config.py +52 -0
- claude_china-0.2.1/src/claude_china/desktop/__init__.py +1 -0
- claude_china-0.2.1/src/claude_china/desktop/animation.py +87 -0
- claude_china-0.2.1/src/claude_china/desktop/app.py +70 -0
- claude_china-0.2.1/src/claude_china/desktop/apps.py +44 -0
- claude_china-0.2.1/src/claude_china/desktop/bridge.py +183 -0
- claude_china-0.2.1/src/claude_china/desktop/config.py +75 -0
- claude_china-0.2.1/src/claude_china/desktop/env.py +21 -0
- claude_china-0.2.1/src/claude_china/desktop/platforms/__init__.py +17 -0
- claude_china-0.2.1/src/claude_china/desktop/platforms/base.py +141 -0
- claude_china-0.2.1/src/claude_china/desktop/platforms/macos.py +154 -0
- claude_china-0.2.1/src/claude_china/desktop/platforms/windows.py +264 -0
- claude_china-0.2.1/src/claude_china/desktop/platforms/windows_shell.py +126 -0
- claude_china-0.2.1/src/claude_china/desktop/single_instance.py +165 -0
- claude_china-0.2.1/src/claude_china/desktop/tray.py +157 -0
- claude_china-0.2.1/src/claude_china/desktop/ui/app.js +394 -0
- claude_china-0.2.1/src/claude_china/desktop/ui/icon.icns +0 -0
- claude_china-0.2.1/src/claude_china/desktop/ui/icon.ico +0 -0
- claude_china-0.2.1/src/claude_china/desktop/ui/icon.png +0 -0
- claude_china-0.2.1/src/claude_china/desktop/ui/index.html +70 -0
- claude_china-0.2.1/src/claude_china/desktop/ui/style.css +523 -0
- claude_china-0.2.1/src/claude_china/grok.py +68 -0
- claude_china-0.2.1/src/claude_china/launcher.py +209 -0
- claude_china-0.2.1/src/claude_china/models.py +93 -0
- claude_china-0.2.1/src/claude_china/profiles.py +143 -0
- claude_china-0.2.1/src/claude_china.egg-info/PKG-INFO +256 -0
- claude_china-0.2.1/src/claude_china.egg-info/SOURCES.txt +58 -0
- claude_china-0.2.1/src/claude_china.egg-info/dependency_links.txt +1 -0
- claude_china-0.2.1/src/claude_china.egg-info/entry_points.txt +2 -0
- claude_china-0.2.1/src/claude_china.egg-info/requires.txt +8 -0
- claude_china-0.2.1/src/claude_china.egg-info/top_level.txt +1 -0
- claude_china-0.2.1/tests/test_cli_upgrade.py +184 -0
- claude_china-0.2.1/tests/test_desktop_animation.py +89 -0
- claude_china-0.2.1/tests/test_desktop_app_import.py +307 -0
- claude_china-0.2.1/tests/test_desktop_apps.py +25 -0
- claude_china-0.2.1/tests/test_desktop_backend.py +20 -0
- claude_china-0.2.1/tests/test_desktop_base.py +161 -0
- claude_china-0.2.1/tests/test_desktop_bridge.py +240 -0
- claude_china-0.2.1/tests/test_desktop_cli.py +150 -0
- claude_china-0.2.1/tests/test_desktop_config.py +77 -0
- claude_china-0.2.1/tests/test_desktop_env.py +25 -0
- claude_china-0.2.1/tests/test_desktop_icons.py +31 -0
- claude_china-0.2.1/tests/test_desktop_instance.py +335 -0
- claude_china-0.2.1/tests/test_desktop_macos.py +196 -0
- claude_china-0.2.1/tests/test_desktop_tray.py +345 -0
- claude_china-0.2.1/tests/test_desktop_windows.py +425 -0
- claude_china-0.2.1/tests/test_desktop_windows_shell.py +91 -0
- claude_china-0.2.1/tests/test_grok.py +86 -0
- claude_china-0.2.1/tests/test_grok_unix_execution.py +40 -0
- claude_china-0.2.1/tests/test_integration.py +387 -0
- claude_china-0.2.1/tests/test_launcher.py +370 -0
- claude_china-0.2.1/tests/test_models.py +179 -0
- claude_china-0.2.1/tests/test_project_identity.py +58 -0
|
@@ -0,0 +1,256 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: claude-china
|
|
3
|
+
Version: 0.2.1
|
|
4
|
+
Summary: Claude China: AI coding profiles and a desktop launcher
|
|
5
|
+
License: MIT
|
|
6
|
+
Project-URL: Homepage, https://github.com/invoker-bot/Claude-China
|
|
7
|
+
Project-URL: Repository, https://github.com/invoker-bot/Claude-China
|
|
8
|
+
Project-URL: Issues, https://github.com/invoker-bot/Claude-China/issues
|
|
9
|
+
Requires-Python: >=3.9
|
|
10
|
+
Description-Content-Type: text/markdown
|
|
11
|
+
Requires-Dist: pyyaml>=5.0
|
|
12
|
+
Requires-Dist: typer>=0.9.0
|
|
13
|
+
Provides-Extra: desktop
|
|
14
|
+
Requires-Dist: pywebview>=6; extra == "desktop"
|
|
15
|
+
Requires-Dist: psutil>=5.9; extra == "desktop"
|
|
16
|
+
Requires-Dist: pystray>=0.19.5; extra == "desktop"
|
|
17
|
+
Requires-Dist: Pillow>=9; extra == "desktop"
|
|
18
|
+
|
|
19
|
+
# Claude China
|
|
20
|
+
|
|
21
|
+
Switch between profiles for AI coding tools and launch the right CLI with the
|
|
22
|
+
right environment.
|
|
23
|
+
|
|
24
|
+
`claude-china` gives each profile its own provider, endpoint, credentials,
|
|
25
|
+
proxy, and default arguments. The `claudec` command then starts Claude Code,
|
|
26
|
+
OpenAI Codex, or Grok using that profile.
|
|
27
|
+
|
|
28
|
+
Repository: [invoker-bot/Claude-China](https://github.com/invoker-bot/Claude-China)
|
|
29
|
+
· PyPI: [claude-china](https://pypi.org/project/claude-china/)
|
|
30
|
+
· CLI: `claudec`
|
|
31
|
+
|
|
32
|
+
## Features
|
|
33
|
+
|
|
34
|
+
- Manage multiple profiles from one command-line interface
|
|
35
|
+
- Support API-key and isolated login/credential profiles
|
|
36
|
+
- Configure a custom endpoint and proxy for each profile
|
|
37
|
+
- Forward arguments to the underlying AI CLI
|
|
38
|
+
- Set per-profile default arguments such as `--model`
|
|
39
|
+
- Upgrade the supported AI CLIs through npm
|
|
40
|
+
- Optional Windows and macOS desktop launcher
|
|
41
|
+
|
|
42
|
+
## Installation
|
|
43
|
+
|
|
44
|
+
Install the CLI from PyPI:
|
|
45
|
+
|
|
46
|
+
```bash
|
|
47
|
+
python -m pip install claude-china
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
For local development, install the checkout in editable mode:
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
python -m pip install -e .
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The optional desktop launcher is installed with:
|
|
57
|
+
|
|
58
|
+
```bash
|
|
59
|
+
python -m pip install "claude-china[desktop]"
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
Requirements:
|
|
63
|
+
|
|
64
|
+
- Python 3.9 or later
|
|
65
|
+
- At least one supported AI CLI installed and available on `PATH`
|
|
66
|
+
- Node.js and npm for `claudec upgrade`
|
|
67
|
+
- Windows or macOS for the optional desktop launcher
|
|
68
|
+
|
|
69
|
+
### Upgrading from code-ai / AI Launcher
|
|
70
|
+
|
|
71
|
+
The 0.2 series renames the distribution from `ai-code-switcher` to `claude-china`,
|
|
72
|
+
the command from `code-ai` to `claudec`, and the desktop app to **Claude China**.
|
|
73
|
+
The Python module is now `claude_china` (`python -m claude_china.cli`).
|
|
74
|
+
|
|
75
|
+
Quit the old launcher from its tray menu, then run:
|
|
76
|
+
|
|
77
|
+
```bash
|
|
78
|
+
python -m pip install --upgrade "claude-china[desktop]"
|
|
79
|
+
claudec desktop install
|
|
80
|
+
claudec desktop run
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
For CLI-only use, install `claude-china` without the extra. Existing profiles,
|
|
84
|
+
login directories, desktop settings and the single-instance lock continue to
|
|
85
|
+
use `~/.code-ai/`; no credentials need to be copied. Installing the desktop
|
|
86
|
+
shortcut replaces the old **AI Launcher** shortcuts on Windows and macOS.
|
|
87
|
+
You can then remove the old distribution with `python -m pip uninstall ai-code-switcher`.
|
|
88
|
+
Old PyPI releases remain available for existing installations.
|
|
89
|
+
|
|
90
|
+
## Quick start
|
|
91
|
+
|
|
92
|
+
Create a profile interactively, then launch it:
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
claudec add
|
|
96
|
+
claudec list
|
|
97
|
+
claudec show my-claude
|
|
98
|
+
claudec run my-claude
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Arguments after the profile name are forwarded to the underlying CLI:
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
claudec run my-claude -p "Review this repository"
|
|
105
|
+
claudec run my-codex --model o3
|
|
106
|
+
claudec run my-grok --help
|
|
107
|
+
```
|
|
108
|
+
|
|
109
|
+
Useful commands:
|
|
110
|
+
|
|
111
|
+
```text
|
|
112
|
+
claudec list List configured profiles
|
|
113
|
+
claudec add Add a profile interactively
|
|
114
|
+
claudec show <profile> Show profile details
|
|
115
|
+
claudec remove <profile> Remove a profile
|
|
116
|
+
claudec upgrade Upgrade Claude, Codex, and Grok CLIs
|
|
117
|
+
claudec --version Show the installed version
|
|
118
|
+
claudec --help Show command help
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
The supported AI CLIs are:
|
|
122
|
+
|
|
123
|
+
- Claude Code: `@anthropic-ai/claude-code`
|
|
124
|
+
- OpenAI Codex: `@openai/codex`
|
|
125
|
+
- Grok: `@xai-official/grok`
|
|
126
|
+
|
|
127
|
+
`claudec upgrade` also refreshes the Grok binary in each login profile's
|
|
128
|
+
credentials directory. Grok stores a separate binary under `GROK_HOME/bin`, so
|
|
129
|
+
updating only the global npm package can leave a login profile running an old
|
|
130
|
+
version. The upgrade enables npm install scripts and verifies the actual binary
|
|
131
|
+
version in the default home and every login home; an unchanged or missing binary
|
|
132
|
+
causes the command to fail. Restart running Grok sessions after upgrading.
|
|
133
|
+
|
|
134
|
+
For Grok, `claudec run` prefers the official package in the active npm global
|
|
135
|
+
prefix, so an older native installation earlier on `PATH` cannot shadow the
|
|
136
|
+
package updated by `claudec upgrade`. Native installations remain supported
|
|
137
|
+
when the npm package is absent. Login credentials still use the profile's own
|
|
138
|
+
`GROK_HOME`.
|
|
139
|
+
|
|
140
|
+
## Profiles and configuration
|
|
141
|
+
|
|
142
|
+
Profiles are stored in `~/.code-ai/config.yaml`. Use API mode when the profile
|
|
143
|
+
should provide a token or API key. Use login mode when the CLI should use an
|
|
144
|
+
isolated credentials directory.
|
|
145
|
+
|
|
146
|
+
Example configuration:
|
|
147
|
+
|
|
148
|
+
```yaml
|
|
149
|
+
profiles:
|
|
150
|
+
claude-api:
|
|
151
|
+
name: claude-api
|
|
152
|
+
type: claude
|
|
153
|
+
mode: api
|
|
154
|
+
base_url: https://api.anthropic.com
|
|
155
|
+
token: sk-ant-...
|
|
156
|
+
default_args:
|
|
157
|
+
- --model
|
|
158
|
+
- claude-sonnet-4-5
|
|
159
|
+
|
|
160
|
+
codex-login:
|
|
161
|
+
name: codex-login
|
|
162
|
+
type: codex
|
|
163
|
+
mode: login
|
|
164
|
+
credentials_path: ~/.codex-profiles/work
|
|
165
|
+
proxy: http://127.0.0.1:7890
|
|
166
|
+
|
|
167
|
+
grok-api:
|
|
168
|
+
name: grok-api
|
|
169
|
+
type: grok
|
|
170
|
+
mode: api
|
|
171
|
+
base_url: https://api.x.ai
|
|
172
|
+
api_key: xai-...
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Login profiles isolate credentials through the provider-specific environment
|
|
176
|
+
variables used by the CLIs. API profiles set the corresponding endpoint and
|
|
177
|
+
authentication variables for the selected provider.
|
|
178
|
+
|
|
179
|
+
Keep tokens and personal configuration out of source control.
|
|
180
|
+
|
|
181
|
+
### Default launch arguments
|
|
182
|
+
|
|
183
|
+
`default_args` can be a YAML list or a single string:
|
|
184
|
+
|
|
185
|
+
```yaml
|
|
186
|
+
profiles:
|
|
187
|
+
claude-api:
|
|
188
|
+
name: claude-api
|
|
189
|
+
type: claude
|
|
190
|
+
default_args: "--model claude-sonnet-4-5"
|
|
191
|
+
```
|
|
192
|
+
|
|
193
|
+
Profile defaults are appended after command-line arguments. This lets a
|
|
194
|
+
profile pin a value such as `--model` when the CLI uses the last occurrence of
|
|
195
|
+
a flag. Skip profile defaults for one launch with:
|
|
196
|
+
|
|
197
|
+
```bash
|
|
198
|
+
claudec run --no-default-args claude-api --model claude-opus-4-5
|
|
199
|
+
```
|
|
200
|
+
|
|
201
|
+
## Claude Buddy
|
|
202
|
+
|
|
203
|
+
Claude profiles can have a deterministic companion card generated from the
|
|
204
|
+
profile name:
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
claudec roll-claude-buddy claude-api
|
|
208
|
+
claudec roll-claude-buddy claude-api --name capybara
|
|
209
|
+
claudec roll-claude-buddy claude-api --type legendary
|
|
210
|
+
```
|
|
211
|
+
|
|
212
|
+
## Desktop launcher
|
|
213
|
+
|
|
214
|
+
The optional desktop launcher provides a graphical interface for detected
|
|
215
|
+
Claude and Codex desktop apps. It is supported on Windows and macOS.
|
|
216
|
+
|
|
217
|
+
```bash
|
|
218
|
+
python -m pip install "claude-china[desktop]"
|
|
219
|
+
claudec desktop install # create or recreate the shortcut
|
|
220
|
+
claudec desktop run # open the launcher
|
|
221
|
+
claudec desktop uninstall # remove the shortcut
|
|
222
|
+
```
|
|
223
|
+
|
|
224
|
+
Only one launcher runs per user. Opening the shortcut or running
|
|
225
|
+
`claudec desktop run` again restores and brings the existing window forward.
|
|
226
|
+
Closing the window hides it in the system tray (the menu bar on macOS).
|
|
227
|
+
Click the tray icon or choose **打开 Claude China** to reopen the window;
|
|
228
|
+
choose **退出** from the tray menu to exit the launcher completely.
|
|
229
|
+
|
|
230
|
+
The launcher uses the terracotta **Claude China** mark for its window, shortcut,
|
|
231
|
+
tray and footer. The tray/menu-bar and footer marks briefly breathe and turn
|
|
232
|
+
when the launcher opens or an action runs, then return to rest. Shortcut and
|
|
233
|
+
window-title icons stay static. See the [icon preview](docs/branding/preview.html)
|
|
234
|
+
and [asset notes](docs/branding/README.md).
|
|
235
|
+
|
|
236
|
+
On Windows, the launcher and its shortcuts share a taskbar identity. Icon files
|
|
237
|
+
use a content-based filename so new artwork gets a fresh Shell cache entry.
|
|
238
|
+
After upgrading, run `claudec desktop install` and restart the launcher to
|
|
239
|
+
refresh existing shortcuts and the taskbar icon.
|
|
240
|
+
|
|
241
|
+
Desktop settings are stored separately in `~/.code-ai/desktop.yaml`. The
|
|
242
|
+
launcher can check the system proxy and apply common or per-application
|
|
243
|
+
environment variables; per-application values take precedence.
|
|
244
|
+
|
|
245
|
+
## Development
|
|
246
|
+
|
|
247
|
+
Run the test suite and build the distribution locally with:
|
|
248
|
+
|
|
249
|
+
```bash
|
|
250
|
+
python -m pytest tests/ -q
|
|
251
|
+
python -m build
|
|
252
|
+
```
|
|
253
|
+
|
|
254
|
+
## License
|
|
255
|
+
|
|
256
|
+
MIT
|
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
# Claude China
|
|
2
|
+
|
|
3
|
+
Switch between profiles for AI coding tools and launch the right CLI with the
|
|
4
|
+
right environment.
|
|
5
|
+
|
|
6
|
+
`claude-china` gives each profile its own provider, endpoint, credentials,
|
|
7
|
+
proxy, and default arguments. The `claudec` command then starts Claude Code,
|
|
8
|
+
OpenAI Codex, or Grok using that profile.
|
|
9
|
+
|
|
10
|
+
Repository: [invoker-bot/Claude-China](https://github.com/invoker-bot/Claude-China)
|
|
11
|
+
· PyPI: [claude-china](https://pypi.org/project/claude-china/)
|
|
12
|
+
· CLI: `claudec`
|
|
13
|
+
|
|
14
|
+
## Features
|
|
15
|
+
|
|
16
|
+
- Manage multiple profiles from one command-line interface
|
|
17
|
+
- Support API-key and isolated login/credential profiles
|
|
18
|
+
- Configure a custom endpoint and proxy for each profile
|
|
19
|
+
- Forward arguments to the underlying AI CLI
|
|
20
|
+
- Set per-profile default arguments such as `--model`
|
|
21
|
+
- Upgrade the supported AI CLIs through npm
|
|
22
|
+
- Optional Windows and macOS desktop launcher
|
|
23
|
+
|
|
24
|
+
## Installation
|
|
25
|
+
|
|
26
|
+
Install the CLI from PyPI:
|
|
27
|
+
|
|
28
|
+
```bash
|
|
29
|
+
python -m pip install claude-china
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
For local development, install the checkout in editable mode:
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
python -m pip install -e .
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
The optional desktop launcher is installed with:
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
python -m pip install "claude-china[desktop]"
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
Requirements:
|
|
45
|
+
|
|
46
|
+
- Python 3.9 or later
|
|
47
|
+
- At least one supported AI CLI installed and available on `PATH`
|
|
48
|
+
- Node.js and npm for `claudec upgrade`
|
|
49
|
+
- Windows or macOS for the optional desktop launcher
|
|
50
|
+
|
|
51
|
+
### Upgrading from code-ai / AI Launcher
|
|
52
|
+
|
|
53
|
+
The 0.2 series renames the distribution from `ai-code-switcher` to `claude-china`,
|
|
54
|
+
the command from `code-ai` to `claudec`, and the desktop app to **Claude China**.
|
|
55
|
+
The Python module is now `claude_china` (`python -m claude_china.cli`).
|
|
56
|
+
|
|
57
|
+
Quit the old launcher from its tray menu, then run:
|
|
58
|
+
|
|
59
|
+
```bash
|
|
60
|
+
python -m pip install --upgrade "claude-china[desktop]"
|
|
61
|
+
claudec desktop install
|
|
62
|
+
claudec desktop run
|
|
63
|
+
```
|
|
64
|
+
|
|
65
|
+
For CLI-only use, install `claude-china` without the extra. Existing profiles,
|
|
66
|
+
login directories, desktop settings and the single-instance lock continue to
|
|
67
|
+
use `~/.code-ai/`; no credentials need to be copied. Installing the desktop
|
|
68
|
+
shortcut replaces the old **AI Launcher** shortcuts on Windows and macOS.
|
|
69
|
+
You can then remove the old distribution with `python -m pip uninstall ai-code-switcher`.
|
|
70
|
+
Old PyPI releases remain available for existing installations.
|
|
71
|
+
|
|
72
|
+
## Quick start
|
|
73
|
+
|
|
74
|
+
Create a profile interactively, then launch it:
|
|
75
|
+
|
|
76
|
+
```bash
|
|
77
|
+
claudec add
|
|
78
|
+
claudec list
|
|
79
|
+
claudec show my-claude
|
|
80
|
+
claudec run my-claude
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Arguments after the profile name are forwarded to the underlying CLI:
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
claudec run my-claude -p "Review this repository"
|
|
87
|
+
claudec run my-codex --model o3
|
|
88
|
+
claudec run my-grok --help
|
|
89
|
+
```
|
|
90
|
+
|
|
91
|
+
Useful commands:
|
|
92
|
+
|
|
93
|
+
```text
|
|
94
|
+
claudec list List configured profiles
|
|
95
|
+
claudec add Add a profile interactively
|
|
96
|
+
claudec show <profile> Show profile details
|
|
97
|
+
claudec remove <profile> Remove a profile
|
|
98
|
+
claudec upgrade Upgrade Claude, Codex, and Grok CLIs
|
|
99
|
+
claudec --version Show the installed version
|
|
100
|
+
claudec --help Show command help
|
|
101
|
+
```
|
|
102
|
+
|
|
103
|
+
The supported AI CLIs are:
|
|
104
|
+
|
|
105
|
+
- Claude Code: `@anthropic-ai/claude-code`
|
|
106
|
+
- OpenAI Codex: `@openai/codex`
|
|
107
|
+
- Grok: `@xai-official/grok`
|
|
108
|
+
|
|
109
|
+
`claudec upgrade` also refreshes the Grok binary in each login profile's
|
|
110
|
+
credentials directory. Grok stores a separate binary under `GROK_HOME/bin`, so
|
|
111
|
+
updating only the global npm package can leave a login profile running an old
|
|
112
|
+
version. The upgrade enables npm install scripts and verifies the actual binary
|
|
113
|
+
version in the default home and every login home; an unchanged or missing binary
|
|
114
|
+
causes the command to fail. Restart running Grok sessions after upgrading.
|
|
115
|
+
|
|
116
|
+
For Grok, `claudec run` prefers the official package in the active npm global
|
|
117
|
+
prefix, so an older native installation earlier on `PATH` cannot shadow the
|
|
118
|
+
package updated by `claudec upgrade`. Native installations remain supported
|
|
119
|
+
when the npm package is absent. Login credentials still use the profile's own
|
|
120
|
+
`GROK_HOME`.
|
|
121
|
+
|
|
122
|
+
## Profiles and configuration
|
|
123
|
+
|
|
124
|
+
Profiles are stored in `~/.code-ai/config.yaml`. Use API mode when the profile
|
|
125
|
+
should provide a token or API key. Use login mode when the CLI should use an
|
|
126
|
+
isolated credentials directory.
|
|
127
|
+
|
|
128
|
+
Example configuration:
|
|
129
|
+
|
|
130
|
+
```yaml
|
|
131
|
+
profiles:
|
|
132
|
+
claude-api:
|
|
133
|
+
name: claude-api
|
|
134
|
+
type: claude
|
|
135
|
+
mode: api
|
|
136
|
+
base_url: https://api.anthropic.com
|
|
137
|
+
token: sk-ant-...
|
|
138
|
+
default_args:
|
|
139
|
+
- --model
|
|
140
|
+
- claude-sonnet-4-5
|
|
141
|
+
|
|
142
|
+
codex-login:
|
|
143
|
+
name: codex-login
|
|
144
|
+
type: codex
|
|
145
|
+
mode: login
|
|
146
|
+
credentials_path: ~/.codex-profiles/work
|
|
147
|
+
proxy: http://127.0.0.1:7890
|
|
148
|
+
|
|
149
|
+
grok-api:
|
|
150
|
+
name: grok-api
|
|
151
|
+
type: grok
|
|
152
|
+
mode: api
|
|
153
|
+
base_url: https://api.x.ai
|
|
154
|
+
api_key: xai-...
|
|
155
|
+
```
|
|
156
|
+
|
|
157
|
+
Login profiles isolate credentials through the provider-specific environment
|
|
158
|
+
variables used by the CLIs. API profiles set the corresponding endpoint and
|
|
159
|
+
authentication variables for the selected provider.
|
|
160
|
+
|
|
161
|
+
Keep tokens and personal configuration out of source control.
|
|
162
|
+
|
|
163
|
+
### Default launch arguments
|
|
164
|
+
|
|
165
|
+
`default_args` can be a YAML list or a single string:
|
|
166
|
+
|
|
167
|
+
```yaml
|
|
168
|
+
profiles:
|
|
169
|
+
claude-api:
|
|
170
|
+
name: claude-api
|
|
171
|
+
type: claude
|
|
172
|
+
default_args: "--model claude-sonnet-4-5"
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
Profile defaults are appended after command-line arguments. This lets a
|
|
176
|
+
profile pin a value such as `--model` when the CLI uses the last occurrence of
|
|
177
|
+
a flag. Skip profile defaults for one launch with:
|
|
178
|
+
|
|
179
|
+
```bash
|
|
180
|
+
claudec run --no-default-args claude-api --model claude-opus-4-5
|
|
181
|
+
```
|
|
182
|
+
|
|
183
|
+
## Claude Buddy
|
|
184
|
+
|
|
185
|
+
Claude profiles can have a deterministic companion card generated from the
|
|
186
|
+
profile name:
|
|
187
|
+
|
|
188
|
+
```bash
|
|
189
|
+
claudec roll-claude-buddy claude-api
|
|
190
|
+
claudec roll-claude-buddy claude-api --name capybara
|
|
191
|
+
claudec roll-claude-buddy claude-api --type legendary
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
## Desktop launcher
|
|
195
|
+
|
|
196
|
+
The optional desktop launcher provides a graphical interface for detected
|
|
197
|
+
Claude and Codex desktop apps. It is supported on Windows and macOS.
|
|
198
|
+
|
|
199
|
+
```bash
|
|
200
|
+
python -m pip install "claude-china[desktop]"
|
|
201
|
+
claudec desktop install # create or recreate the shortcut
|
|
202
|
+
claudec desktop run # open the launcher
|
|
203
|
+
claudec desktop uninstall # remove the shortcut
|
|
204
|
+
```
|
|
205
|
+
|
|
206
|
+
Only one launcher runs per user. Opening the shortcut or running
|
|
207
|
+
`claudec desktop run` again restores and brings the existing window forward.
|
|
208
|
+
Closing the window hides it in the system tray (the menu bar on macOS).
|
|
209
|
+
Click the tray icon or choose **打开 Claude China** to reopen the window;
|
|
210
|
+
choose **退出** from the tray menu to exit the launcher completely.
|
|
211
|
+
|
|
212
|
+
The launcher uses the terracotta **Claude China** mark for its window, shortcut,
|
|
213
|
+
tray and footer. The tray/menu-bar and footer marks briefly breathe and turn
|
|
214
|
+
when the launcher opens or an action runs, then return to rest. Shortcut and
|
|
215
|
+
window-title icons stay static. See the [icon preview](docs/branding/preview.html)
|
|
216
|
+
and [asset notes](docs/branding/README.md).
|
|
217
|
+
|
|
218
|
+
On Windows, the launcher and its shortcuts share a taskbar identity. Icon files
|
|
219
|
+
use a content-based filename so new artwork gets a fresh Shell cache entry.
|
|
220
|
+
After upgrading, run `claudec desktop install` and restart the launcher to
|
|
221
|
+
refresh existing shortcuts and the taskbar icon.
|
|
222
|
+
|
|
223
|
+
Desktop settings are stored separately in `~/.code-ai/desktop.yaml`. The
|
|
224
|
+
launcher can check the system proxy and apply common or per-application
|
|
225
|
+
environment variables; per-application values take precedence.
|
|
226
|
+
|
|
227
|
+
## Development
|
|
228
|
+
|
|
229
|
+
Run the test suite and build the distribution locally with:
|
|
230
|
+
|
|
231
|
+
```bash
|
|
232
|
+
python -m pytest tests/ -q
|
|
233
|
+
python -m build
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## License
|
|
237
|
+
|
|
238
|
+
MIT
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[build-system]
|
|
2
|
+
requires = ["setuptools>=64"]
|
|
3
|
+
build-backend = "setuptools.build_meta"
|
|
4
|
+
|
|
5
|
+
[project]
|
|
6
|
+
name = "claude-china"
|
|
7
|
+
version = "0.2.1"
|
|
8
|
+
description = "Claude China: AI coding profiles and a desktop launcher"
|
|
9
|
+
readme = {file = "README.md", content-type = "text/markdown"}
|
|
10
|
+
license = {text = "MIT"}
|
|
11
|
+
requires-python = ">=3.9"
|
|
12
|
+
dependencies = [
|
|
13
|
+
"pyyaml>=5.0",
|
|
14
|
+
"typer>=0.9.0",
|
|
15
|
+
]
|
|
16
|
+
|
|
17
|
+
[project.urls]
|
|
18
|
+
Homepage = "https://github.com/invoker-bot/Claude-China"
|
|
19
|
+
Repository = "https://github.com/invoker-bot/Claude-China"
|
|
20
|
+
Issues = "https://github.com/invoker-bot/Claude-China/issues"
|
|
21
|
+
|
|
22
|
+
[project.optional-dependencies]
|
|
23
|
+
desktop = ["pywebview>=6", "psutil>=5.9", "pystray>=0.19.5", "Pillow>=9"]
|
|
24
|
+
|
|
25
|
+
[project.scripts]
|
|
26
|
+
claudec = "claude_china.cli:app"
|
|
27
|
+
|
|
28
|
+
[tool.setuptools.packages.find]
|
|
29
|
+
where = ["src"]
|
|
30
|
+
include = ["claude_china*"]
|
|
31
|
+
|
|
32
|
+
[tool.setuptools.package-data]
|
|
33
|
+
claude_china = ["desktop/ui/*"]
|
|
34
|
+
|
|
35
|
+
[tool.pytest.ini_options]
|
|
36
|
+
testpaths = ["tests"]
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
__version__ = "0.2.1"
|