@gonkagate/claude-code 0.1.3 → 0.2.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/CHANGELOG.md +9 -0
- package/README.md +12 -0
- package/dist/cli.d.ts +2 -2
- package/dist/cli.js +16 -7
- package/dist/cli.js.map +1 -1
- package/docs/how-it-works.md +2 -0
- package/docs/security.md +2 -0
- package/docs/troubleshooting.md +6 -0
- package/package.json +6 -2
- package/scripts/publish-alias-package.mjs +108 -0
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
## Unreleased
|
|
4
4
|
|
|
5
|
+
- Added `@gonkagate/claude-code-setup` as a setup-style alias for the existing Claude Code installer.
|
|
5
6
|
- Improved npm package metadata and README copy for better package-page clarity, discovery, and onboarding.
|
|
6
7
|
- Added a curated model registry and model picker to the public installer flow.
|
|
7
8
|
- Added `--model <model-key>` and `--model=<model-key>` support for curated non-secret model selection.
|
|
@@ -17,6 +18,14 @@
|
|
|
17
18
|
- Restored automated npm publish dispatch after Release Please creates a new release tag.
|
|
18
19
|
- Made publish reruns skip versions that are already present on npm instead of failing with a duplicate-version error.
|
|
19
20
|
|
|
21
|
+
## [0.2.0](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.3...v0.2.0) (2026-04-13)
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### Features
|
|
25
|
+
|
|
26
|
+
* add Claude Code setup alias ([3d411f5](https://github.com/GonkaGate/gonkagate-claude-code/commit/3d411f5c0cbafd84d10cf8339e9d392bd8043a26))
|
|
27
|
+
* add Claude Code setup alias ([caa0711](https://github.com/GonkaGate/gonkagate-claude-code/commit/caa07114025b305a36d9a3e92deb8e565d185b15))
|
|
28
|
+
|
|
20
29
|
## [0.1.3](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.2...v0.1.3) (2026-03-31)
|
|
21
30
|
|
|
22
31
|
|
package/README.md
CHANGED
|
@@ -14,6 +14,18 @@ It does not install `Claude Code` itself. It configures an existing local Claude
|
|
|
14
14
|
npx @gonkagate/claude-code
|
|
15
15
|
```
|
|
16
16
|
|
|
17
|
+
Setup-style alias for consistency with the other GonkaGate agent installers:
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
npx @gonkagate/claude-code-setup
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
## See It In Action
|
|
24
|
+
|
|
25
|
+
From API key to a working Claude Code setup in one short walkthrough:
|
|
26
|
+
|
|
27
|
+
[](https://raw.githubusercontent.com/GonkaGate/gonkagate-claude-code/main/.github/assets/gonkagate-claude-code-demo.mp4)
|
|
28
|
+
|
|
17
29
|
Need an API key first? [Create one on GonkaGate](https://gonkagate.com/en).
|
|
18
30
|
|
|
19
31
|
You will be asked for:
|
package/dist/cli.d.ts
CHANGED
|
@@ -11,7 +11,7 @@ interface ProgramOutput {
|
|
|
11
11
|
writeOut?: (str: string) => void;
|
|
12
12
|
writeErr?: (str: string) => void;
|
|
13
13
|
}
|
|
14
|
-
export declare function parseCliOptions(argv: string[], output?: ProgramOutput): CliOptions;
|
|
14
|
+
export declare function parseCliOptions(argv: string[], output?: ProgramOutput, commandName?: string): CliOptions;
|
|
15
15
|
export declare function resolveSettingsTarget(scope: InstallScope, cwd: string, chooseTrackedLocalSettingsAction?: (relativeTargetPath: string) => Promise<TrackedLocalSettingsAction>): Promise<SettingsTarget>;
|
|
16
|
-
export declare function run(argv?: string[]): Promise<void>;
|
|
16
|
+
export declare function run(argv?: string[], commandName?: string): Promise<void>;
|
|
17
17
|
export {};
|
package/dist/cli.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import process from "node:process";
|
|
2
|
+
import { basename } from "node:path";
|
|
2
3
|
import { pathToFileURL } from "node:url";
|
|
3
4
|
import { Command, CommanderError, Option } from "commander";
|
|
4
5
|
import { DEFAULT_MODEL_KEY, SUPPORTED_MODELS, SUPPORTED_MODEL_KEYS, requireSupportedModel } from "./constants/models.js";
|
|
@@ -10,18 +11,19 @@ import { promptForApiKey, promptForModel, promptForScope, promptForTrackedLocalS
|
|
|
10
11
|
import { getSettingsTarget } from "./install/settings-paths.js";
|
|
11
12
|
import { validateApiKey } from "./install/validate-api-key.js";
|
|
12
13
|
import { writeSettings } from "./install/write-settings.js";
|
|
14
|
+
const DEFAULT_COMMAND_NAME = "gonkagate-claude-code";
|
|
13
15
|
function rejectApiKeyArgs(argv) {
|
|
14
16
|
if (argv.some((arg) => arg === "--api-key" || arg.startsWith("--api-key="))) {
|
|
15
17
|
throw new Error("Passing API keys via CLI arguments is intentionally unsupported. Run the installer interactively instead.");
|
|
16
18
|
}
|
|
17
19
|
}
|
|
18
|
-
function createProgram(output) {
|
|
20
|
+
function createProgram(output, commandName = DEFAULT_COMMAND_NAME) {
|
|
19
21
|
const supportedModelLines = SUPPORTED_MODELS.map((model) => {
|
|
20
22
|
const defaultSuffix = model.key === DEFAULT_MODEL_KEY ? " (default)" : "";
|
|
21
23
|
return ` ${model.key} ${model.displayName}${defaultSuffix}`;
|
|
22
24
|
}).join("\n");
|
|
23
25
|
const program = new Command()
|
|
24
|
-
.name(
|
|
26
|
+
.name(commandName)
|
|
25
27
|
.description("GonkaGate Claude Code installer")
|
|
26
28
|
.addOption(new Option("--model <model-key>", "Skip the model prompt with a curated supported model.").choices(SUPPORTED_MODEL_KEYS))
|
|
27
29
|
.addOption(new Option("--scope <scope>", "Skip the scope prompt. Choose user or local.").choices(["user", "local"]))
|
|
@@ -30,6 +32,7 @@ function createProgram(output) {
|
|
|
30
32
|
.addHelpText("after", `
|
|
31
33
|
Examples:
|
|
32
34
|
npx @gonkagate/claude-code
|
|
35
|
+
npx @gonkagate/claude-code-setup
|
|
33
36
|
npx @gonkagate/claude-code --model ${DEFAULT_MODEL_KEY}
|
|
34
37
|
npx @gonkagate/claude-code --scope local
|
|
35
38
|
|
|
@@ -42,10 +45,10 @@ ${supportedModelLines}
|
|
|
42
45
|
}
|
|
43
46
|
return program;
|
|
44
47
|
}
|
|
45
|
-
export function parseCliOptions(argv, output) {
|
|
48
|
+
export function parseCliOptions(argv, output, commandName = DEFAULT_COMMAND_NAME) {
|
|
46
49
|
rejectApiKeyArgs(argv);
|
|
47
|
-
const program = createProgram(output);
|
|
48
|
-
program.parse(["node",
|
|
50
|
+
const program = createProgram(output, commandName);
|
|
51
|
+
program.parse(["node", commandName, ...argv]);
|
|
49
52
|
const options = program.opts();
|
|
50
53
|
return {
|
|
51
54
|
help: false,
|
|
@@ -54,6 +57,12 @@ export function parseCliOptions(argv, output) {
|
|
|
54
57
|
modelKey: options.model
|
|
55
58
|
};
|
|
56
59
|
}
|
|
60
|
+
function getCommandNameFromArgv() {
|
|
61
|
+
const commandName = process.argv[1] === undefined
|
|
62
|
+
? DEFAULT_COMMAND_NAME
|
|
63
|
+
: basename(process.argv[1]).replace(/\.(?:js|ts)$/, "");
|
|
64
|
+
return commandName === "cli" ? DEFAULT_COMMAND_NAME : commandName;
|
|
65
|
+
}
|
|
57
66
|
function printIntro() {
|
|
58
67
|
console.log("Connect Claude Code to GonkaGate in one step.\n");
|
|
59
68
|
console.log("This installer writes Claude Code settings for GonkaGate's public gateway.");
|
|
@@ -103,8 +112,8 @@ export async function resolveSettingsTarget(scope, cwd, chooseTrackedLocalSettin
|
|
|
103
112
|
return target;
|
|
104
113
|
}
|
|
105
114
|
}
|
|
106
|
-
export async function run(argv = process.argv.slice(2)) {
|
|
107
|
-
const options = parseCliOptions(argv);
|
|
115
|
+
export async function run(argv = process.argv.slice(2), commandName = getCommandNameFromArgv()) {
|
|
116
|
+
const options = parseCliOptions(argv, undefined, commandName);
|
|
108
117
|
printIntro();
|
|
109
118
|
const apiKey = validateApiKey(await promptForApiKey());
|
|
110
119
|
const selectedModel = options.modelKey
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":"AAAA,OAAO,OA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I,CAAC,CAAC,CAAC,KAAK,SAAS,IAAI,MAAM,CAAC,IAAI,CAAC,GAAG,KAAK,aAAa,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;AAE9G,IAAI,YAAY,EAAE,CAAC;IACjB,GAAG,EAAE,CAAC,KAAK,CAAC,cAAc,CAAC,CAAC;AAC9B,CAAC"}
|
package/docs/how-it-works.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
`gonkagate-claude-code` is a small Node-based installer for local `Claude Code`.
|
|
4
4
|
|
|
5
|
+
The primary package remains `@gonkagate/claude-code`. The setup-style alias package `@gonkagate/claude-code-setup` runs the same installer for consistency with the other GonkaGate agent setup packages.
|
|
6
|
+
|
|
5
7
|
## Fixed product contract
|
|
6
8
|
|
|
7
9
|
These values are intentionally fixed by the installer:
|
package/docs/security.md
CHANGED
|
@@ -8,6 +8,8 @@ The recommended install flow is interactive:
|
|
|
8
8
|
npx @gonkagate/claude-code
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
+
The setup-style alias `npx @gonkagate/claude-code-setup` runs the same interactive installer.
|
|
12
|
+
|
|
11
13
|
The installer asks for the API key through a hidden prompt. It intentionally rejects `--api-key ...` arguments so secrets do not end up in shell history or process lists.
|
|
12
14
|
|
|
13
15
|
## Where the key is stored
|
package/docs/troubleshooting.md
CHANGED
|
@@ -39,6 +39,12 @@ You can also skip the interactive model prompt with:
|
|
|
39
39
|
npx @gonkagate/claude-code --model <model-key>
|
|
40
40
|
```
|
|
41
41
|
|
|
42
|
+
The setup-style alias accepts the same options:
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npx @gonkagate/claude-code-setup --model <model-key>
|
|
46
|
+
```
|
|
47
|
+
|
|
42
48
|
Only current curated keys are accepted.
|
|
43
49
|
|
|
44
50
|
## Corrupted settings file
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gonkagate/claude-code",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.2.0",
|
|
4
4
|
"description": "CLI installer for using Claude Code with GonkaGate on Gonka Network.",
|
|
5
5
|
"homepage": "https://github.com/GonkaGate/gonkagate-claude-code#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
},
|
|
13
13
|
"type": "module",
|
|
14
14
|
"bin": {
|
|
15
|
+
"claude-code-setup": "bin/gonkagate-claude-code.js",
|
|
15
16
|
"gonkagate-claude-code": "bin/gonkagate-claude-code.js"
|
|
16
17
|
},
|
|
17
18
|
"files": [
|
|
@@ -27,6 +28,7 @@
|
|
|
27
28
|
"build": "tsc -p tsconfig.json",
|
|
28
29
|
"dev": "tsx src/cli.ts",
|
|
29
30
|
"prepack": "npm run build",
|
|
31
|
+
"publish:alias": "node scripts/publish-alias-package.mjs",
|
|
30
32
|
"test": "node scripts/run-tests.mjs",
|
|
31
33
|
"ci": "npm test && npm run build"
|
|
32
34
|
},
|
|
@@ -42,7 +44,9 @@
|
|
|
42
44
|
"gonka-api",
|
|
43
45
|
"gonka gateway",
|
|
44
46
|
"claude-code",
|
|
45
|
-
"claude code"
|
|
47
|
+
"claude code",
|
|
48
|
+
"claude-code-setup",
|
|
49
|
+
"setup"
|
|
46
50
|
],
|
|
47
51
|
"license": "Apache-2.0",
|
|
48
52
|
"packageManager": "npm@11.11.1",
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { constants as fsConstants } from "node:fs";
|
|
3
|
+
import { access, cp, mkdir, mkdtemp, readFile, rm, writeFile } from "node:fs/promises";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { dirname, join, resolve } from "node:path";
|
|
6
|
+
import { fileURLToPath } from "node:url";
|
|
7
|
+
|
|
8
|
+
const ALIAS_PACKAGE_NAME = "@gonkagate/claude-code-setup";
|
|
9
|
+
const ALIAS_BIN_NAME = "claude-code-setup";
|
|
10
|
+
const dryRun = process.argv.includes("--dry-run");
|
|
11
|
+
|
|
12
|
+
const scriptDir = dirname(fileURLToPath(import.meta.url));
|
|
13
|
+
const repoRoot = resolve(scriptDir, "..");
|
|
14
|
+
|
|
15
|
+
function run(command, args, options = {}) {
|
|
16
|
+
const result = spawnSync(command, args, {
|
|
17
|
+
cwd: repoRoot,
|
|
18
|
+
stdio: "inherit",
|
|
19
|
+
...options
|
|
20
|
+
});
|
|
21
|
+
|
|
22
|
+
if (result.error) {
|
|
23
|
+
throw result.error;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
if (result.status !== 0) {
|
|
27
|
+
process.exit(result.status ?? 1);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
function isPublished(packageName, version) {
|
|
32
|
+
const result = spawnSync("npm", ["view", `${packageName}@${version}`, "version"], {
|
|
33
|
+
cwd: repoRoot,
|
|
34
|
+
encoding: "utf8",
|
|
35
|
+
stdio: ["ignore", "pipe", "pipe"]
|
|
36
|
+
});
|
|
37
|
+
|
|
38
|
+
if (result.status === 0) {
|
|
39
|
+
return true;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const output = `${result.stdout}\n${result.stderr}`;
|
|
43
|
+
if (output.includes("E404") || output.includes("404 Not Found")) {
|
|
44
|
+
return false;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
process.stdout.write(result.stdout);
|
|
48
|
+
process.stderr.write(result.stderr);
|
|
49
|
+
process.exit(result.status ?? 1);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
async function assertExists(path) {
|
|
53
|
+
await access(path, fsConstants.R_OK);
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
const rootPackage = JSON.parse(await readFile(join(repoRoot, "package.json"), "utf8"));
|
|
57
|
+
const packageVersion = rootPackage.version;
|
|
58
|
+
|
|
59
|
+
if (!dryRun && isPublished(ALIAS_PACKAGE_NAME, packageVersion)) {
|
|
60
|
+
console.log(`${ALIAS_PACKAGE_NAME}@${packageVersion} is already published; skipping alias publish.`);
|
|
61
|
+
process.exit(0);
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
for (const path of ["bin", "dist", "docs", "README.md", "CHANGELOG.md", "LICENSE"]) {
|
|
65
|
+
await assertExists(join(repoRoot, path));
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
const tempRoot = await mkdtemp(join(tmpdir(), "gonkagate-claude-code-setup-"));
|
|
69
|
+
const packageRoot = join(tempRoot, "package");
|
|
70
|
+
|
|
71
|
+
try {
|
|
72
|
+
await mkdir(packageRoot, { recursive: true });
|
|
73
|
+
|
|
74
|
+
for (const path of ["bin", "dist", "docs", "README.md", "CHANGELOG.md", "LICENSE"]) {
|
|
75
|
+
await cp(join(repoRoot, path), join(packageRoot, path), { recursive: true });
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
const aliasPackage = {
|
|
79
|
+
name: ALIAS_PACKAGE_NAME,
|
|
80
|
+
version: packageVersion,
|
|
81
|
+
description: "Setup-style alias for the GonkaGate Claude Code installer.",
|
|
82
|
+
homepage: rootPackage.homepage,
|
|
83
|
+
bugs: rootPackage.bugs,
|
|
84
|
+
repository: rootPackage.repository,
|
|
85
|
+
type: rootPackage.type,
|
|
86
|
+
bin: {
|
|
87
|
+
[ALIAS_BIN_NAME]: "bin/gonkagate-claude-code.js"
|
|
88
|
+
},
|
|
89
|
+
files: ["bin", "dist", "docs", "README.md", "CHANGELOG.md", "LICENSE"],
|
|
90
|
+
engines: rootPackage.engines,
|
|
91
|
+
keywords: Array.from(new Set([...rootPackage.keywords, ALIAS_BIN_NAME, "setup"])),
|
|
92
|
+
license: rootPackage.license,
|
|
93
|
+
dependencies: rootPackage.dependencies
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
await writeFile(join(packageRoot, "package.json"), `${JSON.stringify(aliasPackage, null, 2)}\n`, "utf8");
|
|
97
|
+
|
|
98
|
+
const publishArgs = ["publish", "--access", "public"];
|
|
99
|
+
if (dryRun) {
|
|
100
|
+
publishArgs.push("--dry-run");
|
|
101
|
+
} else {
|
|
102
|
+
publishArgs.push("--provenance");
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
run("npm", publishArgs, { cwd: packageRoot });
|
|
106
|
+
} finally {
|
|
107
|
+
await rm(tempRoot, { recursive: true, force: true });
|
|
108
|
+
}
|