@claudecollab/cli 0.1.3 → 0.2.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.
- package/README.md +70 -7
- package/package.json +2 -3
- package/packages/cli/bin/claude-share.js +313 -24
- package/packages/cli/src/brain/ask.js +67 -0
- package/packages/cli/src/brain/card.js +7 -3
- package/packages/cli/src/brain/commands.js +5 -1
- package/packages/cli/src/brain/history.js +72 -0
- package/packages/cli/src/brain/log.js +21 -3
- package/packages/cli/src/brain/state.js +24 -2
- package/packages/cli/src/brain/transcript.js +65 -0
- package/packages/cli/src/ctl-client.js +119 -0
- package/packages/cli/src/ctl.js +97 -0
- package/packages/cli/src/first-run.js +166 -0
- package/packages/cli/src/relay-client.js +13 -3
- package/packages/cli/src/room-file.js +22 -0
- package/packages/cli/src/setup-actions.js +163 -0
- package/packages/cli/src/shim.js +140 -0
- package/packages/relay/bin/serve.js +2 -0
- package/packages/relay/public/client.js +206 -41
- package/packages/relay/public/index.html +15 -0
- package/packages/relay/public/style.css +232 -3
- package/packages/relay/rooms.js +5 -2
- package/packages/relay/server.js +34 -3
- package/packages/relay/web.js +102 -24
- package/packages/shared/protocol.js +11 -1
package/README.md
CHANGED
|
@@ -7,22 +7,77 @@
|
|
|
7
7
|
(you run Claude) <--> (passes messages) <--> (open a link)
|
|
8
8
|
```
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
Before you go live, your terminal is *exactly* normal Claude — nothing added. The moment you go live, one status line shows up at the bottom, and all the sharing itself happens in the web browser.
|
|
11
11
|
|
|
12
12
|
## Start a session
|
|
13
13
|
|
|
14
14
|
```bash
|
|
15
|
+
npx @claudecollab/cli # try it right now, nothing to install
|
|
16
|
+
# liked it? make it permanent:
|
|
15
17
|
npm install -g @claudecollab/cli
|
|
16
18
|
collab
|
|
17
19
|
```
|
|
18
20
|
|
|
19
|
-
|
|
21
|
+
The first npx run downloads for ~10–20 seconds; after that it's fast.
|
|
20
22
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
+
Run `collab` instead of `claude`. It looks and works **exactly** like Claude — because at this point it *is* just Claude. It is not sharing anything yet. You go live only when you decide to.
|
|
24
|
+
|
|
25
|
+
## The first time you run it
|
|
26
|
+
|
|
27
|
+
The very first time you run `collab`, you'll see a quick one-screen setup. You only see it once. It does two things for you:
|
|
28
|
+
|
|
29
|
+
1. Adds the `/collab` command to Claude Code — this is the whole point; it's how you go live.
|
|
30
|
+
2. Makes your normal `claude` command shareable too, so you can just keep typing `claude` and still get `/collab`.
|
|
31
|
+
|
|
32
|
+
It also asks one optional thing: do you want `/collab @name` to deliver your join link through **Slack**, **Gmail**, or **Discord**? Pick any, or none. You turn these on in your Claude account (at `claude.ai/customize/connectors`) — the screen tells you how, and you can change your mind anytime.
|
|
33
|
+
|
|
34
|
+
Then it starts Claude like normal.
|
|
35
|
+
|
|
36
|
+
Changed your mind, or want to run it again?
|
|
37
|
+
|
|
38
|
+
- `collab setup` — show the setup screen again.
|
|
39
|
+
- `collab setup --undo` — put your normal `claude` back (removes the shim and the plugin).
|
|
40
|
+
- `collab --yes` — skip the setup screen this time (or set `CLAUDE_SHARE_SKIP_SETUP=1`).
|
|
41
|
+
|
|
42
|
+
## Go live with `/collab`
|
|
43
|
+
|
|
44
|
+
The first-run setup already added `/collab` for you. (Skipped it? Add it by hand:)
|
|
45
|
+
|
|
46
|
+
```
|
|
47
|
+
/plugin marketplace add ir272/claudecollab
|
|
48
|
+
/plugin install collab@claudecollab
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
Whenever you want people to join, just type this inside your session:
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
/collab
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Claude opens a room and hands you the invite link to share. A few handy shortcuts:
|
|
58
|
+
|
|
59
|
+
- `/collab @sam` — go live *and* DM the link to Sam (if you have a messaging tool like Slack connected).
|
|
60
|
+
- `/collab viewer` or `/collab max 3` or `/collab password hunter2` — set the guest role, a size limit, or a join password.
|
|
61
|
+
- `/collab off` — stop sharing. The room closes and the link dies.
|
|
62
|
+
- `/collab status` — check whether you're live and see the link again.
|
|
63
|
+
|
|
64
|
+
Prefer to be live the second you start (no plugin needed)? Run `collab --live` and it makes the room right away. `collab off` stops it.
|
|
65
|
+
|
|
66
|
+
### The two links
|
|
67
|
+
|
|
68
|
+
Once you're live you get two links — **don't mix them up**:
|
|
69
|
+
|
|
70
|
+
- A **private link** — your control panel (you let people in and manage them). Stays on your own screen.
|
|
71
|
+
- A **share link** — this is the one you send. `/collab` prints it and the Invite button copies it.
|
|
23
72
|
|
|
24
73
|
Your friends just open the share link in a browser. They don't install anything.
|
|
25
74
|
|
|
75
|
+
## Works on
|
|
76
|
+
|
|
77
|
+
macOS and Linux (Windows counts too, if you use WSL). Native Windows isn't tested yet — if you try it, please open an issue and tell us how it went.
|
|
78
|
+
|
|
79
|
+
You need Node 22 or newer. If you installed Claude Code with its native installer (not npm), you might not have Node yet — install it first.
|
|
80
|
+
|
|
26
81
|
## Two links — don't mix them up
|
|
27
82
|
|
|
28
83
|
| Link | Who it's for |
|
|
@@ -60,7 +115,7 @@ When a friend types something, **it runs on your computer, as if you typed it.**
|
|
|
60
115
|
By default, `collab` uses our free server at claudecollab.org. Want to run your own instead? The same install includes it:
|
|
61
116
|
|
|
62
117
|
```bash
|
|
63
|
-
collab
|
|
118
|
+
collab relay # start your own server
|
|
64
119
|
collab --relay ssh://127.0.0.1:2222 # use it
|
|
65
120
|
```
|
|
66
121
|
|
|
@@ -68,7 +123,7 @@ To put your server online for good (on Fly.io or any host — see `fly.toml`):
|
|
|
68
123
|
|
|
69
124
|
```bash
|
|
70
125
|
fly launch --no-deploy
|
|
71
|
-
fly secrets set HOST_KEY="$(collab
|
|
126
|
+
fly secrets set HOST_KEY="$(collab relay --make-key)"
|
|
72
127
|
fly secrets set ROOM_SECRET="$(openssl rand -hex 16)" # optional lock (see below)
|
|
73
128
|
fly deploy
|
|
74
129
|
```
|
|
@@ -83,12 +138,14 @@ Two safety features come built in:
|
|
|
83
138
|
| Option | What it does |
|
|
84
139
|
|---|---|
|
|
85
140
|
| `--relay <url>` | which server to use; defaults to ours |
|
|
86
|
-
| `--
|
|
141
|
+
| `--live` | go live at startup instead of waiting for `/collab` |
|
|
142
|
+
| `--no-relay` | go solo — just Claude, no room, no sharing (and no `/collab`) |
|
|
87
143
|
| `--room-password <pw>` | friends must type this before they can ask to join |
|
|
88
144
|
| `--guests <role>` | what new people can do when let in (default: prompter) |
|
|
89
145
|
| `--secret <s>` | the password for a locked server (or use `CLAUDE_SHARE_SECRET`) |
|
|
90
146
|
| `--fingerprint <fp>` | lock onto a specific server's ID |
|
|
91
147
|
| `--cmd <program>` | run something other than `claude` |
|
|
148
|
+
| `--yes` | skip the first-run setup screen |
|
|
92
149
|
| `-- <args…>` | anything after `--` is passed to the program you're running |
|
|
93
150
|
|
|
94
151
|
<details>
|
|
@@ -104,6 +161,12 @@ packages/cli/ the main program you run — the brain
|
|
|
104
161
|
|
|
105
162
|
</details>
|
|
106
163
|
|
|
164
|
+
## Support this project
|
|
165
|
+
|
|
166
|
+
It's free and open source, and the community server costs a little to keep running. If it saved you some time, please consider chipping in — every bit helps keep it open ♥
|
|
167
|
+
|
|
168
|
+
**[github.com/sponsors/ir272](https://github.com/sponsors/ir272)**
|
|
169
|
+
|
|
107
170
|
## License
|
|
108
171
|
|
|
109
172
|
[MIT](LICENSE) — free to use and change. This is an independent project, not made or approved by Anthropic.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@claudecollab/cli",
|
|
3
|
-
"version": "0.1
|
|
3
|
+
"version": "0.2.1",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"publishConfig": {
|
|
6
6
|
"access": "public"
|
|
@@ -9,8 +9,7 @@
|
|
|
9
9
|
"homepage": "https://claudecollab.org",
|
|
10
10
|
"type": "module",
|
|
11
11
|
"bin": {
|
|
12
|
-
"collab": "packages/cli/bin/claude-share.js"
|
|
13
|
-
"collab-relay": "packages/relay/bin/serve.js"
|
|
12
|
+
"collab": "packages/cli/bin/claude-share.js"
|
|
14
13
|
},
|
|
15
14
|
"files": [
|
|
16
15
|
"packages/cli",
|