nexos-connect 0.0.0-stage → 0.5.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/LICENSE +21 -0
- package/README.md +168 -2
- package/dist/index.js +5791 -0
- package/dist/index.js.map +1 -0
- package/package.json +38 -4
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Nexos B.V.
|
|
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
CHANGED
|
@@ -1,3 +1,169 @@
|
|
|
1
|
-
|
|
1
|
+
<div align="center">
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
# nexos-connect
|
|
4
|
+
|
|
5
|
+
**Point every coding agent you use at the [nexos.ai Gateway](https://workspace.nexos.ai/gateway/api-keys).**<br>
|
|
6
|
+
One key, one model, one command.
|
|
7
|
+
|
|
8
|
+

|
|
9
|
+

|
|
10
|
+

|
|
11
|
+
|
|
12
|
+
[Quick start](#quick-start) · [Usage](#usage) · [Supported agents](#supported-agents) · [Undo](#undo) · [Development](#development)
|
|
13
|
+
|
|
14
|
+
</div>
|
|
15
|
+
|
|
16
|
+
---
|
|
17
|
+
|
|
18
|
+
Every coding agent keeps its own config file, in its own format, with its own key names.
|
|
19
|
+
**nexos-connect** finds the agents you have, shows exactly what it will change, backs up the
|
|
20
|
+
originals, writes the configs, and reports the result — with your key masked.
|
|
21
|
+
|
|
22
|
+
- 🔍 **Detects** which agents are installed, and configures only those
|
|
23
|
+
- 👀 **Shows the diff first** — `--dry-run` writes nothing at all
|
|
24
|
+
- 🧩 **Merges, never replaces** — your comments, settings and line endings stay
|
|
25
|
+
- ↩️ **Undoable** — originals are backed up, and `restore` puts back what it changed
|
|
26
|
+
- 🔒 **Never prints your key** — every line of output is masked
|
|
27
|
+
- 🤖 **Scriptable** — every question has a flag, so it runs unattended
|
|
28
|
+
|
|
29
|
+
## Quick start
|
|
30
|
+
|
|
31
|
+
You need Node.js 20.19 or later and a nexos.ai API key — [get one here](https://workspace.nexos.ai/gateway/api-keys).
|
|
32
|
+
|
|
33
|
+
```bash
|
|
34
|
+
npx nexos-connect
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Pick a scope, pick your agents, paste the key, choose a model. Before anything is written you see the
|
|
38
|
+
diff for every file:
|
|
39
|
+
|
|
40
|
+
```diff
|
|
41
|
+
~/.claude/settings.json
|
|
42
|
+
{
|
|
43
|
+
"theme": "dark",
|
|
44
|
+
- "enabledPlugins": {}
|
|
45
|
+
+ "enabledPlugins": {},
|
|
46
|
+
+ "env": {
|
|
47
|
+
+ "ANTHROPIC_BASE_URL": "https://api.nexos.ai",
|
|
48
|
+
+ "ANTHROPIC_AUTH_TOKEN": "nexos-0123…cdef",
|
|
49
|
+
+ …
|
|
50
|
+
+ },
|
|
51
|
+
+ "model": "<model-id>"
|
|
52
|
+
}
|
|
53
|
+
```
|
|
54
|
+
|
|
55
|
+
> [!IMPORTANT]
|
|
56
|
+
> OpenAI Codex and GitHub Copilot CLI read the key from the environment. Load it once setup is done,
|
|
57
|
+
> and add the same line to your shell profile to keep it:
|
|
58
|
+
>
|
|
59
|
+
> ```bash
|
|
60
|
+
> source ~/.nexos/env # macOS, Linux
|
|
61
|
+
> . "$HOME\.nexos\env.ps1" # Windows PowerShell
|
|
62
|
+
> ```
|
|
63
|
+
|
|
64
|
+
## Usage
|
|
65
|
+
|
|
66
|
+
| Command | What it does |
|
|
67
|
+
| ------------------------------ | --------------------------------------------------------------------------------------------------------- |
|
|
68
|
+
| `npx nexos-connect` | Set up your agents, interactively |
|
|
69
|
+
| `npx nexos-connect <agent>` | Start one agent on the gateway **without changing its config** — `claude`, `codex`, `opencode`, `copilot` |
|
|
70
|
+
| `npx nexos-connect restore` | Put back what nexos-connect changed |
|
|
71
|
+
| `npx nexos-connect forget-key` | Delete the key saved in your system keychain |
|
|
72
|
+
|
|
73
|
+
```bash
|
|
74
|
+
# Preview every change, write nothing
|
|
75
|
+
npx nexos-connect --dry-run
|
|
76
|
+
|
|
77
|
+
# Set up only this repository
|
|
78
|
+
npx nexos-connect --scope project
|
|
79
|
+
|
|
80
|
+
# No questions asked — for scripts
|
|
81
|
+
npx nexos-connect --harnesses claude-code,codex --key "$NEXOS_API_KEY" --yes
|
|
82
|
+
|
|
83
|
+
# Try Claude Code on the gateway, leaving its config alone
|
|
84
|
+
npx nexos-connect claude
|
|
85
|
+
|
|
86
|
+
# Anything after -- goes to the agent
|
|
87
|
+
npx nexos-connect codex -- exec "fix the tests"
|
|
88
|
+
```
|
|
89
|
+
|
|
90
|
+
The default model is the nexos.ai router, which picks a model per request. Before the picker opens,
|
|
91
|
+
nexos-connect checks that your key can use it, and offers the router only when that check passes. A
|
|
92
|
+
check that fails, or one you skip with `--no-verify`, leaves it out. After a failed check you choose
|
|
93
|
+
from the models your key can reach; with `--no-verify` you type a model id. A `--yes` run with no
|
|
94
|
+
`--model` exits `2` only when the gateway rejected the router; anything less certain warns and uses
|
|
95
|
+
it. Naming the router yourself always wins, with a warning only when the gateway rejected it, and
|
|
96
|
+
the router is never saved as an agent's default. Save any other model your key can reach as an
|
|
97
|
+
agent's default for next time.
|
|
98
|
+
|
|
99
|
+
<details>
|
|
100
|
+
<summary><b>All options</b></summary>
|
|
101
|
+
|
|
102
|
+
| Option | Effect |
|
|
103
|
+
| --------------------- | --------------------------------------------------------------------------------------------- |
|
|
104
|
+
| `--harnesses <ids>` | Agents to set up: `claude-code`, `codex`, `opencode`, `copilot-cli`, `pi`, `crush`, `qwen-code` |
|
|
105
|
+
| `--key <key>` | nexos.ai API key. Falls back to `$NEXOS_API_KEY`, then the saved key, then a prompt |
|
|
106
|
+
| `--save-key` | Save the key in your system keychain for future runs |
|
|
107
|
+
| `--model <id>` | Model every agent uses. Falls back to `$NEXOS_MODEL`, then the saved default, then a picker |
|
|
108
|
+
| `--save-model` | Save the model as each agent's default |
|
|
109
|
+
| `--scope <scope>` | `user` (default — your home directory) or `project` (this directory only) |
|
|
110
|
+
| `-y`, `--yes` | Answer every question with its default and write without asking |
|
|
111
|
+
| `--dry-run` | Show the diffs and write nothing |
|
|
112
|
+
| `--no-verify` | Skip the gateway checks — key, model list and router — e.g. when offline. Without a check, the router is not offered |
|
|
113
|
+
| `--backup-dir <path>` | Where originals are copied. Default `~/.nexos/backups/`, or `./.nexos-backup/` for a project |
|
|
114
|
+
|
|
115
|
+
Exit codes: `0` done · `1` an agent failed · `2` usage error · `130` cancelled.
|
|
116
|
+
Run `npx nexos-connect --help` for the full reference.
|
|
117
|
+
|
|
118
|
+
</details>
|
|
119
|
+
|
|
120
|
+
> [!TIP]
|
|
121
|
+
> `npm install -g nexos-connect` installs the `nexos-connect` command, and `nexos` as a short alias.
|
|
122
|
+
|
|
123
|
+
## Supported agents
|
|
124
|
+
|
|
125
|
+
| Agent | User scope | Project scope |
|
|
126
|
+
| ------------------ | ---------------------------------------------- | ------------------------------ |
|
|
127
|
+
| Claude Code | ✅ `~/.claude/settings.json` | ✅ `.claude/settings.local.json` |
|
|
128
|
+
| OpenCode | ✅ `~/.config/opencode/opencode.json` | ✅ `opencode.json` |
|
|
129
|
+
| Pi | ✅ `~/.pi/agent/models.json` | — |
|
|
130
|
+
| Crush | ✅ `~/.config/crush/crush.json` | ✅ `.crush.json` |
|
|
131
|
+
| Qwen Code | ✅ `~/.qwen/settings.json` | ✅ `.qwen/settings.json` |
|
|
132
|
+
| OpenAI Codex | ✅ `~/.codex/config.toml` + `~/.nexos/env` | — |
|
|
133
|
+
| GitHub Copilot CLI | ✅ `~/.nexos/env` | — |
|
|
134
|
+
| Gemini CLI | ❌ speaks a protocol the gateway does not serve | ❌ |
|
|
135
|
+
|
|
136
|
+
> [!WARNING]
|
|
137
|
+
> A project-scope config holds your API key **inside your repository**. Make sure the file is
|
|
138
|
+
> gitignored before you commit.
|
|
139
|
+
|
|
140
|
+
## Undo
|
|
141
|
+
|
|
142
|
+
```bash
|
|
143
|
+
npx nexos-connect restore
|
|
144
|
+
```
|
|
145
|
+
|
|
146
|
+
Every setting nexos-connect wrote goes back to what it was before the first run; everything you added
|
|
147
|
+
since stays. Copies of the original files are kept under `~/.nexos/backups/` (or `./.nexos-backup/`
|
|
148
|
+
for a project).
|
|
149
|
+
|
|
150
|
+
## Your key
|
|
151
|
+
|
|
152
|
+
Your key is never printed in full — not in diffs, reports or gateway errors. Save it with `--save-key`
|
|
153
|
+
and later runs offer it from your system keychain (macOS Keychain, Windows Credential Manager, or the
|
|
154
|
+
Secret Service on Linux); `npx nexos-connect forget-key` removes it.
|
|
155
|
+
|
|
156
|
+
Setup still writes the key in plain text to each agent's config and to `~/.nexos/env`, where the agents
|
|
157
|
+
read it; a saved key does not change that.
|
|
158
|
+
|
|
159
|
+
## Development
|
|
160
|
+
|
|
161
|
+
```bash
|
|
162
|
+
pnpm install
|
|
163
|
+
pnpm start --dry-run # run from source; flags follow directly, no --
|
|
164
|
+
pnpm build # → dist/
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## License
|
|
168
|
+
|
|
169
|
+
[MIT](LICENSE) © Nexos B.V.
|