swixter 0.0.1-alpha

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +262 -0
  3. package/dist/cli/index.js +19241 -0
  4. package/package.json +72 -0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 dawnswwwww
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,262 @@
1
+ # Swixter
2
+
3
+ > Make AI coding tools effortlessly switchable
4
+
5
+ A lightweight CLI tool that makes it easy to switch between AI providers for Claude Code and other AI coding assistants.
6
+
7
+ ## Why Swixter?
8
+
9
+ Working with AI coding tools shouldn't be complicated. Swixter lets you:
10
+
11
+ - **Switch providers instantly** - Change between Anthropic, Ollama, or custom APIs with one command
12
+ - **Manage multiple configs** - Keep separate profiles for work, personal, or experimental setups
13
+ - **Add custom providers** - Easily integrate any AI service with a simple configuration
14
+ - **Stay in control** - All configs stored locally, no cloud dependencies
15
+
16
+ ## Installation
17
+
18
+ ```bash
19
+ npm install -g swixter
20
+ ```
21
+
22
+ Or use with npx (no install needed):
23
+
24
+ ```bash
25
+ npx swixter --help
26
+ ```
27
+
28
+ ## Quick Start
29
+
30
+ ```bash
31
+ # Create your first profile
32
+ swixter claude create
33
+
34
+ # List all profiles
35
+ swixter claude list
36
+
37
+ # Switch between profiles
38
+ swixter claude switch my-profile
39
+
40
+ # Apply profile to Claude Code
41
+ swixter claude apply
42
+ ```
43
+
44
+ ## Built-in Providers
45
+
46
+ - **Anthropic** - Official Claude API
47
+ - **Ollama** - Run Qwen and other models locally
48
+ - **Custom** - Add any OpenAI-compatible API
49
+
50
+ ## Add Custom Providers
51
+
52
+ Easily add any AI service:
53
+
54
+ ```bash
55
+ # Interactive setup
56
+ swixter providers add
57
+
58
+ # Or use flags
59
+ swixter providers add \
60
+ --id openrouter \
61
+ --name "OpenRouter" \
62
+ --base-url "https://openrouter.ai/api/v1" \
63
+ --auth-type bearer
64
+ ```
65
+
66
+ Supports OpenRouter, DeepSeek, MiniMax, and any OpenAI-compatible API.
67
+
68
+ ## Features
69
+
70
+ ✨ **Simple** - Minimal commands, maximum productivity
71
+ 🚀 **Fast** - Built with Bun for instant operations
72
+ 🎨 **Beautiful** - Clean, modern CLI interface
73
+ 🔒 **Secure** - Keys stored locally, optional sanitization for sharing
74
+ 🔧 **Flexible** - Works with any OpenAI-compatible API
75
+ 📦 **Lightweight** - Small package size, zero bloat
76
+
77
+ ## Commands
78
+
79
+ ### For Claude Code
80
+
81
+ ```bash
82
+ swixter claude create # Create new profile
83
+ swixter claude list # List all profiles
84
+ swixter claude switch <name> # Switch active profile
85
+ swixter claude apply # Apply to Claude Code
86
+ swixter claude delete <name> # Delete profile
87
+ ```
88
+
89
+ ### For Qwen (or other coders)
90
+
91
+ ```bash
92
+ swixter qwen create
93
+ swixter qwen list
94
+ swixter qwen switch <name>
95
+ ```
96
+
97
+ ### Provider Management
98
+
99
+ ```bash
100
+ swixter providers list # List available providers
101
+ swixter providers add # Add custom provider
102
+ swixter providers remove <id> # Remove provider
103
+ ```
104
+
105
+ ### Configuration
106
+
107
+ ```bash
108
+ swixter export config.json # Export configs
109
+ swixter import config.json # Import configs
110
+ swixter completion bash # Shell completion
111
+ ```
112
+
113
+ ## Configuration File
114
+
115
+ Configs are stored at `~/.config/swixter/config.json`
116
+
117
+ ```json
118
+ {
119
+ "profiles": {
120
+ "my-profile": {
121
+ "name": "my-profile",
122
+ "providerId": "anthropic",
123
+ "apiKey": "sk-ant-...",
124
+ "model": "claude-sonnet-4-20250514"
125
+ }
126
+ },
127
+ "coders": {
128
+ "claude": {
129
+ "activeProfile": "my-profile"
130
+ }
131
+ }
132
+ }
133
+ ```
134
+
135
+ ## Examples
136
+
137
+ ### Example 1: Switch between work and personal
138
+
139
+ ```bash
140
+ # Setup work profile
141
+ swixter claude create --name work --provider anthropic --api-key sk-ant-work-xxx
142
+
143
+ # Setup personal profile
144
+ swixter claude create --name personal --provider anthropic --api-key sk-ant-personal-xxx
145
+
146
+ # Switch to work
147
+ swixter claude switch work && swixter claude apply
148
+
149
+ # Switch to personal
150
+ swixter claude switch personal && swixter claude apply
151
+ ```
152
+
153
+ ### Example 2: Try Qwen locally
154
+
155
+ ```bash
156
+ # Add Ollama profile
157
+ swixter qwen create \
158
+ --name local \
159
+ --provider ollama \
160
+ --base-url http://localhost:11434
161
+
162
+ # Switch and use
163
+ swixter qwen switch local
164
+ ```
165
+
166
+ ### Example 3: Add OpenRouter
167
+
168
+ ```bash
169
+ # Add OpenRouter as custom provider
170
+ swixter providers add \
171
+ --id openrouter \
172
+ --base-url "https://openrouter.ai/api/v1" \
173
+ --auth-type bearer
174
+
175
+ # Create profile using OpenRouter
176
+ swixter claude create \
177
+ --name openrouter-profile \
178
+ --provider openrouter \
179
+ --api-key sk-or-v1-xxx
180
+ ```
181
+
182
+ ## Shell Completion
183
+
184
+ Enable auto-completion for faster typing:
185
+
186
+ ```bash
187
+ # Bash
188
+ swixter completion bash > ~/.local/share/bash-completion/completions/swixter
189
+
190
+ # Zsh
191
+ swixter completion zsh > ~/.zfunc/_swixter
192
+
193
+ # Fish
194
+ swixter completion fish > ~/.config/fish/completions/swixter.fish
195
+ ```
196
+
197
+ ## Command Aliases
198
+
199
+ Save keystrokes with short aliases:
200
+
201
+ ```bash
202
+ swixter claude ls # list
203
+ swixter claude sw my-profile # switch
204
+ swixter claude rm old-profile # delete
205
+ swixter claude new # create
206
+ ```
207
+
208
+ ## Help & Documentation
209
+
210
+ ```bash
211
+ swixter --help # Global help
212
+ swixter claude --help # Claude commands help
213
+ swixter providers --help # Provider commands help
214
+ ```
215
+
216
+ ## Development
217
+
218
+ Built with modern tools for a great developer experience:
219
+
220
+ ```bash
221
+ # Clone repo
222
+ git clone https://github.com/dawnswwwww/swixter.git
223
+ cd swixter
224
+
225
+ # Install dependencies
226
+ bun install
227
+
228
+ # Run in dev mode
229
+ bun run cli
230
+
231
+ # Run tests
232
+ bun test
233
+ ```
234
+
235
+ ## Tech Stack
236
+
237
+ - **Bun** - Fast JavaScript runtime
238
+ - **TypeScript** - Type safety
239
+ - **@clack/prompts** - Beautiful CLI prompts
240
+ - **Zod** - Schema validation
241
+
242
+ ## Contributing
243
+
244
+ Contributions are welcome! Feel free to:
245
+
246
+ - 🐛 Report bugs
247
+ - 💡 Suggest features
248
+ - 🔧 Submit pull requests
249
+
250
+ ## License
251
+
252
+ MIT License - see [LICENSE](LICENSE)
253
+
254
+ ## Links
255
+
256
+ - [GitHub](https://github.com/dawnswwwww/swixter)
257
+ - [npm](https://www.npmjs.com/package/swixter)
258
+ - [Issues](https://github.com/dawnswwwww/swixter/issues)
259
+
260
+ ---
261
+
262
+ **Made with ❤️ to make AI coding tools more accessible**