swixter 0.0.11 → 0.1.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/README.md CHANGED
@@ -2,7 +2,7 @@
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/release.yml)
5
+ [![Release Status](https://github.com/dawnswwwww/swixter/actions/workflows/release.yml/badge.svg)](https://github.com/dawnswwwww/swixter/actions/workflows/test.yml)
6
6
  [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
7
7
  [![Node.js Version](https://img.shields.io/node/v/swixter.svg)](https://nodejs.org)
8
8
 
@@ -20,6 +20,7 @@ Working with AI coding tools shouldn't be complicated. Swixter lets you:
20
20
  - **Use command aliases** - Ultra-short commands (`r`, `ls`, `sw`) for maximum productivity
21
21
  - **Add custom providers** - Easily integrate any OpenAI-compatible AI service
22
22
  - **Stay in control** - All configs stored locally, no cloud dependencies
23
+ - **Web UI** - Browser-based interface for visual configuration management
23
24
 
24
25
  ## Installation
25
26
 
@@ -37,72 +38,81 @@ npx swixter --help
37
38
 
38
39
  ### Platform Support
39
40
 
40
- - **Linux/macOS**: Full support
41
- - **Windows**: Full support (Windows 10/11, requires Node.js 18+)
42
- - Config stored at `~/swixter/config.json` (e.g., `C:\Users\YourName\swixter\config.json`)
43
- - Docker Desktop + WSL2 recommended for E2E tests
44
- - See [docs/WINDOWS.md](docs/WINDOWS.md) for detailed Windows guide
41
+ | Platform | Status | Notes |
42
+ |----------|--------|-------|
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 |
45
46
 
46
- ## Quick Start
47
+ Config stored at:
48
+ - **Linux/macOS**: `~/.config/swixter/`
49
+ - **Windows**: `~/swixter/` (e.g., `C:\Users\YourName\swixter\`)
47
50
 
48
- ```bash
49
- # Create your first profile
50
- swixter claude create
51
+ See [docs/WINDOWS.md](docs/WINDOWS.md) for detailed Windows guide.
51
52
 
52
- # List all profiles
53
- swixter claude list
53
+ ## Quick Start
54
54
 
55
- # Switch between profiles
56
- swixter claude switch my-profile
55
+ ```bash
56
+ # Interactive mode - guided setup
57
+ swixter
57
58
 
58
- # Apply profile to Claude Code
59
- swixter claude apply
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
60
64
 
61
- # Or launch the Web UI (new!)
65
+ # Launch Web UI (browser-based management)
62
66
  swixter ui
63
67
  ```
64
68
 
65
69
  ## Built-in Providers
66
70
 
67
- - **Anthropic** - Official Claude API
68
- - **Ollama** - Run Qwen and other models locally
69
- - **Custom** - Add any OpenAI-compatible API
71
+ | Provider | API Type | Description |
72
+ |----------|----------|-------------|
73
+ | **Anthropic** | responses | Official Claude API |
74
+ | **Ollama** | chat | Run Qwen, Llama, and other models locally |
75
+ | **OpenAI** | chat | OpenAI API |
76
+ | **OpenRouter** | chat | Unified access to 100+ models |
77
+ | **Custom** | chat | Add any OpenAI-compatible API |
70
78
 
71
- ## Add Custom Providers
79
+ ## Web UI
72
80
 
73
- Easily add any AI service:
81
+ Launch `swixter ui` to open a browser-based interface for managing profiles.
82
+
83
+ ### Features
84
+
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
74
91
 
75
92
  ```bash
76
- # Interactive setup
77
- swixter providers add
93
+ # Default port (3141)
94
+ swixter ui
78
95
 
79
- # Or use flags
80
- swixter providers add \
81
- --id openrouter \
82
- --name "OpenRouter" \
83
- --base-url "https://openrouter.ai/api/v1" \
84
- --auth-type bearer
96
+ # Custom port
97
+ swixter ui --port 8080
85
98
  ```
86
99
 
87
- Supports OpenRouter, DeepSeek, MiniMax, and any OpenAI-compatible API.
100
+ The UI auto-opens in your browser at `http://localhost:3141`.
88
101
 
89
- ## Features
102
+ ### Web UI Dashboard
90
103
 
91
- **Simple** - Minimal commands, maximum productivity
92
- 🚀 **Fast** - Built with Bun for instant operations
93
- 🎨 **Beautiful** - Clean, modern CLI interface
94
- 🔒 **Secure** - Keys stored locally, optional sanitization for sharing
95
- 🔧 **Flexible** - Works with any OpenAI-compatible API
96
- 🎯 **Model config** - Set specific models per profile (Claude: Sonnet/Opus/Haiku; Codex/Qwen: any model)
97
- 📦 **Lightweight** - Small package size, zero bloat
98
- 🌐 **Web UI** - Browser-based configuration management (new in v0.1.0!)
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
99
109
 
100
110
  ## Commands
101
111
 
102
112
  ### For Claude Code
103
113
 
104
114
  ```bash
105
- swixter claude create # Create new profile
115
+ swixter claude create # Create new profile (alias: new)
106
116
  swixter claude list # List all profiles (alias: ls)
107
117
  swixter claude switch <name> # Switch active profile (alias: sw)
108
118
  swixter claude apply # Apply to Claude Code
@@ -110,28 +120,28 @@ swixter claude run # Run Claude Code with current profile (alias: r
110
120
  swixter claude edit <name> # Edit existing profile (alias: update)
111
121
  swixter claude current # Show current active profile
112
122
  swixter claude delete <name> # Delete profile (alias: rm)
113
- swixter claude install # Install Claude Code CLI
114
- swixter claude update-cli # Update Claude Code CLI (alias: upgrade)
123
+ swixter claude install # Install Claude Code CLI
124
+ swixter claude update-cli # Update Claude Code CLI (alias: upgrade)
115
125
  ```
116
126
 
117
127
  ### For Codex
118
128
 
119
129
  ```bash
120
- swixter codex create # Create new profile
121
- swixter codex list # List all profiles (alias: ls)
122
- swixter codex switch <name> # Switch active profile (alias: sw)
123
- swixter codex apply # Apply to Codex (writes ~/.codex/config.toml)
124
- swixter codex run # Apply + set env + run codex (alias: r, all-in-one)
125
- swixter codex edit <name> # Edit existing profile (alias: update)
126
- swixter codex current # Show current active profile
127
- swixter codex delete <name> # Delete profile (alias: rm)
128
- swixter codex install # Install Codex CLI
129
- swixter codex update-cli # Update Codex CLI (alias: upgrade)
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)
130
140
  ```
131
141
 
132
142
  **Two ways to use Codex profiles**:
133
143
 
134
- 1. **Quick way** (recommended): `swixter codex r` (or `swixter codex run`)
144
+ 1. **Quick way** (recommended): `swixter codex r`
135
145
  - Automatically applies profile to config.toml
136
146
  - Sets environment variables
137
147
  - Runs codex in one command
@@ -158,22 +168,64 @@ swixter qwen update-cli # Update Qwen Code CLI (alias: upgrade)
158
168
 
159
169
  ```bash
160
170
  swixter providers list # List available providers
161
- swixter providers add # Add custom provider
171
+ swixter providers add # Add custom provider
162
172
  swixter providers remove <id> # Remove provider
173
+ swixter providers show <id> # Show provider details
163
174
  ```
164
175
 
165
176
  ### Configuration
166
177
 
167
178
  ```bash
168
- swixter ui # Launch Web UI (new!)
169
- swixter export config.json # Export configs
170
- swixter import config.json # Import configs
171
- swixter completion bash # Shell completion
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
+ ```
189
+
190
+ ## Model Configuration
191
+
192
+ ### Claude Code Models
193
+
194
+ Set specific models per profile:
195
+
196
+ ```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
205
+ ```
206
+
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 |
213
+
214
+ ### Codex/Qwen Models
215
+
216
+ ```bash
217
+ swixter codex create \
218
+ --name local-ollama \
219
+ --provider ollama \
220
+ --base-url http://localhost:11434 \
221
+ --model qwen3:32b
172
222
  ```
173
223
 
174
224
  ## Configuration File
175
225
 
176
- Configs are stored at `~/.config/swixter/config.json`
226
+ Configs are stored at:
227
+ - **Linux/macOS**: `~/.config/swixter/config.json`
228
+ - **Windows**: `~/swixter/config.json`
177
229
 
178
230
  ```json
179
231
  {
@@ -181,18 +233,62 @@ Configs are stored at `~/.config/swixter/config.json`
181
233
  "my-profile": {
182
234
  "name": "my-profile",
183
235
  "providerId": "anthropic",
184
- "apiKey": "sk-ant-...",
185
- "model": "claude-sonnet-4-20250514"
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"
186
258
  }
187
259
  },
188
260
  "coders": {
189
261
  "claude": {
190
262
  "activeProfile": "my-profile"
263
+ },
264
+ "codex": {
265
+ "activeProfile": "ollama-local"
266
+ },
267
+ "qwen": {
268
+ "activeProfile": ""
191
269
  }
192
270
  }
193
271
  }
194
272
  ```
195
273
 
274
+ ## Add Custom Providers
275
+
276
+ ```bash
277
+ # Interactive setup
278
+ swixter providers add
279
+
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
287
+
288
+ # Then create a profile using it
289
+ swixter claude create --provider openrouter --api-key sk-or-xxx
290
+ ```
291
+
196
292
  ## Examples
197
293
 
198
294
  ### Example 1: Switch between work and personal
@@ -204,10 +300,10 @@ swixter claude create --name work --provider anthropic --api-key sk-ant-work-xxx
204
300
  # Setup personal profile
205
301
  swixter claude create --name personal --provider anthropic --api-key sk-ant-personal-xxx
206
302
 
207
- # Switch to work (using short alias)
303
+ # Switch to work
208
304
  swixter claude sw work && swixter claude apply
209
305
 
210
- # Quick run with work profile (using ultra-short alias)
306
+ # Quick run
211
307
  swixter claude r
212
308
 
213
309
  # Switch to personal
@@ -224,7 +320,7 @@ swixter qwen create \
224
320
  --provider ollama \
225
321
  --base-url http://localhost:11434
226
322
 
227
- # Switch and run (using aliases)
323
+ # Switch and run
228
324
  swixter qwen sw local
229
325
  swixter qwen r
230
326
  ```
@@ -238,81 +334,98 @@ swixter codex create \
238
334
  --provider ollama \
239
335
  --base-url http://localhost:11434
240
336
 
241
- # Quick way: All-in-one command (using ultra-short alias)
337
+ # Quick way: All-in-one
242
338
  swixter codex r
243
339
 
244
- # Or manual way:
340
+ # Manual way
245
341
  swixter codex apply
246
342
  export OLLAMA_API_KEY=""
247
343
  codex
248
-
249
- # Run with different profile temporarily
250
- swixter codex run --profile other-profile
251
344
  ```
252
345
 
253
- ### Example 4: Add OpenRouter
346
+ ### Example 4: Web UI workflow
254
347
 
255
348
  ```bash
256
- # Add OpenRouter as custom provider
257
- swixter providers add \
258
- --id openrouter \
259
- --base-url "https://openrouter.ai/api/v1" \
260
- --auth-type bearer
349
+ # Launch Web UI
350
+ swixter ui
261
351
 
262
- # Create profile using OpenRouter
263
- swixter claude create \
264
- --name openrouter-profile \
265
- --provider openrouter \
266
- --api-key sk-or-v1-xxx
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
267
356
  ```
268
357
 
269
358
  ## Shell Completion
270
359
 
271
360
  Enable auto-completion for faster typing:
272
361
 
362
+ ### Bash
363
+
273
364
  ```bash
274
- # Bash
365
+ # Install
275
366
  swixter completion bash > ~/.local/share/bash-completion/completions/swixter
276
367
 
277
- # Zsh
368
+ # Reload
369
+ source ~/.bashrc
370
+ ```
371
+
372
+ ### Zsh
373
+
374
+ ```bash
375
+ # Install
278
376
  swixter completion zsh > ~/.zfunc/_swixter
279
377
 
280
- # Fish
378
+ # Reload
379
+ autoload -U compinit && compinit
380
+ ```
381
+
382
+ ### Fish
383
+
384
+ ```bash
385
+ # Install
281
386
  swixter completion fish > ~/.config/fish/completions/swixter.fish
387
+
388
+ # Reload
389
+ fish
282
390
  ```
283
391
 
284
392
  ## Command Aliases
285
393
 
286
394
  Save keystrokes with short aliases:
287
395
 
288
- ```bash
289
- swixter claude r # run (ultra-short!)
290
- swixter claude ls # list
291
- swixter claude sw my-profile # switch
292
- swixter claude rm old-profile # delete
293
- swixter claude new # create
294
- ```
396
+ | Alias | Full Command | Description |
397
+ |-------|-------------|-------------|
398
+ | `r` | `run` | Execute the AI coder |
399
+ | `ls` | `list` | List all profiles |
400
+ | `sw` | `switch` | Switch profiles |
401
+ | `rm` | `delete` | Delete profiles |
402
+ | `new` | `create` | Create new profile |
403
+ | `update` | `edit` | Edit existing profile |
404
+ | `upgrade` | `update-cli` | Update CLI tool |
295
405
 
296
- Full command reference:
297
- - `r` → `run` - Execute the AI coder
298
- - `ls` → `list` - List all profiles
299
- - `sw` → `switch` - Switch profiles
300
- - `rm` → `delete` - Delete profiles
301
- - `new` → `create` - Create new profile
302
- - `update` → `edit` - Edit existing profile
303
- - `upgrade` → `update-cli` - Update CLI tool
406
+ ## Architecture
304
407
 
305
- ## Help & Documentation
306
-
307
- ```bash
308
- swixter --help # Global help
309
- swixter claude --help # Claude commands help
310
- swixter providers --help # Provider commands help
311
408
  ```
409
+ swixter/
410
+ ├── src/
411
+ │ ├── cli/ # CLI command handlers
412
+ │ ├── config/ # Config file management
413
+ │ ├── adapters/ # Coder-specific adapters (Claude, Codex, Continue)
414
+ │ ├── providers/ # Provider presets
415
+ │ ├── server/ # Web UI API server
416
+ │ └── utils/ # Shared utilities
417
+ ├── ui/ # Web UI (React + Vite)
418
+ └── tests/ # Unit tests
419
+ ```
420
+
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
312
425
 
313
426
  ## Development
314
427
 
315
- Built with modern tools for a great developer experience:
428
+ Built with modern tools:
316
429
 
317
430
  ```bash
318
431
  # Clone repo
@@ -322,71 +435,70 @@ cd swixter
322
435
  # Install dependencies
323
436
  bun install
324
437
 
325
- # Run in dev mode
326
- bun run cli
438
+ # Run CLI in dev mode (with hot reload)
439
+ bun run cli:dev
327
440
 
328
441
  # Run tests
329
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
449
+
450
+ # Build
451
+ bun run build
330
452
  ```
331
453
 
332
454
  ## Tech Stack
333
455
 
334
- - **Bun** - Fast JavaScript runtime
335
- - **TypeScript** - Type safety
336
- - **@clack/prompts** - Beautiful CLI prompts
337
- - **Zod** - Schema validation
338
- - **semver** - Version parsing and comparison
456
+ | Layer | Technology |
457
+ |-------|------------|
458
+ | **Runtime** | Bun |
459
+ | **Language** | TypeScript |
460
+ | **CLI UI** | @clack/prompts |
461
+ | **Validation** | Zod |
462
+ | **Version** | semver |
463
+ | **Web UI** | React + Vite + Tailwind CSS |
464
+ | **Testing** | Bun test, Docker E2E |
339
465
 
340
466
  ## Changelog
341
467
 
342
- See [CHANGELOG.md](CHANGELOG.md) for a list of changes in each version.
468
+ See [CHANGELOG.md](CHANGELOG.md) for version history.
343
469
 
344
470
  ## Roadmap
345
471
 
346
- Future plans for Swixter:
347
-
348
- - [ ] Support for more AI coding assistants
349
472
  - [ ] Profile templates for common setups
350
473
  - [ ] Configuration validation and migration tools
351
- - [x] Web UI for profile management (v0.1.0)
474
+ - [x] Web UI for profile management (v0.0.9+)
352
475
  - [ ] Cloud sync for profiles (optional, planned)
353
476
 
354
477
  ## Contributing
355
478
 
356
- Contributions are welcome! Here's how to get started:
479
+ Contributions welcome!
357
480
 
358
481
  ### Development Setup
359
482
 
360
483
  ```bash
361
- # Clone the repository
362
484
  git clone https://github.com/dawnswwwww/swixter.git
363
485
  cd swixter
364
-
365
- # Install dependencies
366
486
  bun install
367
-
368
- # Run in development mode
369
487
  bun run cli:dev
370
-
371
- # Run tests
372
488
  bun test
373
-
374
- # Build the project
375
489
  bun run build
376
490
  ```
377
491
 
378
492
  ### Release Process
379
493
 
380
- Swixter uses a semi-automated release process:
381
-
382
- 1. **Update CHANGELOG.md** with your changes under `[Unreleased]`
383
- 2. **Run release command**:
494
+ 1. Update `CHANGELOG.md` under `[Unreleased]`
495
+ 2. Run release command:
384
496
  ```bash
385
- bun run release:patch # For bug fixes (0.0.4 → 0.0.5)
386
- bun run release:minor # For new features (0.0.4 → 0.1.0)
387
- bun run release:major # For breaking changes (0.0.4 → 1.0.0)
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
388
500
  ```
389
- 3. **GitHub Actions** automatically:
501
+ 3. GitHub Actions automatically:
390
502
  - Runs tests on Linux/macOS/Windows
391
503
  - Publishes to npm
392
504
  - Creates GitHub Release with changelog