@bjesuiter/codex-switcher 1.0.0 → 1.0.4
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 +8 -0
- package/cdx.mjs +7 -4
- package/package.json +2 -3
package/README.md
CHANGED
|
@@ -106,6 +106,14 @@ bun install
|
|
|
106
106
|
bun link
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
### Releasing a new version
|
|
110
|
+
|
|
111
|
+
1. Increase version in `package.json`
|
|
112
|
+
2. Add changelog entry for the version in `CHANGELOG.md`
|
|
113
|
+
3. Commit the changes
|
|
114
|
+
4. Create a git tag with the version number (no prefix): `git tag X.Y.Z`
|
|
115
|
+
5. Push both the commit and the tag: `git push && git push --tags`
|
|
116
|
+
|
|
109
117
|
### Manual Configuration (Advanced)
|
|
110
118
|
|
|
111
119
|
You can also manually add accounts to Keychain:
|
package/cdx.mjs
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env bun
|
|
2
2
|
import { Command } from "commander";
|
|
3
|
-
import projectVersion from "project-version";
|
|
4
3
|
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
5
4
|
import path from "node:path";
|
|
6
5
|
import os from "node:os";
|
|
@@ -11,6 +10,10 @@ import { generatePKCE } from "@openauthjs/openauth/pkce";
|
|
|
11
10
|
import { randomBytes } from "node:crypto";
|
|
12
11
|
import http from "node:http";
|
|
13
12
|
|
|
13
|
+
//#region package.json
|
|
14
|
+
var version = "1.0.4";
|
|
15
|
+
|
|
16
|
+
//#endregion
|
|
14
17
|
//#region lib/paths.ts
|
|
15
18
|
const defaultConfigDir = path.join(os.homedir(), ".config", "cdx");
|
|
16
19
|
const defaultPaths = {
|
|
@@ -647,7 +650,7 @@ const interactiveMode = runInteractiveMode;
|
|
|
647
650
|
const createProgram = (deps = {}) => {
|
|
648
651
|
const program = new Command();
|
|
649
652
|
const runLogin = deps.performLogin ?? performLogin;
|
|
650
|
-
program.name("cdx").description("OpenAI account switcher - manage multiple OpenAI Pro subscriptions").version(
|
|
653
|
+
program.name("cdx").description("OpenAI account switcher - manage multiple OpenAI Pro subscriptions").version(version, "-v, --version");
|
|
651
654
|
program.command("login").description("Add a new OpenAI account via OAuth").action(async () => {
|
|
652
655
|
try {
|
|
653
656
|
if (!await runLogin()) {
|
|
@@ -688,7 +691,7 @@ const createProgram = (deps = {}) => {
|
|
|
688
691
|
}
|
|
689
692
|
});
|
|
690
693
|
program.command("version").description("Show CLI version").action(() => {
|
|
691
|
-
process.stdout.write(`${
|
|
694
|
+
process.stdout.write(`${version}\n`);
|
|
692
695
|
});
|
|
693
696
|
program.action(async () => {
|
|
694
697
|
try {
|
|
@@ -704,7 +707,7 @@ const createProgram = (deps = {}) => {
|
|
|
704
707
|
const main = async () => {
|
|
705
708
|
await createProgram().parseAsync(process.argv);
|
|
706
709
|
};
|
|
707
|
-
main().catch((error) => {
|
|
710
|
+
if (import.meta.main) main().catch((error) => {
|
|
708
711
|
const message = error instanceof Error ? error.message : String(error);
|
|
709
712
|
process.stderr.write(`${message}\n`);
|
|
710
713
|
process.exit(1);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@bjesuiter/codex-switcher",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "CLI tool to switch between multiple OpenAI accounts for OpenCode",
|
|
6
6
|
"bin": {
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"dependencies": {
|
|
23
23
|
"@clack/prompts": "^0.11.0",
|
|
24
24
|
"@openauthjs/openauth": "^0.4.3",
|
|
25
|
-
"commander": "^14.0.2"
|
|
26
|
-
"project-version": "^2.0.0"
|
|
25
|
+
"commander": "^14.0.2"
|
|
27
26
|
}
|
|
28
27
|
}
|