@elu-labs/cli 0.0.0-stage → 1.0.1

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.
Files changed (4) hide show
  1. package/LICENSE +24 -0
  2. package/README.md +125 -2
  3. package/dist/elu.mjs +159 -0
  4. package/package.json +47 -4
package/LICENSE ADDED
@@ -0,0 +1,24 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 ELU Labs, Inc.
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.
22
+
23
+ Third-party software bundled into dist/elu.mjs (undici, MIT; jsonc-parser,
24
+ MIT) keeps its own license, reproduced in full at the end of that file.
package/README.md CHANGED
@@ -1,3 +1,126 @@
1
- # Temporary Holding Version
1
+ # @elu-labs/cli
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
+ Add ELU to your web app and connect your AI tools to ELU with one command.
4
+
5
+ ```sh
6
+ npx -y @elu-labs/cli
7
+ ```
8
+
9
+ On Windows PowerShell, use `npx.cmd -y @elu-labs/cli`. You need Node.js 18.17 or newer.
10
+
11
+ ## What it does
12
+
13
+ 1. Looks at the folder you run it in: the framework, any ELU tag already there, and the AI tools on this computer. It changes nothing yet.
14
+ 2. Shows you what it will do and asks once.
15
+ 3. Opens your browser to sign in to ELU. New to ELU? Sign up with your work email.
16
+ 4. Adds the ELU tag to your app.
17
+ 5. Writes an ELU key into the user config of Claude Code, Cursor and VS Code on this computer.
18
+ 6. Prints what changed and how to undo it.
19
+
20
+ Session replay is on by default. You don't need to turn anything else on.
21
+
22
+ ## Commands
23
+
24
+ | Command | What it does |
25
+ | ------------------------------------- | ------------------------------------------------- |
26
+ | `npx -y @elu-labs/cli` | Add ELU to this app, then connect your AI tools |
27
+ | `npx -y @elu-labs/cli web` | Only add ELU to this app |
28
+ | `npx -y @elu-labs/cli mcp` | Only connect your AI tools |
29
+ | `npx -y @elu-labs/cli mcp elu_live_…` | Connect your AI tools with a key you already have |
30
+
31
+ ## Options
32
+
33
+ | Option | What it does |
34
+ | -------------- | --------------------------------------------------------------------- |
35
+ | `-y`, `--yes` | Go ahead without asking |
36
+ | `--no-web` | Don't add ELU to the app |
37
+ | `--no-mcp` | Don't connect AI tools |
38
+ | `--tools=LIST` | Only these tools: `claude`, `cursor`, `vscode` |
39
+ | `--app=DIR` | The app folder to use, for monorepos |
40
+ | `--paste` | Sign in by pasting a code. SSH and containers use this automatically. |
41
+ | `--reactivate` | Turn analytics back on if it was turned off |
42
+ | `--json` | Print one JSON result on stdout. Messages go to stderr. |
43
+ | `--version` | Print the version |
44
+ | `--help` | Show help |
45
+
46
+ | Environment variable | What it does |
47
+ | --------------------------------------- | -------------------------------------------------------------- |
48
+ | `ELU_API_KEY` | An `elu_live_` key. Connects AI tools without signing in. |
49
+ | `ELU_URL` | ELU address. The default is `https://elu.dev`. |
50
+ | `HTTPS_PROXY`, `HTTP_PROXY`, `NO_PROXY` | Your proxy. npm's `proxy` and `https-proxy` settings work too. |
51
+ | `NODE_EXTRA_CA_CERTS` | Your company CA file. npm's `cafile` setting works too. |
52
+ | `NO_COLOR` | Turn colors off |
53
+
54
+ ## Where it writes
55
+
56
+ **Your app.** It adds one script tag to one file:
57
+
58
+ | Framework | File |
59
+ | -------------------- | ------------------------------------------------------------------ |
60
+ | Next.js App Router | `app/layout.tsx` (or `src/app/…`) |
61
+ | Next.js Pages Router | `pages/_document.tsx`. It creates this file if you don't have one. |
62
+ | Vite, plain HTML | `index.html` |
63
+ | Create React App | `public/index.html` |
64
+
65
+ It never stages or commits anything. If your app already has an ELU tag, it leaves it alone. For any other framework, it prints the tag for you to add.
66
+
67
+ **Your AI tools.** It writes the key into each tool's **user** config, never into your repo:
68
+
69
+ | Tool | Where |
70
+ | ----------- | --------------------------------------------------------------------------------------------------------------------------------------- |
71
+ | Claude Code | `claude mcp add --scope user` (stored in `~/.claude.json`) |
72
+ | Cursor | `~/.cursor/mcp.json` |
73
+ | VS Code | Your user `mcp.json`: `~/Library/Application Support/Code/User` (macOS), `~/.config/Code/User` (Linux), `%APPDATA%\Code\User` (Windows) |
74
+
75
+ Files that hold the key are readable only by you (mode 0600). Before it changes a file the first time, it saves a copy in `~/.config/elu/backups`. It also keeps a random device id in `~/.config/elu/device-id`, so each computer gets its own key.
76
+
77
+ For Claude Desktop, add ELU under Settings → Connectors with `https://elu.dev/api/mcp`.
78
+
79
+ Over SSH, in a container or in a Codespace, it only connects Claude Code. On your laptop, run `npx -y @elu-labs/cli mcp` for Cursor and VS Code.
80
+
81
+ ## Keys found in your repo
82
+
83
+ An ELU key in a project file such as `.vscode/mcp.json`, `.cursor/mcp.json`, `.mcp.json` or `.windsurf/*.json` is never reused.
84
+
85
+ - If git tracks that file, or the key is in your git history, the CLI revokes the key and removes the entry. Commit that change.
86
+ - If git doesn't know about the file, the CLI removes the entry once the tool's user config has ELU.
87
+
88
+ ## Undo
89
+
90
+ - **The tag.** The CLI prints the command for each file it changed. Inside git, run `git checkout -p <file>`. If it created the file, delete the file. Outside git, copy the backup back from the path it printed.
91
+ - **AI tools.** Run `claude mcp remove elu --scope user`. Delete the `elu` entry from `~/.cursor/mcp.json` and from your VS Code user `mcp.json`.
92
+ - **The key.** Revoke it in ELU under Settings → API & MCP. The CLI names each key `ELU CLI · <device> · <date>`.
93
+
94
+ ## Viewers
95
+
96
+ If you are a Viewer in the organization, your key is read-only. The CLI says so when it connects your tools.
97
+
98
+ ## Local traffic
99
+
100
+ Visits to your app on `localhost` count like any other traffic. To leave them out, go to Session Replays → Tuning → Filtered URLs and add `localhost`.
101
+
102
+ ## Agents and CI
103
+
104
+ - When stdin or stdout isn't a terminal, the CLI never asks anything. It prints the plan and exits with code 2 unless you pass `--yes`. The sign-in link is the first line it prints, and it waits up to 9 minutes.
105
+ - In CI it needs `ELU_API_KEY`. Without it, it exits with code 1.
106
+
107
+ | Exit code | Meaning |
108
+ | --------- | ----------------------------------------------------------------------- |
109
+ | 0 | Everything asked for is done, or skipped for a reason a rerun won't fix |
110
+ | 1 | A step failed or was cancelled |
111
+ | 2 | It needs input: pass `--yes`, `--app=<dir>` or `--reactivate` |
112
+
113
+ ## Upgrading from @elu-labs/mcp-setup
114
+
115
+ `npx @elu-labs/mcp-setup` still works. It now runs this CLI's `mcp` command. The key argument, `ELU_API_KEY`, the prompt and the exit codes are the same. These things changed:
116
+
117
+ - At the key prompt, you can press Enter to sign in with your browser instead of pasting a key.
118
+ - VS Code gets ELU in your user `mcp.json`, not in `.vscode/mcp.json` in the current folder.
119
+ - Claude Desktop is no longer written. Add ELU under Settings → Connectors instead.
120
+ - Windsurf and Zed are no longer written.
121
+ - Config files are edited in place, keeping comments. A file that isn't valid JSON is left alone instead of being replaced.
122
+ - The key is never printed.
123
+
124
+ ## License
125
+
126
+ MIT. The bundled third-party packages (undici and jsonc-parser, both MIT) keep their own licenses. Their full text is at the end of `dist/elu.mjs`.