@gonkagate/claude-code-setup 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 +61 -0
- package/LICENSE +201 -0
- package/README.md +120 -0
- package/bin/gonkagate-claude-code.js +15 -0
- package/dist/cli.d.ts +17 -0
- package/dist/cli.js +143 -0
- package/dist/cli.js.map +1 -0
- package/dist/constants/gateway.d.ts +2 -0
- package/dist/constants/gateway.js +3 -0
- package/dist/constants/gateway.js.map +1 -0
- package/dist/constants/models.d.ts +27 -0
- package/dist/constants/models.js +28 -0
- package/dist/constants/models.js.map +1 -0
- package/dist/install/backup.d.ts +1 -0
- package/dist/install/backup.js +11 -0
- package/dist/install/backup.js.map +1 -0
- package/dist/install/load-settings.d.ts +6 -0
- package/dist/install/load-settings.js +32 -0
- package/dist/install/load-settings.js.map +1 -0
- package/dist/install/local-git-ignore.d.ts +7 -0
- package/dist/install/local-git-ignore.js +194 -0
- package/dist/install/local-git-ignore.js.map +1 -0
- package/dist/install/merge-env.d.ts +4 -0
- package/dist/install/merge-env.js +35 -0
- package/dist/install/merge-env.js.map +1 -0
- package/dist/install/object-utils.d.ts +1 -0
- package/dist/install/object-utils.js +4 -0
- package/dist/install/object-utils.js.map +1 -0
- package/dist/install/prompts.d.ts +28 -0
- package/dist/install/prompts.js +111 -0
- package/dist/install/prompts.js.map +1 -0
- package/dist/install/settings-paths.d.ts +2 -0
- package/dist/install/settings-paths.js +15 -0
- package/dist/install/settings-paths.js.map +1 -0
- package/dist/install/validate-api-key.d.ts +1 -0
- package/dist/install/validate-api-key.js +15 -0
- package/dist/install/validate-api-key.js.map +1 -0
- package/dist/install/write-settings.d.ts +2 -0
- package/dist/install/write-settings.js +25 -0
- package/dist/install/write-settings.js.map +1 -0
- package/dist/types/settings.d.ts +10 -0
- package/dist/types/settings.js +2 -0
- package/dist/types/settings.js.map +1 -0
- package/docs/how-it-works.md +50 -0
- package/docs/security.md +38 -0
- package/docs/show-and-tell-discussion.md +80 -0
- package/docs/troubleshooting.md +106 -0
- package/package.json +47 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## Unreleased
|
|
4
|
+
|
|
5
|
+
- Made local alias package bootstrap publish without npm provenance because provenance requires a supported CI/OIDC provider.
|
|
6
|
+
- Made alias package publishing skip cleanly until `@gonkagate/claude-code-setup` is bootstrapped on npm, with an explicit override for the first package publish.
|
|
7
|
+
- Added `@gonkagate/claude-code-setup` as a setup-style alias for the existing Claude Code installer.
|
|
8
|
+
- Improved npm package metadata and README copy for better package-page clarity, discovery, and onboarding.
|
|
9
|
+
- Added a curated model registry and model picker to the public installer flow.
|
|
10
|
+
- Added `--model <model-key>` and `--model=<model-key>` support for curated non-secret model selection.
|
|
11
|
+
- Kept the public Claude Code contract tight by limiting model selection to the curated GonkaGate registry only.
|
|
12
|
+
- Updated docs and tests for model selection while preserving local git ignore protection and owner-only settings file permissions.
|
|
13
|
+
- Hardened local scope against symlinked `.claude` paths that could redirect secret writes outside the ignored settings path.
|
|
14
|
+
- Extended local git protection to ignore timestamped backup files for `.claude/settings.local.json`.
|
|
15
|
+
- Normalized backup permissions to owner-only mode so secret-bearing backups are not left world-readable.
|
|
16
|
+
- Hardened local scope so `.claude/settings.local.json` cannot keep tracking secrets in git before local setup proceeds.
|
|
17
|
+
- Replaced the tracked-local-settings hard stop with a recovery flow that can stop tracking the file or switch to user scope without rerunning setup.
|
|
18
|
+
- Hardened local scope against symlinked path components anywhere between the repo root and the target settings file.
|
|
19
|
+
- Pinned GitHub Actions workflows to immutable commit SHAs for release pipeline hardening.
|
|
20
|
+
- Restored automated npm publish dispatch after Release Please creates a new release tag.
|
|
21
|
+
- Made publish reruns skip versions that are already present on npm instead of failing with a duplicate-version error.
|
|
22
|
+
|
|
23
|
+
## [0.2.0](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.3...v0.2.0) (2026-04-13)
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
### Features
|
|
27
|
+
|
|
28
|
+
* add Claude Code setup alias ([3d411f5](https://github.com/GonkaGate/gonkagate-claude-code/commit/3d411f5c0cbafd84d10cf8339e9d392bd8043a26))
|
|
29
|
+
* add Claude Code setup alias ([caa0711](https://github.com/GonkaGate/gonkagate-claude-code/commit/caa07114025b305a36d9a3e92deb8e565d185b15))
|
|
30
|
+
|
|
31
|
+
## [0.1.3](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.2...v0.1.3) (2026-03-31)
|
|
32
|
+
|
|
33
|
+
|
|
34
|
+
### Bug Fixes
|
|
35
|
+
|
|
36
|
+
* document release-please title requirements ([5fce744](https://github.com/GonkaGate/gonkagate-claude-code/commit/5fce7441dfd0c79d6f6ab43b4fa20737df879516))
|
|
37
|
+
* document release-please title requirements ([145f9f7](https://github.com/GonkaGate/gonkagate-claude-code/commit/145f9f72da19cf31f8f73e8250047988ee1eb9bf))
|
|
38
|
+
|
|
39
|
+
## [0.1.2](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.1...v0.1.2) (2026-03-31)
|
|
40
|
+
|
|
41
|
+
|
|
42
|
+
### Bug Fixes
|
|
43
|
+
|
|
44
|
+
* restore automated npm publishes ([42bde87](https://github.com/GonkaGate/gonkagate-claude-code/commit/42bde8795e264c8950017aa5acff0475b4fb0c8e))
|
|
45
|
+
* restore automated npm publishes ([52fcd8e](https://github.com/GonkaGate/gonkagate-claude-code/commit/52fcd8e428ccae967871aba800344dd786a048ce))
|
|
46
|
+
|
|
47
|
+
## [0.1.1](https://github.com/GonkaGate/gonkagate-claude-code/compare/v0.1.0...v0.1.1) (2026-03-31)
|
|
48
|
+
|
|
49
|
+
|
|
50
|
+
### Bug Fixes
|
|
51
|
+
|
|
52
|
+
* stop duplicate npm publishes ([1ac876a](https://github.com/GonkaGate/gonkagate-claude-code/commit/1ac876a4fb1c99bd1a1cc892e38ee2c7df3be799))
|
|
53
|
+
* stop duplicate npm publishes ([58d022f](https://github.com/GonkaGate/gonkagate-claude-code/commit/58d022ff2486fa6156badc791cb236f580b68a9c))
|
|
54
|
+
|
|
55
|
+
## 0.1.0
|
|
56
|
+
|
|
57
|
+
- Initial public onboarding repo for connecting local Claude Code to GonkaGate.
|
|
58
|
+
- Added interactive Node CLI installer with hidden API key prompt.
|
|
59
|
+
- Added user and local Claude Code settings install scopes.
|
|
60
|
+
- Added JSON merge, backup, and validation behavior for Claude Code settings.
|
|
61
|
+
- Added public README plus troubleshooting, security, and how-it-works docs.
|
package/LICENSE
ADDED
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright [yyyy] [name of copyright owner]
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
package/README.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# @gonkagate/claude-code
|
|
2
|
+
|
|
3
|
+
Set up Claude Code to use GonkaGate in one `npx` command.
|
|
4
|
+
|
|
5
|
+
This CLI installer is for developers who already have local `Claude Code` and want to use it with GonkaGate, the gateway to Gonka Network, without editing shell profiles, exporting long env var blocks, or writing `.env` files by hand.
|
|
6
|
+
|
|
7
|
+
Under the hood it configures Claude Code to use GonkaGate's Anthropic-compatible endpoint at `https://api.gonkagate.com`.
|
|
8
|
+
|
|
9
|
+
It does not install `Claude Code` itself. It configures an existing local Claude Code install.
|
|
10
|
+
|
|
11
|
+
## Quick Start
|
|
12
|
+
|
|
13
|
+
```bash
|
|
14
|
+
npx @gonkagate/claude-code
|
|
15
|
+
```
|
|
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
|
+
|
|
29
|
+
Need an API key first? [Create one on GonkaGate](https://gonkagate.com/en).
|
|
30
|
+
|
|
31
|
+
You will be asked for:
|
|
32
|
+
|
|
33
|
+
- your GonkaGate API key (`gp-...`) in a hidden interactive prompt
|
|
34
|
+
- a model from the supported GonkaGate list
|
|
35
|
+
- setup scope: `user` or `local`
|
|
36
|
+
|
|
37
|
+
If you choose `local` scope and `.claude/settings.local.json` is already tracked by git, the installer offers to stop tracking that file and continue, or switch to `user` scope instead.
|
|
38
|
+
|
|
39
|
+
You need:
|
|
40
|
+
|
|
41
|
+
- local `Claude Code`
|
|
42
|
+
- Node.js 18+
|
|
43
|
+
- a GonkaGate API key
|
|
44
|
+
|
|
45
|
+
## Supported Model
|
|
46
|
+
|
|
47
|
+
Current public Claude Code model in the curated registry:
|
|
48
|
+
|
|
49
|
+
- `qwen3-235b` -> `qwen/qwen3-235b-a22b-instruct-2507-fp8`
|
|
50
|
+
|
|
51
|
+
## What It Does
|
|
52
|
+
|
|
53
|
+
The tool writes Claude Code settings so you can keep running `claude` normally afterward.
|
|
54
|
+
|
|
55
|
+
By default it writes to:
|
|
56
|
+
|
|
57
|
+
- `~/.claude/settings.json`
|
|
58
|
+
|
|
59
|
+
If you choose local scope, it writes to:
|
|
60
|
+
|
|
61
|
+
- `.claude/settings.local.json`
|
|
62
|
+
|
|
63
|
+
It also:
|
|
64
|
+
|
|
65
|
+
- preserves unrelated Claude Code settings
|
|
66
|
+
- creates a backup before overwriting an existing settings file
|
|
67
|
+
- writes settings files with owner-only permissions
|
|
68
|
+
- writes backup files with owner-only permissions
|
|
69
|
+
- adds `.claude/settings.local.json` and local backup files to `.git/info/exclude` for local setup inside a git repo
|
|
70
|
+
- offers to stop tracking `.claude/settings.local.json` before local setup writes secrets into a file that was already tracked by git
|
|
71
|
+
- refuses local setup if the target path traverses a symlinked path component, or if `.claude` / the local settings file is a symlink
|
|
72
|
+
|
|
73
|
+
## Fixed GonkaGate Setup
|
|
74
|
+
|
|
75
|
+
These parts are intentionally fixed:
|
|
76
|
+
|
|
77
|
+
- Base URL: `https://api.gonkagate.com`
|
|
78
|
+
- Auth variable: `ANTHROPIC_AUTH_TOKEN`
|
|
79
|
+
- Model choice: only from the curated supported list
|
|
80
|
+
|
|
81
|
+
This tool does not ask for a custom base URL and does not accept arbitrary custom model IDs.
|
|
82
|
+
|
|
83
|
+
The selected model is written into all Claude Code model env vars used by this setup flow.
|
|
84
|
+
|
|
85
|
+
## Verify
|
|
86
|
+
|
|
87
|
+
After setup:
|
|
88
|
+
|
|
89
|
+
1. If Claude Code was previously logged directly into Anthropic, run `claude auth logout`
|
|
90
|
+
2. Start Claude Code normally with `claude`
|
|
91
|
+
3. Run `/status`
|
|
92
|
+
4. Confirm the active gateway is `https://api.gonkagate.com`
|
|
93
|
+
|
|
94
|
+
## What This Tool Does Not Do
|
|
95
|
+
|
|
96
|
+
- It does not configure `claude.ai`
|
|
97
|
+
- It does not install `Claude Code` itself
|
|
98
|
+
- It does not edit `.zshrc`, `.bashrc`, PowerShell profiles, or other shell startup files
|
|
99
|
+
- It does not write `.env` files
|
|
100
|
+
- It does not support arbitrary custom model IDs
|
|
101
|
+
- It does not support custom base URL overrides
|
|
102
|
+
|
|
103
|
+
## Need Help?
|
|
104
|
+
|
|
105
|
+
- Troubleshooting: [docs/troubleshooting.md](https://github.com/GonkaGate/gonkagate-claude-code/blob/main/docs/troubleshooting.md)
|
|
106
|
+
- Security notes: [docs/security.md](https://github.com/GonkaGate/gonkagate-claude-code/blob/main/docs/security.md)
|
|
107
|
+
- Internal behavior: [docs/how-it-works.md](https://github.com/GonkaGate/gonkagate-claude-code/blob/main/docs/how-it-works.md)
|
|
108
|
+
|
|
109
|
+
## Development
|
|
110
|
+
|
|
111
|
+
```bash
|
|
112
|
+
npm install
|
|
113
|
+
npm run dev
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
Useful commands:
|
|
117
|
+
|
|
118
|
+
- `npm run build`
|
|
119
|
+
- `npm test`
|
|
120
|
+
- `npm run ci`
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
import { CommanderError } from "commander";
|
|
4
|
+
import { run } from "../dist/cli.js";
|
|
5
|
+
|
|
6
|
+
run().catch((error) => {
|
|
7
|
+
if (error instanceof CommanderError) {
|
|
8
|
+
process.exitCode = error.exitCode;
|
|
9
|
+
return;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
13
|
+
console.error(`\nError: ${message}`);
|
|
14
|
+
process.exitCode = 1;
|
|
15
|
+
});
|
package/dist/cli.d.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import type { InstallScope, SettingsTarget } from "./types/settings.js";
|
|
2
|
+
import type { SupportedModelKey } from "./constants/models.js";
|
|
3
|
+
import type { TrackedLocalSettingsAction } from "./install/prompts.js";
|
|
4
|
+
interface CliOptions {
|
|
5
|
+
help: boolean;
|
|
6
|
+
version: boolean;
|
|
7
|
+
scope?: InstallScope;
|
|
8
|
+
modelKey?: SupportedModelKey;
|
|
9
|
+
}
|
|
10
|
+
interface ProgramOutput {
|
|
11
|
+
writeOut?: (str: string) => void;
|
|
12
|
+
writeErr?: (str: string) => void;
|
|
13
|
+
}
|
|
14
|
+
export declare function parseCliOptions(argv: string[], output?: ProgramOutput, commandName?: string): CliOptions;
|
|
15
|
+
export declare function resolveSettingsTarget(scope: InstallScope, cwd: string, chooseTrackedLocalSettingsAction?: (relativeTargetPath: string) => Promise<TrackedLocalSettingsAction>): Promise<SettingsTarget>;
|
|
16
|
+
export declare function run(argv?: string[], commandName?: string): Promise<void>;
|
|
17
|
+
export {};
|
package/dist/cli.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import process from "node:process";
|
|
2
|
+
import { basename } from "node:path";
|
|
3
|
+
import { pathToFileURL } from "node:url";
|
|
4
|
+
import { Command, CommanderError, Option } from "commander";
|
|
5
|
+
import { DEFAULT_MODEL_KEY, SUPPORTED_MODELS, SUPPORTED_MODEL_KEYS, requireSupportedModel } from "./constants/models.js";
|
|
6
|
+
import { createBackup } from "./install/backup.js";
|
|
7
|
+
import { loadSettings } from "./install/load-settings.js";
|
|
8
|
+
import { ensureLocalSettingsIgnored, stopTrackingLocalSettings, TrackedLocalSettingsError } from "./install/local-git-ignore.js";
|
|
9
|
+
import { mergeSettingsWithGonkaEnv } from "./install/merge-env.js";
|
|
10
|
+
import { promptForApiKey, promptForModel, promptForScope, promptForTrackedLocalSettingsAction } from "./install/prompts.js";
|
|
11
|
+
import { getSettingsTarget } from "./install/settings-paths.js";
|
|
12
|
+
import { validateApiKey } from "./install/validate-api-key.js";
|
|
13
|
+
import { writeSettings } from "./install/write-settings.js";
|
|
14
|
+
const DEFAULT_COMMAND_NAME = "gonkagate-claude-code";
|
|
15
|
+
function rejectApiKeyArgs(argv) {
|
|
16
|
+
if (argv.some((arg) => arg === "--api-key" || arg.startsWith("--api-key="))) {
|
|
17
|
+
throw new Error("Passing API keys via CLI arguments is intentionally unsupported. Run the installer interactively instead.");
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
function createProgram(output, commandName = DEFAULT_COMMAND_NAME) {
|
|
21
|
+
const supportedModelLines = SUPPORTED_MODELS.map((model) => {
|
|
22
|
+
const defaultSuffix = model.key === DEFAULT_MODEL_KEY ? " (default)" : "";
|
|
23
|
+
return ` ${model.key} ${model.displayName}${defaultSuffix}`;
|
|
24
|
+
}).join("\n");
|
|
25
|
+
const program = new Command()
|
|
26
|
+
.name(commandName)
|
|
27
|
+
.description("GonkaGate Claude Code installer")
|
|
28
|
+
.addOption(new Option("--model <model-key>", "Skip the model prompt with a curated supported model.").choices(SUPPORTED_MODEL_KEYS))
|
|
29
|
+
.addOption(new Option("--scope <scope>", "Skip the scope prompt. Choose user or local.").choices(["user", "local"]))
|
|
30
|
+
.helpOption("-h, --help", "Show this help.")
|
|
31
|
+
.version("0.1.0", "-v, --version", "Show the package version.")
|
|
32
|
+
.addHelpText("after", `
|
|
33
|
+
Examples:
|
|
34
|
+
npx @gonkagate/claude-code
|
|
35
|
+
npx @gonkagate/claude-code-setup
|
|
36
|
+
npx @gonkagate/claude-code --model ${DEFAULT_MODEL_KEY}
|
|
37
|
+
npx @gonkagate/claude-code --scope local
|
|
38
|
+
|
|
39
|
+
Supported model keys:
|
|
40
|
+
${supportedModelLines}
|
|
41
|
+
`)
|
|
42
|
+
.exitOverride();
|
|
43
|
+
if (output) {
|
|
44
|
+
program.configureOutput(output);
|
|
45
|
+
}
|
|
46
|
+
return program;
|
|
47
|
+
}
|
|
48
|
+
export function parseCliOptions(argv, output, commandName = DEFAULT_COMMAND_NAME) {
|
|
49
|
+
rejectApiKeyArgs(argv);
|
|
50
|
+
const program = createProgram(output, commandName);
|
|
51
|
+
program.parse(["node", commandName, ...argv]);
|
|
52
|
+
const options = program.opts();
|
|
53
|
+
return {
|
|
54
|
+
help: false,
|
|
55
|
+
version: false,
|
|
56
|
+
scope: options.scope,
|
|
57
|
+
modelKey: options.model
|
|
58
|
+
};
|
|
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
|
+
}
|
|
66
|
+
function printIntro() {
|
|
67
|
+
console.log("Connect Claude Code to GonkaGate in one step.\n");
|
|
68
|
+
console.log("This installer writes Claude Code settings for GonkaGate's public gateway.");
|
|
69
|
+
console.log("Base URL is fixed to https://api.gonkagate.com and is not configurable.");
|
|
70
|
+
console.log(`Model choice is limited to the curated GonkaGate-supported list: ${SUPPORTED_MODEL_KEYS.join(", ")}.\n`);
|
|
71
|
+
}
|
|
72
|
+
function printSuccess(targetPath, scope, selectedModel, backupPath) {
|
|
73
|
+
console.log("\nInstall complete.\n");
|
|
74
|
+
console.log(`Updated: ${targetPath}`);
|
|
75
|
+
console.log(`Model: ${selectedModel.displayName} (${selectedModel.modelId})`);
|
|
76
|
+
if (backupPath) {
|
|
77
|
+
console.log(`Backup: ${backupPath}`);
|
|
78
|
+
}
|
|
79
|
+
console.log("\nNext steps:");
|
|
80
|
+
console.log("1. If Claude Code still shows direct Anthropic auth, run: claude auth logout");
|
|
81
|
+
console.log("2. Start Claude Code normally: claude");
|
|
82
|
+
console.log("3. In Claude Code, run: /status");
|
|
83
|
+
console.log("4. Confirm the active gateway is https://api.gonkagate.com");
|
|
84
|
+
if (scope === "local") {
|
|
85
|
+
console.log("\nLocal scope reminder:");
|
|
86
|
+
console.log("Keep .claude/settings.local.json uncommitted.");
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
export async function resolveSettingsTarget(scope, cwd, chooseTrackedLocalSettingsAction = promptForTrackedLocalSettingsAction) {
|
|
90
|
+
const target = getSettingsTarget(scope, cwd);
|
|
91
|
+
if (scope !== "local") {
|
|
92
|
+
return target;
|
|
93
|
+
}
|
|
94
|
+
try {
|
|
95
|
+
await ensureLocalSettingsIgnored(target.path);
|
|
96
|
+
return target;
|
|
97
|
+
}
|
|
98
|
+
catch (error) {
|
|
99
|
+
if (!(error instanceof TrackedLocalSettingsError)) {
|
|
100
|
+
throw error;
|
|
101
|
+
}
|
|
102
|
+
const action = await chooseTrackedLocalSettingsAction(error.relativeTargetPath);
|
|
103
|
+
if (action === "user") {
|
|
104
|
+
console.log("\nSwitching to user scope so the repository stays unchanged.");
|
|
105
|
+
return getSettingsTarget("user", cwd);
|
|
106
|
+
}
|
|
107
|
+
if (action === "cancel") {
|
|
108
|
+
throw new Error("Installation cancelled.");
|
|
109
|
+
}
|
|
110
|
+
await stopTrackingLocalSettings(target.path);
|
|
111
|
+
console.log(`\nStopped tracking ${error.relativeTargetPath} in git and added a local exclude.`);
|
|
112
|
+
return target;
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
export async function run(argv = process.argv.slice(2), commandName = getCommandNameFromArgv()) {
|
|
116
|
+
const options = parseCliOptions(argv, undefined, commandName);
|
|
117
|
+
printIntro();
|
|
118
|
+
const apiKey = validateApiKey(await promptForApiKey());
|
|
119
|
+
const selectedModel = options.modelKey
|
|
120
|
+
? requireSupportedModel(options.modelKey)
|
|
121
|
+
: await promptForModel(SUPPORTED_MODELS, DEFAULT_MODEL_KEY);
|
|
122
|
+
const requestedScope = options.scope ?? (await promptForScope("user"));
|
|
123
|
+
const target = await resolveSettingsTarget(requestedScope, process.cwd());
|
|
124
|
+
const loaded = await loadSettings(target.path);
|
|
125
|
+
const mergedSettings = mergeSettingsWithGonkaEnv(loaded.settings, apiKey, selectedModel);
|
|
126
|
+
const backupPath = loaded.exists ? await createBackup(target.path) : undefined;
|
|
127
|
+
await writeSettings(target.path, mergedSettings);
|
|
128
|
+
printSuccess(target.path, target.scope, selectedModel, backupPath);
|
|
129
|
+
}
|
|
130
|
+
function handleCliError(error) {
|
|
131
|
+
if (error instanceof CommanderError) {
|
|
132
|
+
process.exitCode = error.exitCode;
|
|
133
|
+
return;
|
|
134
|
+
}
|
|
135
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
136
|
+
console.error(`\nError: ${message}`);
|
|
137
|
+
process.exitCode = 1;
|
|
138
|
+
}
|
|
139
|
+
const isEntrypoint = process.argv[1] !== undefined && import.meta.url === pathToFileURL(process.argv[1]).href;
|
|
140
|
+
if (isEntrypoint) {
|
|
141
|
+
run().catch(handleCliError);
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=cli.js.map
|
package/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AAC,CAAC;IACjD,YAAY,CAAC,MAAM,CAAC,IAAI,EAAE,MAAM,CAAC,KAAK,EAAE,aAAa,EAAE,UAAU,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,cAAc,CAAC,KAAc;IACpC,IAAI,KAAK,YAAY,cAAc,EAAE,CAAC;QACpC,OAAO,CAAC,QAAQ,GAAG,KAAK,CAAC,QAAQ,CAAC;QAClC,OAAO;IACT,CAAC;IAED,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IACvE,OAAO,CAAC,KAAK,CAAC,YAAY,OAAO,EAAE,CAAC,CAAC;IACrC,OAAO,CAAC,QAAQ,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,MAAM,YAAY,GAAG,OAAO,CAAC,IAAI,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"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gateway.js","sourceRoot":"","sources":["../../src/constants/gateway.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,kBAAkB,GAAG,2BAA2B,CAAC;AAC9D,MAAM,CAAC,MAAM,0BAA0B,GAAG,wDAAwD,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
export interface SupportedModelDefinition {
|
|
2
|
+
key: string;
|
|
3
|
+
displayName: string;
|
|
4
|
+
modelId: string;
|
|
5
|
+
description?: string;
|
|
6
|
+
isDefault?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export declare const SUPPORTED_MODELS: readonly [{
|
|
9
|
+
readonly key: "qwen3-235b";
|
|
10
|
+
readonly displayName: "Qwen 3 235B Instruct";
|
|
11
|
+
readonly modelId: "qwen/qwen3-235b-a22b-instruct-2507-fp8";
|
|
12
|
+
readonly description: "Current GonkaGate public Claude Code model.";
|
|
13
|
+
readonly isDefault: true;
|
|
14
|
+
}];
|
|
15
|
+
export type SupportedModel = (typeof SUPPORTED_MODELS)[number];
|
|
16
|
+
export type SupportedModelKey = SupportedModel["key"];
|
|
17
|
+
export declare const DEFAULT_MODEL: {
|
|
18
|
+
readonly key: "qwen3-235b";
|
|
19
|
+
readonly displayName: "Qwen 3 235B Instruct";
|
|
20
|
+
readonly modelId: "qwen/qwen3-235b-a22b-instruct-2507-fp8";
|
|
21
|
+
readonly description: "Current GonkaGate public Claude Code model.";
|
|
22
|
+
readonly isDefault: true;
|
|
23
|
+
};
|
|
24
|
+
export declare const DEFAULT_MODEL_KEY: SupportedModelKey;
|
|
25
|
+
export declare const SUPPORTED_MODEL_KEYS: "qwen3-235b"[];
|
|
26
|
+
export declare function getSupportedModelByKey(key: string): SupportedModel | undefined;
|
|
27
|
+
export declare function requireSupportedModel(key: string): SupportedModel;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
const curatedModelRegistry = [
|
|
2
|
+
{
|
|
3
|
+
key: "qwen3-235b",
|
|
4
|
+
displayName: "Qwen 3 235B Instruct",
|
|
5
|
+
modelId: "qwen/qwen3-235b-a22b-instruct-2507-fp8",
|
|
6
|
+
description: "Current GonkaGate public Claude Code model.",
|
|
7
|
+
isDefault: true
|
|
8
|
+
}
|
|
9
|
+
];
|
|
10
|
+
const defaultModels = curatedModelRegistry.filter((model) => model.isDefault);
|
|
11
|
+
if (defaultModels.length !== 1) {
|
|
12
|
+
throw new Error(`Expected exactly one default supported model, found ${defaultModels.length}.`);
|
|
13
|
+
}
|
|
14
|
+
export const SUPPORTED_MODELS = curatedModelRegistry;
|
|
15
|
+
export const DEFAULT_MODEL = defaultModels[0];
|
|
16
|
+
export const DEFAULT_MODEL_KEY = DEFAULT_MODEL.key;
|
|
17
|
+
export const SUPPORTED_MODEL_KEYS = SUPPORTED_MODELS.map((model) => model.key);
|
|
18
|
+
export function getSupportedModelByKey(key) {
|
|
19
|
+
return SUPPORTED_MODELS.find((model) => model.key === key);
|
|
20
|
+
}
|
|
21
|
+
export function requireSupportedModel(key) {
|
|
22
|
+
const model = getSupportedModelByKey(key);
|
|
23
|
+
if (!model) {
|
|
24
|
+
throw new Error(`Unsupported model key "${key}". Supported model keys: ${SUPPORTED_MODEL_KEYS.join(", ")}`);
|
|
25
|
+
}
|
|
26
|
+
return model;
|
|
27
|
+
}
|
|
28
|
+
//# sourceMappingURL=models.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"models.js","sourceRoot":"","sources":["../../src/constants/models.ts"],"names":[],"mappings":"AAQA,MAAM,oBAAoB,GAAG;IAC3B;QACE,GAAG,EAAE,YAAY;QACjB,WAAW,EAAE,sBAAsB;QACnC,OAAO,EAAE,wCAAwC;QACjD,WAAW,EAAE,6CAA6C;QAC1D,SAAS,EAAE,IAAI;KAChB;CACqD,CAAC;AAEzD,MAAM,aAAa,GAAG,oBAAoB,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;AAE9E,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;IAC/B,MAAM,IAAI,KAAK,CAAC,uDAAuD,aAAa,CAAC,MAAM,GAAG,CAAC,CAAC;AAClG,CAAC;AAED,MAAM,CAAC,MAAM,gBAAgB,GAAG,oBAAoB,CAAC;AAGrD,MAAM,CAAC,MAAM,aAAa,GAAG,aAAa,CAAC,CAAC,CAAC,CAAC;AAC9C,MAAM,CAAC,MAAM,iBAAiB,GAAsB,aAAa,CAAC,GAAG,CAAC;AACtE,MAAM,CAAC,MAAM,oBAAoB,GAAG,gBAAgB,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAA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