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