@minniexcode/codex-switch 0.0.1
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 +21 -0
- package/README.md +171 -0
- package/dist/cli.js +30 -0
- package/docs/codex-switch-prd.md +625 -0
- package/docs/codex-switch-product-overview.md +239 -0
- package/docs/codex-switch-product-research.md +343 -0
- package/package.json +48 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 minniexcode
|
|
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,171 @@
|
|
|
1
|
+
# @minniexcode/codex-switch
|
|
2
|
+
|
|
3
|
+
`@minniexcode/codex-switch` is a local-first CLI for managing and switching Codex provider/profile configuration safely.
|
|
4
|
+
|
|
5
|
+
Current product direction:
|
|
6
|
+
|
|
7
|
+
- CLI-first
|
|
8
|
+
- local-first
|
|
9
|
+
- safe by default
|
|
10
|
+
- AI-friendly
|
|
11
|
+
|
|
12
|
+
The intended command name is:
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
codexs
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
## Status
|
|
19
|
+
|
|
20
|
+
This scoped package is currently being reserved and scaffolded for the first public release.
|
|
21
|
+
|
|
22
|
+
The product scope is already defined, but the full CLI feature set is not implemented yet. The first published versions may be bootstrap releases used to reserve the npm package name and establish the command entrypoint.
|
|
23
|
+
|
|
24
|
+
If you install the package now, expect a minimal CLI shell rather than the complete switching workflow.
|
|
25
|
+
The project is scaffolded as a TypeScript CLI and publishes compiled output from `dist/`.
|
|
26
|
+
|
|
27
|
+
## Why This Exists
|
|
28
|
+
|
|
29
|
+
Managing multiple Codex providers or profiles locally usually falls into two bad options:
|
|
30
|
+
|
|
31
|
+
- ad hoc scripts that work once but are hard to maintain
|
|
32
|
+
- heavier account or desktop tools that solve a broader problem than local switching
|
|
33
|
+
|
|
34
|
+
`@minniexcode/codex-switch` sits between those extremes. It aims to provide a stable CLI interface for:
|
|
35
|
+
|
|
36
|
+
- viewing the current Codex profile
|
|
37
|
+
- listing locally configured providers
|
|
38
|
+
- switching providers safely
|
|
39
|
+
- backing up config before mutation
|
|
40
|
+
- rolling back on failure
|
|
41
|
+
- importing and exporting provider mappings
|
|
42
|
+
- returning structured output for automation and AI agents
|
|
43
|
+
|
|
44
|
+
## Product Definition
|
|
45
|
+
|
|
46
|
+
`@minniexcode/codex-switch` is intended to manage files under `~/.codex/`:
|
|
47
|
+
|
|
48
|
+
```text
|
|
49
|
+
~/.codex/
|
|
50
|
+
config.toml
|
|
51
|
+
auth.json
|
|
52
|
+
providers.json
|
|
53
|
+
backups/
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
Core design principles:
|
|
57
|
+
|
|
58
|
+
- `config.toml` remains the source of the active top-level `profile`
|
|
59
|
+
- `providers.json` stores provider-to-profile and provider-to-key mappings
|
|
60
|
+
- all writes should be backed up first
|
|
61
|
+
- failures should trigger rollback
|
|
62
|
+
- CLI output should stay stable and machine-readable
|
|
63
|
+
|
|
64
|
+
## Planned MVP
|
|
65
|
+
|
|
66
|
+
The planned MVP command surface is:
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
codexs list
|
|
70
|
+
codexs current
|
|
71
|
+
codexs switch <provider>
|
|
72
|
+
codexs status
|
|
73
|
+
codexs import <file>
|
|
74
|
+
codexs export <file>
|
|
75
|
+
codexs add <provider>
|
|
76
|
+
codexs remove <provider>
|
|
77
|
+
codexs doctor
|
|
78
|
+
codexs rollback
|
|
79
|
+
```
|
|
80
|
+
|
|
81
|
+
Planned shared flags:
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
--json
|
|
85
|
+
--codex-dir <path>
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## Example Provider Model
|
|
89
|
+
|
|
90
|
+
Planned `providers.json` shape:
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
{
|
|
94
|
+
"providers": {
|
|
95
|
+
"packycode": {
|
|
96
|
+
"profile": "packycode",
|
|
97
|
+
"apiKey": "sk-xxx",
|
|
98
|
+
"baseUrl": "https://example.com/v1",
|
|
99
|
+
"note": "primary free model route",
|
|
100
|
+
"tags": ["free", "daily"]
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
```
|
|
105
|
+
|
|
106
|
+
`providers.json` should be treated as a local secret because it may contain API keys.
|
|
107
|
+
|
|
108
|
+
## Install
|
|
109
|
+
|
|
110
|
+
Global install:
|
|
111
|
+
|
|
112
|
+
```bash
|
|
113
|
+
npm install -g @minniexcode/codex-switch
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
One-off execution:
|
|
117
|
+
|
|
118
|
+
```bash
|
|
119
|
+
npx @minniexcode/codex-switch
|
|
120
|
+
```
|
|
121
|
+
|
|
122
|
+
Current bootstrap behavior:
|
|
123
|
+
|
|
124
|
+
```bash
|
|
125
|
+
codexs --help
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
## Current Repository Contents
|
|
129
|
+
|
|
130
|
+
This repository currently contains the product definition and PRD used to shape the first implementation:
|
|
131
|
+
|
|
132
|
+
- [Product Overview](./docs/codex-switch-product-overview.md)
|
|
133
|
+
- [Product Research](./docs/codex-switch-product-research.md)
|
|
134
|
+
- [PRD](./docs/codex-switch-prd.md)
|
|
135
|
+
|
|
136
|
+
## Roadmap
|
|
137
|
+
|
|
138
|
+
Near-term priorities:
|
|
139
|
+
|
|
140
|
+
- publish the package name and CLI entrypoint
|
|
141
|
+
- implement provider storage and validation
|
|
142
|
+
- implement config backup and rollback
|
|
143
|
+
- implement safe switching flow around `config.toml`
|
|
144
|
+
- support structured `--json` output for automation
|
|
145
|
+
- add cross-platform tests for Windows, macOS, and Linux paths
|
|
146
|
+
|
|
147
|
+
## Non-Goals for MVP
|
|
148
|
+
|
|
149
|
+
The first version is not trying to be:
|
|
150
|
+
|
|
151
|
+
- a GUI or desktop app
|
|
152
|
+
- a background daemon
|
|
153
|
+
- a full account management platform
|
|
154
|
+
- a proxy/router layer
|
|
155
|
+
- a remote sync service
|
|
156
|
+
|
|
157
|
+
## Development
|
|
158
|
+
|
|
159
|
+
At this stage the package is a bootstrap CLI shell. The implementation will follow the product documents in `docs/`.
|
|
160
|
+
|
|
161
|
+
Local development:
|
|
162
|
+
|
|
163
|
+
```bash
|
|
164
|
+
npm install
|
|
165
|
+
npm run build
|
|
166
|
+
node dist/cli.js --help
|
|
167
|
+
```
|
|
168
|
+
|
|
169
|
+
## License
|
|
170
|
+
|
|
171
|
+
MIT
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const args = process.argv.slice(2);
|
|
4
|
+
const version = "0.0.1";
|
|
5
|
+
const helpText = `codex-switch
|
|
6
|
+
|
|
7
|
+
Bootstrap release for the future Codex provider/profile switching CLI.
|
|
8
|
+
|
|
9
|
+
Usage:
|
|
10
|
+
codexs
|
|
11
|
+
codexs --help
|
|
12
|
+
codexs --version
|
|
13
|
+
|
|
14
|
+
Status:
|
|
15
|
+
This package currently reserves the npm scope and exposes the planned CLI entrypoint.
|
|
16
|
+
The full switching workflow is not implemented yet.
|
|
17
|
+
|
|
18
|
+
Docs:
|
|
19
|
+
https://github.com/minniexcode/codex-switch
|
|
20
|
+
`;
|
|
21
|
+
if (args.includes("--version") || args.includes("-v")) {
|
|
22
|
+
console.log(version);
|
|
23
|
+
process.exit(0);
|
|
24
|
+
}
|
|
25
|
+
if (args.length === 0 || args.includes("--help") || args.includes("-h")) {
|
|
26
|
+
console.log(helpText);
|
|
27
|
+
process.exit(0);
|
|
28
|
+
}
|
|
29
|
+
console.error(`Command not implemented yet: ${args.join(" ")}\nRun "codexs --help" for the current bootstrap status.`);
|
|
30
|
+
process.exit(1);
|