swixter 0.1.0 → 0.1.2

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 (3) hide show
  1. package/README.md +247 -351
  2. package/dist/cli/index.js +1389 -248
  3. package/package.json +5 -6
package/README.md CHANGED
@@ -2,9 +2,8 @@
2
2
 
3
3
  [![npm version](https://badge.fury.io/js/swixter.svg)](https://www.npmjs.com/package/swixter)
4
4
  [![Test Status](https://github.com/dawnswwwww/swixter/actions/workflows/test.yml/badge.svg)](https://github.com/dawnswwwww/swixter/actions/workflows/test.yml)
5
- [![Release Status](https://github.com/dawnswwwww/swixter/actions/workflows/release.yml/badge.svg)](https://github.com/dawnswwwww/swixter/actions/workflows/test.yml)
5
+ [![Release Status](https://github.com/dawnswwwww/swixter/actions/workflows/release.yml/badge.svg)](https://github.com/dawnswwwww/swixter/actions/workflows/release.yml)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
- [![Node.js Version](https://img.shields.io/node/v/swixter.svg)](https://nodejs.org)
8
7
 
9
8
  > Make AI coding tools effortlessly switchable
10
9
 
@@ -12,58 +11,43 @@ A lightweight CLI tool that makes it easy to switch between AI providers for Cla
12
11
 
13
12
  ## Why Swixter?
14
13
 
15
- Working with AI coding tools shouldn't be complicated. Swixter lets you:
16
-
17
14
  - **Switch providers instantly** - Change between Anthropic, Ollama, or custom APIs with one command
18
- - **Manage multiple configs** - Keep separate profiles for work, personal, or experimental setups
19
- - **Support multiple coders** - Works with Claude Code, Codex, Continue, and more
20
- - **Use command aliases** - Ultra-short commands (`r`, `ls`, `sw`) for maximum productivity
21
- - **Add custom providers** - Easily integrate any OpenAI-compatible AI service
22
- - **Stay in control** - All configs stored locally, no cloud dependencies
23
- - **Web UI** - Browser-based interface for visual configuration management
15
+ - **Automatic failover** - Group profiles by priority, auto-retry on provider failure
16
+ - **Local proxy** - Transparent proxy with circuit breaker, your tools won't even notice a provider goes down
17
+ - **Cloud sync** - Encrypt and sync your profiles across devices with end-to-end encryption
18
+ - **Multiple coders** - Works with Claude Code, Codex, Continue
19
+ - **Web UI** - Browser-based interface for visual management
20
+ - **All local** - Your keys stay on your machine; cloud sync uses client-side encryption
24
21
 
25
22
  ## Installation
26
23
 
27
- ### npm (Recommended)
28
-
29
24
  ```bash
25
+ # npm (Recommended)
30
26
  npm install -g swixter
31
- ```
32
-
33
- ### npx (No Install Needed)
34
27
 
35
- ```bash
28
+ # npx (No Install Needed)
36
29
  npx swixter --help
37
30
  ```
38
31
 
39
- ### Platform Support
40
-
41
32
  | Platform | Status | Notes |
42
33
  |----------|--------|-------|
43
- | **Linux** | Full | Full support |
44
- | **macOS** | Full | Full support |
45
- | **Windows 10/11** | Full | Requires Node.js 18+; Docker Desktop + WSL2 for E2E tests |
34
+ | **Linux** | Full | |
35
+ | **macOS** | Full | |
36
+ | **Windows 10/11** | Full | Requires Node.js 18+ |
46
37
 
47
38
  Config stored at:
48
39
  - **Linux/macOS**: `~/.config/swixter/`
49
- - **Windows**: `~/swixter/` (e.g., `C:\Users\YourName\swixter\`)
50
-
51
- See [docs/WINDOWS.md](docs/WINDOWS.md) for detailed Windows guide.
40
+ - **Windows**: `~/swixter/`
52
41
 
53
42
  ## Quick Start
54
43
 
55
44
  ```bash
56
- # Interactive mode - guided setup
57
- swixter
58
-
59
- # Or use commands directly
60
- swixter claude create # Create profile
61
- swixter claude list # List profiles
62
- swixter claude switch my-profile # Switch profile
63
- swixter claude apply # Apply to Claude Code
64
-
65
- # Launch Web UI (browser-based management)
66
- swixter ui
45
+ swixter # Interactive mode
46
+ swixter claude create # Create profile
47
+ swixter claude list # List profiles
48
+ swixter claude switch my-profile # Switch profile
49
+ swixter claude apply # Apply to Claude Code
50
+ swixter ui # Launch Web UI
67
51
  ```
68
52
 
69
53
  ## Built-in Providers
@@ -71,338 +55,307 @@ swixter ui
71
55
  | Provider | API Type | Description |
72
56
  |----------|----------|-------------|
73
57
  | **Anthropic** | responses | Official Claude API |
74
- | **Ollama** | chat | Run Qwen, Llama, and other models locally |
58
+ | **Ollama** | chat | Run models locally |
75
59
  | **OpenAI** | chat | OpenAI API |
76
60
  | **OpenRouter** | chat | Unified access to 100+ models |
77
- | **Custom** | chat | Add any OpenAI-compatible API |
78
-
79
- ## Web UI
61
+ | **Custom** | chat | Any OpenAI-compatible API |
80
62
 
81
- Launch `swixter ui` to open a browser-based interface for managing profiles.
63
+ ## Profile Management
82
64
 
83
- ### Features
65
+ Profiles are configuration templates containing provider, API key, base URL, and model settings. Each coder maintains its own active profile.
84
66
 
85
- - **Dashboard** - View all coders, switch active profiles, apply configurations
86
- - **Profiles** - Create, edit, delete configuration profiles
87
- - **Providers** - Manage custom API providers
88
- - **Settings** - Import/export configurations
89
-
90
- ### Running the Web UI
67
+ ### Commands (take Claude Code as example)
91
68
 
92
69
  ```bash
93
- # Default port (3141)
94
- swixter ui
95
-
96
- # Custom port
97
- swixter ui --port 8080
70
+ swixter claude create # Interactive creation (alias: new)
71
+ swixter claude create --quiet --name my --provider anthropic --api-key sk-ant-xxx # Non-interactive
72
+ swixter claude list # List profiles (alias: ls)
73
+ swixter claude switch <name> # Switch active profile (alias: sw)
74
+ swixter claude apply # Write config to ~/.claude/settings.json
75
+ swixter claude run # Run Claude Code with current profile (alias: r)
76
+ swixter claude edit <name> # Edit profile (alias: update)
77
+ swixter claude current # Show active profile
78
+ swixter claude delete <name> # Delete profile (alias: rm)
79
+ swixter claude install # Install Claude Code CLI
80
+ swixter claude update-cli # Update CLI (alias: upgrade)
98
81
  ```
99
82
 
100
- The UI auto-opens in your browser at `http://localhost:3141`.
83
+ Codex and Qwen/Continue have the same command structure: `swixter codex <command>` / `swixter qwen <command>`.
84
+
85
+ ### Model Configuration
101
86
 
102
- ### Web UI Dashboard
87
+ **Claude Code** - set per-profile models:
103
88
 
104
- The Dashboard shows:
105
- - All installed coders (Claude Code, Codex, Continue)
106
- - Current active profile per coder
107
- - Quick profile switching via dropdown
108
- - One-click Apply to write config to coder's settings file
89
+ ```bash
90
+ swixter claude create \
91
+ --name production \
92
+ --provider anthropic \
93
+ --api-key sk-ant-xxx \
94
+ --anthropic-model claude-sonnet-4-20250514 \
95
+ --default-haiku-model claude-haiku-4-20250506 \
96
+ --default-opus-model claude-opus-4-20250514
97
+ ```
109
98
 
110
- ## Commands
99
+ | Flag | Env Variable | Description |
100
+ |------|-------------|-------------|
101
+ | `--anthropic-model` | `ANTHROPIC_MODEL` | Default model |
102
+ | `--default-haiku-model` | `ANTHROPIC_DEFAULT_HAIKU_MODEL` | Haiku model |
103
+ | `--default-opus-model` | `ANTHROPIC_DEFAULT_OPUS_MODEL` | Opus model |
104
+ | `--default-sonnet-model` | `ANTHROPIC_DEFAULT_SONNET_MODEL` | Sonnet model |
111
105
 
112
- ### For Claude Code
106
+ **Codex/Qwen** - single model field:
113
107
 
114
108
  ```bash
115
- swixter claude create # Create new profile (alias: new)
116
- swixter claude list # List all profiles (alias: ls)
117
- swixter claude switch <name> # Switch active profile (alias: sw)
118
- swixter claude apply # Apply to Claude Code
119
- swixter claude run # Run Claude Code with current profile (alias: r)
120
- swixter claude edit <name> # Edit existing profile (alias: update)
121
- swixter claude current # Show current active profile
122
- swixter claude delete <name> # Delete profile (alias: rm)
123
- swixter claude install # Install Claude Code CLI
124
- swixter claude update-cli # Update Claude Code CLI (alias: upgrade)
109
+ swixter codex create --name local --provider ollama --model qwen3:32b
125
110
  ```
126
111
 
127
- ### For Codex
112
+ ### Custom Providers
128
113
 
129
114
  ```bash
130
- swixter codex create # Create new profile
131
- swixter codex list # List all profiles (alias: ls)
132
- swixter codex switch <name> # Switch active profile (alias: sw)
133
- swixter codex apply # Apply to Codex (writes ~/.codex/config.toml)
134
- swixter codex run # Apply + set env + run codex (alias: r)
135
- swixter codex edit <name> # Edit existing profile (alias: update)
136
- swixter codex current # Show current active profile
137
- swixter codex delete <name> # Delete profile (alias: rm)
138
- swixter codex install # Install Codex CLI
139
- swixter codex update-cli # Update Codex CLI (alias: upgrade)
115
+ swixter providers add
116
+ swixter providers list
117
+ swixter providers remove <id>
118
+ swixter providers show <id>
140
119
  ```
141
120
 
142
- **Two ways to use Codex profiles**:
143
-
144
- 1. **Quick way** (recommended): `swixter codex r`
145
- - Automatically applies profile to config.toml
146
- - Sets environment variables
147
- - Runs codex in one command
121
+ ## Groups (Failover)
148
122
 
149
- 2. **Manual way**: `swixter codex apply` set env vars `codex`
150
- - Good for debugging or custom setups
123
+ Groups are ordered lists of profiles used for **automatic failover**. When one provider fails, the next profile in the group is tried automatically.
151
124
 
152
- ### For Qwen/Continue
125
+ ### How It Works
153
126
 
154
- ```bash
155
- swixter qwen create # Create new profile
156
- swixter qwen list # List all profiles (alias: ls)
157
- swixter qwen switch <name> # Switch active profile (alias: sw)
158
- swixter qwen apply # Apply to Continue
159
- swixter qwen run # Run Qwen Code with current profile (alias: r)
160
- swixter qwen edit <name> # Edit existing profile (alias: update)
161
- swixter qwen current # Show current active profile
162
- swixter qwen delete <name> # Delete profile (alias: rm)
163
- swixter qwen install # Install Qwen Code CLI
164
- swixter qwen update-cli # Update Qwen Code CLI (alias: upgrade)
165
127
  ```
128
+ Request → Proxy → Profile 1 (Anthropic) → Fail! → Profile 2 (OpenRouter) → Success → Response
129
+ ```
130
+
131
+ Each group defines a priority order. The proxy tries profiles from highest to lowest priority until one succeeds.
166
132
 
167
- ### Provider Management
133
+ ### Commands
168
134
 
169
135
  ```bash
170
- swixter providers list # List available providers
171
- swixter providers add # Add custom provider
172
- swixter providers remove <id> # Remove provider
173
- swixter providers show <id> # Show provider details
136
+ swixter group create # Interactive creation (alias: new)
137
+ swixter group list # List groups (alias: ls)
138
+ swixter group show <name> # Show group details with profile order (alias: info)
139
+ swixter group edit <name> # Edit group name and profiles (alias: update)
140
+ swixter group set-default <name> # Set as default group
141
+ swixter group delete <name> # Delete group (alias: rm)
174
142
  ```
175
143
 
176
- ### Configuration
144
+ ### Example
177
145
 
178
146
  ```bash
179
- swixter ui # Launch Web UI
180
- swixter ui --port <port> # Launch Web UI on custom port
181
- swixter export <file> # Export configs
182
- swixter export <file> --sanitize # Export without API keys
183
- swixter import <file> # Import configs
184
- swixter import <file> --overwrite # Overwrite existing profiles
185
- swixter completion bash # Bash completion
186
- swixter completion zsh # Zsh completion
187
- swixter completion fish # Fish completion
188
- ```
147
+ # Create profiles for different providers
148
+ swixter claude create --name anthropic-primary --provider anthropic --api-key sk-ant-xxx
149
+ swixter claude create --name openrouter-backup --provider openrouter --api-key sk-or-xxx
150
+ swixter claude create --name ollama-local --provider ollama
151
+
152
+ # Create a group with failover priority
153
+ swixter group create --name ha-group --profiles anthropic-primary,openrouter-backup,ollama-local
189
154
 
190
- ## Model Configuration
155
+ # Set as default
156
+ swixter group set-default ha-group
157
+ ```
191
158
 
192
- ### Claude Code Models
159
+ ### Web UI
193
160
 
194
- Set specific models per profile:
161
+ Manage groups visually with drag-and-drop profile reordering:
195
162
 
196
163
  ```bash
197
- swixter claude create \
198
- --name production \
199
- --provider anthropic \
200
- --api-key sk-ant-xxx \
201
- --anthropic-model claude-sonnet-4-20250514 \
202
- --default-haiku-model claude-haiku-4-20250506 \
203
- --default-opus-model claude-opus-4-20250514 \
204
- --default-sonnet-model claude-sonnet-4-20250514
164
+ swixter ui # Open Groups page to create/reorder groups
205
165
  ```
206
166
 
207
- | Flag | Environment Variable | Description |
208
- |------|---------------------|-------------|
209
- | `--anthropic-model` | `ANTHROPIC_MODEL` | Default model |
210
- | `--default-haiku-model` | `ANTHROPIC_DEFAULT_HAIKU_MODEL` | Haiku model |
211
- | `--default-opus-model` | `ANTHROPIC_DEFAULT_OPUS_MODEL` | Opus model |
212
- | `--default-sonnet-model` | `ANTHROPIC_DEFAULT_SONNET_MODEL` | Sonnet model |
167
+ ## Proxy
213
168
 
214
- ### Codex/Qwen Models
169
+ The local proxy server sits between your AI coding tools and upstream providers, enabling automatic failover, circuit breaking, and unified access.
215
170
 
216
- ```bash
217
- swixter codex create \
218
- --name local-ollama \
219
- --provider ollama \
220
- --base-url http://localhost:11434 \
221
- --model qwen3:32b
222
- ```
171
+ ### How It Works
223
172
 
224
- ## Configuration File
225
-
226
- Configs are stored at:
227
- - **Linux/macOS**: `~/.config/swixter/config.json`
228
- - **Windows**: `~/swixter/config.json`
229
-
230
- ```json
231
- {
232
- "profiles": {
233
- "my-profile": {
234
- "name": "my-profile",
235
- "providerId": "anthropic",
236
- "apiKey": "sk-ant-xxx",
237
- "authToken": "sk-ant-auth-xxx",
238
- "baseURL": "https://api.anthropic.com",
239
- "models": {
240
- "anthropicModel": "claude-sonnet-4-20250514",
241
- "defaultHaikuModel": "claude-haiku-4-20250506",
242
- "defaultOpusModel": "claude-opus-4-20250514",
243
- "defaultSonnetModel": "claude-sonnet-4-20250514"
244
- },
245
- "envKey": "CUSTOM_API_KEY",
246
- "headers": {
247
- "X-Custom-Header": "value"
248
- },
249
- "createdAt": "2024-01-01T00:00:00.000Z",
250
- "updatedAt": "2024-01-01T00:00:00.000Z"
251
- },
252
- "ollama-local": {
253
- "name": "ollama-local",
254
- "providerId": "ollama",
255
- "apiKey": "",
256
- "baseURL": "http://localhost:11434",
257
- "model": "qwen3:32b"
258
- }
259
- },
260
- "coders": {
261
- "claude": {
262
- "activeProfile": "my-profile"
263
- },
264
- "codex": {
265
- "activeProfile": "ollama-local"
266
- },
267
- "qwen": {
268
- "activeProfile": ""
269
- }
270
- }
271
- }
173
+ ```
174
+ ┌─────────────┐ ┌──────────────────┐ ┌──────────────┐
175
+ Claude Code │────▶│ Swixter Proxy │────▶│ Anthropic │
176
+ Codex │ │ (localhost) │─ ─ ▶│ OpenRouter │
177
+ Continue │ │ Circuit Breaker │─ ─ ▶│ Ollama │
178
+ └─────────────┘ └──────────────────┘ └──────────────┘
272
179
  ```
273
180
 
274
- ## Add Custom Providers
181
+ Key capabilities:
275
182
 
276
- ```bash
277
- # Interactive setup
278
- swixter providers add
183
+ - **Failover** - Tries profiles in group priority order, returns first successful response
184
+ - **Circuit Breaker** - Skips providers that failed 3 consecutive times, auto-recovers after 60s
185
+ - **Streaming** - Transparently forwards SSE/NDJSON streaming responses
186
+ - **Multi-format** - Supports both OpenAI Chat (`/v1/chat/completions`) and Anthropic (`/v1/messages`, `/v1/responses`) APIs
187
+ - **Model Rewriting** - Different providers in a group can use different model names; the proxy rewrites them automatically
279
188
 
280
- # With flags
281
- swixter providers add \
282
- --id openrouter \
283
- --name "OpenRouter" \
284
- --display-name "OpenRouter" \
285
- --base-url "https://openrouter.ai/api/v1" \
286
- --auth-type bearer
189
+ ### Commands
287
190
 
288
- # Then create a profile using it
289
- swixter claude create --provider openrouter --api-key sk-or-xxx
191
+ ```bash
192
+ # Start proxy as a background service
193
+ swixter proxy start # Start with default group
194
+ swixter proxy start --group ha-group # Start with specific group
195
+ swixter proxy start --port 8080 # Custom port (default: 15721)
196
+ swixter proxy start --daemon # Run in background
197
+
198
+ # Stop proxy
199
+ swixter proxy stop # Stop default instance
200
+ swixter proxy stop run-15722 # Stop specific instance
201
+
202
+ # View status
203
+ swixter proxy status # Show all running instances
204
+
205
+ # One-shot: start proxy + run coder tool
206
+ swixter proxy run -- claude # Proxy + Claude Code
207
+ swixter proxy run -- codex # Proxy + Codex
208
+ swixter proxy run --group ha-group -- claude # With specific group
290
209
  ```
291
210
 
292
- ## Examples
211
+ ### The `proxy run` Command
212
+
213
+ The easiest way to use the proxy. It:
293
214
 
294
- ### Example 1: Switch between work and personal
215
+ 1. Starts a temporary proxy instance (on next available port)
216
+ 2. Points the coder tool's API URL to the local proxy
217
+ 3. Spawns the coder tool
218
+ 4. Stops the proxy when the coder exits
295
219
 
296
220
  ```bash
297
- # Setup work profile
298
- swixter claude create --name work --provider anthropic --api-key sk-ant-work-xxx
221
+ swixter proxy run -- claude # One command, everything automatic
222
+ ```
299
223
 
300
- # Setup personal profile
301
- swixter claude create --name personal --provider anthropic --api-key sk-ant-personal-xxx
224
+ ### Circuit Breaker
302
225
 
303
- # Switch to work
304
- swixter claude sw work && swixter claude apply
226
+ Per-profile circuit breaker prevents wasting time on failing providers:
305
227
 
306
- # Quick run
307
- swixter claude r
228
+ | State | Behavior | Transition |
229
+ |-------|----------|------------|
230
+ | **Closed** | Requests pass through | 3 consecutive failures → Open |
231
+ | **Open** | Requests skipped | After 60s → Half-Open |
232
+ | **Half-Open** | One probe request allowed | Success → Closed, Failure → Open |
308
233
 
309
- # Switch to personal
310
- swixter claude sw personal && swixter claude apply
311
- swixter claude r
234
+ ### Monitoring (Web UI)
235
+
236
+ ```bash
237
+ swixter ui # Proxy page shows live status, request counts, and real-time logs
312
238
  ```
313
239
 
314
- ### Example 2: Try Qwen locally
240
+ ## Web UI
315
241
 
316
242
  ```bash
317
- # Add Ollama profile
318
- swixter qwen create \
319
- --name local \
320
- --provider ollama \
321
- --base-url http://localhost:11434
322
-
323
- # Switch and run
324
- swixter qwen sw local
325
- swixter qwen r
243
+ swixter ui # Default port 3141
244
+ swixter ui --port 8080 # Custom port
326
245
  ```
327
246
 
328
- ### Example 3: Use Codex with local Ollama
247
+ ### Pages
329
248
 
330
- ```bash
331
- # Create Codex profile for Ollama
332
- swixter codex create \
333
- --name ollama-local \
334
- --provider ollama \
335
- --base-url http://localhost:11434
249
+ - **Dashboard** - All coders at a glance, quick switch and apply
250
+ - **Profiles** - CRUD for configuration profiles
251
+ - **Groups** - Manage failover groups with drag-and-drop priority
252
+ - **Proxy** - Start/stop proxy, live logs, status monitoring
253
+ - **Providers** - Manage custom providers
254
+ - **Settings** - Import/export configurations
336
255
 
337
- # Quick way: All-in-one
338
- swixter codex r
256
+ ## Cloud Sync
339
257
 
340
- # Manual way
341
- swixter codex apply
342
- export OLLAMA_API_KEY=""
343
- codex
344
- ```
258
+ Sync your profiles and provider configs across devices with end-to-end encryption. API keys and other sensitive fields are encrypted client-side before uploading — the server never sees plaintext secrets.
345
259
 
346
- ### Example 4: Web UI workflow
260
+ ### Quick Start
347
261
 
348
262
  ```bash
349
- # Launch Web UI
350
- swixter ui
351
-
352
- # In browser:
353
- # 1. Go to Profiles Create a new profile
354
- # 2. Go to Dashboard → Select profile from dropdown
355
- # 3. Click APPLY to write config
263
+ swixter auth register # Create account
264
+ swixter auth login # Sign in (password)
265
+ swixter auth login --magic-link # Sign in via magic link email
266
+ swixter sync push # Upload encrypted config to cloud
267
+ swixter sync pull # Download and merge from cloud
268
+ swixter sync status # Check sync state
356
269
  ```
357
270
 
358
- ## Shell Completion
359
-
360
- Enable auto-completion for faster typing:
361
-
362
- ### Bash
271
+ ### Auth Commands
363
272
 
364
273
  ```bash
365
- # Install
366
- swixter completion bash > ~/.local/share/bash-completion/completions/swixter
367
-
368
- # Reload
369
- source ~/.bashrc
274
+ swixter auth register # Create a new account
275
+ swixter auth login # Sign in with email + password
276
+ swixter auth login --magic-link # Sign in via magic link
277
+ swixter auth logout # Sign out
278
+ swixter auth status # Check login status
279
+ swixter auth delete-account # Delete your account and cloud data
370
280
  ```
371
281
 
372
- ### Zsh
282
+ ### Sync Commands
373
283
 
374
284
  ```bash
375
- # Install
376
- swixter completion zsh > ~/.zfunc/_swixter
285
+ swixter sync push # Push local config to cloud
286
+ swixter sync push --force-local # Force push (overwrite remote)
287
+ swixter sync pull # Pull remote config to local
288
+ swixter sync pull --force-remote # Force pull (overwrite local)
289
+ swixter sync status # Show sync status and versions
290
+ swixter sync enable # Enable auto sync
291
+ swixter sync disable # Disable auto sync
292
+ ```
293
+
294
+ ### How It Works
377
295
 
378
- # Reload
379
- autoload -U compinit && compinit
296
+ ```
297
+ Local Config Derive Encryption Key → Encrypt Sensitive Fields → Upload to Cloud
298
+
299
+ Cloud → Download → Decrypt → Merge with Local Config → Apply
380
300
  ```
381
301
 
382
- ### Fish
302
+ - **End-to-end encryption**: Sensitive fields (API keys, auth tokens) are encrypted using a key derived from your master password before leaving your machine
303
+ - **Version-based conflict detection**: Local and remote versions are tracked to detect and handle conflicts
304
+ - **Selective push/pull**: Only config and providers data are synced; local-only settings stay untouched
383
305
 
384
- ```bash
385
- # Install
386
- swixter completion fish > ~/.config/fish/completions/swixter.fish
306
+ ## Other Commands
387
307
 
388
- # Reload
389
- fish
308
+ ```bash
309
+ swixter export <file> # Export configs
310
+ swixter export <file> --sanitize # Export without API keys
311
+ swixter import <file> # Import configs
312
+ swixter import <file> --overwrite # Overwrite existing
313
+ swixter completion bash # Shell completions (zsh/fish supported)
390
314
  ```
391
315
 
392
316
  ## Command Aliases
393
317
 
394
- Save keystrokes with short aliases:
395
-
396
318
  | Alias | Full Command | Description |
397
319
  |-------|-------------|-------------|
398
320
  | `r` | `run` | Execute the AI coder |
399
- | `ls` | `list` | List all profiles |
321
+ | `ls` | `list` | List profiles/groups |
400
322
  | `sw` | `switch` | Switch profiles |
401
- | `rm` | `delete` | Delete profiles |
402
- | `new` | `create` | Create new profile |
403
- | `update` | `edit` | Edit existing profile |
323
+ | `rm` | `delete` | Delete profiles/groups |
324
+ | `new` | `create` | Create new |
325
+ | `update` | `edit` | Edit existing |
404
326
  | `upgrade` | `update-cli` | Update CLI tool |
405
327
 
328
+ ## Examples
329
+
330
+ ### Switch between work and personal
331
+
332
+ ```bash
333
+ swixter claude create --name work --provider anthropic --api-key sk-ant-work-xxx
334
+ swixter claude create --name personal --provider anthropic --api-key sk-ant-personal-xxx
335
+ swixter claude sw work && swixter claude apply
336
+ ```
337
+
338
+ ### Failover setup: Anthropic primary + OpenRouter backup
339
+
340
+ ```bash
341
+ # Create profiles
342
+ swixter claude create --name primary --provider anthropic --api-key sk-ant-xxx
343
+ swixter claude create --name backup --provider openrouter --api-key sk-or-xxx
344
+
345
+ # Create failover group
346
+ swixter group create --name failover --profiles primary,backup
347
+
348
+ # Run with proxy (auto-failover)
349
+ swixter proxy run --group failover -- claude
350
+ ```
351
+
352
+ ### Run Codex with local Ollama
353
+
354
+ ```bash
355
+ swixter codex create --name local --provider ollama --base-url http://localhost:11434
356
+ swixter codex r
357
+ ```
358
+
406
359
  ## Architecture
407
360
 
408
361
  ```
@@ -410,45 +363,37 @@ swixter/
410
363
  ├── src/
411
364
  │ ├── cli/ # CLI command handlers
412
365
  │ ├── config/ # Config file management
413
- │ ├── adapters/ # Coder-specific adapters (Claude, Codex, Continue)
414
- │ ├── providers/ # Provider presets
366
+ │ ├── adapters/ # Coder adapters (Claude, Codex, Continue)
367
+ │ ├── providers/ # Provider presets + user-defined providers
368
+ │ ├── groups/ # Group management (failover profiles)
369
+ │ ├── proxy/ # Local proxy server (failover, circuit breaker)
370
+ │ ├── auth/ # Cloud auth (register, login, token management)
371
+ │ ├── sync/ # Cloud sync (push, pull, merge, auto-sync)
372
+ │ ├── crypto/ # End-to-end encryption (key derivation, field encryption)
415
373
  │ ├── server/ # Web UI API server
416
374
  │ └── utils/ # Shared utilities
417
- ├── ui/ # Web UI (React + Vite)
375
+ ├── ui/ # Web UI (React + Vite + Tailwind)
418
376
  └── tests/ # Unit tests
419
377
  ```
420
378
 
421
- **Data Flow**:
422
- 1. `swixter create/switch` → Updates `~/.config/swixter/config.json`
423
- 2. `swixter apply` → Writes to coder config (`~/.claude/settings.json`, etc.)
424
- 3. `swixter run` → Sets env vars + spawns coder CLI
425
-
426
379
  ## Development
427
380
 
428
- Built with modern tools:
429
-
430
381
  ```bash
431
- # Clone repo
432
382
  git clone https://github.com/dawnswwwww/swixter.git
433
383
  cd swixter
434
-
435
- # Install dependencies
436
384
  bun install
385
+ bun run cli:dev # Dev mode with hot reload
386
+ bun test # Run tests
387
+ bun run build # Build all (UI + CLI)
388
+ ```
437
389
 
438
- # Run CLI in dev mode (with hot reload)
439
- bun run cli:dev
440
-
441
- # Run tests
442
- bun test
443
-
444
- # Run specific test
445
- bun test tests/adapters/claude.test.ts
446
-
447
- # E2E tests (requires Docker)
448
- bun run test:e2e
390
+ ### Release
449
391
 
450
- # Build
451
- bun run build
392
+ ```bash
393
+ # Update CHANGELOG.md first, then:
394
+ bun run release:patch # Bug fixes (0.1.0 → 0.1.1)
395
+ bun run release:minor # Features (0.1.0 → 0.2.0)
396
+ bun run release:major # Breaking changes (0.1.0 → 1.0.0)
452
397
  ```
453
398
 
454
399
  ## Tech Stack
@@ -459,7 +404,6 @@ bun run build
459
404
  | **Language** | TypeScript |
460
405
  | **CLI UI** | @clack/prompts |
461
406
  | **Validation** | Zod |
462
- | **Version** | semver |
463
407
  | **Web UI** | React + Vite + Tailwind CSS |
464
408
  | **Testing** | Bun test, Docker E2E |
465
409
 
@@ -467,54 +411,6 @@ bun run build
467
411
 
468
412
  See [CHANGELOG.md](CHANGELOG.md) for version history.
469
413
 
470
- ## Roadmap
471
-
472
- - [ ] Profile templates for common setups
473
- - [ ] Configuration validation and migration tools
474
- - [x] Web UI for profile management (v0.0.9+)
475
- - [ ] Cloud sync for profiles (optional, planned)
476
-
477
- ## Contributing
478
-
479
- Contributions welcome!
480
-
481
- ### Development Setup
482
-
483
- ```bash
484
- git clone https://github.com/dawnswwwww/swixter.git
485
- cd swixter
486
- bun install
487
- bun run cli:dev
488
- bun test
489
- bun run build
490
- ```
491
-
492
- ### Release Process
493
-
494
- 1. Update `CHANGELOG.md` under `[Unreleased]`
495
- 2. Run release command:
496
- ```bash
497
- bun run release:patch # Bug fixes (0.0.10 → 0.0.11)
498
- bun run release:minor # Features (0.0.10 → 0.1.0)
499
- bun run release:major # Breaking changes
500
- ```
501
- 3. GitHub Actions automatically:
502
- - Runs tests on Linux/macOS/Windows
503
- - Publishes to npm
504
- - Creates GitHub Release with changelog
505
-
506
- See [CLAUDE.md](CLAUDE.md) for detailed development documentation.
507
-
508
414
  ## License
509
415
 
510
416
  MIT License - see [LICENSE](LICENSE)
511
-
512
- ## Links
513
-
514
- - [GitHub](https://github.com/dawnswwwww/swixter)
515
- - [npm](https://www.npmjs.com/package/swixter)
516
- - [Issues](https://github.com/dawnswwwww/swixter/issues)
517
-
518
- ---
519
-
520
- **Made with ❤️ to make AI coding tools more accessible**