@lesscap/baton-cli 0.1.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/README.md +50 -0
- package/dist/baton.mjs +2779 -0
- package/package.json +27 -0
package/README.md
ADDED
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
# @lesscap/baton-cli
|
|
2
|
+
|
|
3
|
+
The baton CLI: register/run a **worker** on a machine and manage
|
|
4
|
+
workspaces/projects/requirements/tasks/sessions against a baton server.
|
|
5
|
+
|
|
6
|
+
A worker is the thing that actually runs agent sessions: it listens to the
|
|
7
|
+
server's command stream and, per session, spawns `claude` in a git worktree.
|
|
8
|
+
|
|
9
|
+
## Install
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
npm i -g @lesscap/baton-cli
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
**Prerequisite:** the machine needs the `claude` CLI on `PATH`, already logged
|
|
16
|
+
in (the worker spawns it to run each turn). Override the path with
|
|
17
|
+
`BATON_CLAUDE_BIN=/path/to/claude` if needed.
|
|
18
|
+
|
|
19
|
+
## Run a worker
|
|
20
|
+
|
|
21
|
+
```sh
|
|
22
|
+
# 1. cd into the git repo the agent should work in
|
|
23
|
+
# (each session gets its own worktree branched off it)
|
|
24
|
+
cd /path/to/your-repo
|
|
25
|
+
|
|
26
|
+
# 2. register this machine as a worker for a project
|
|
27
|
+
baton worker register --url https://baton.fmap.dev/api --project <projectId> --name my-machine
|
|
28
|
+
# → writes ./.baton.json { server, project, worker token }
|
|
29
|
+
|
|
30
|
+
# 3. run the worker daemon (foreground; Ctrl-C to stop)
|
|
31
|
+
baton worker run
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
The worker authenticates with its own bearer token — **no login needed**. Once
|
|
35
|
+
running, it shows up (alive) under the project's workers in the web back-office;
|
|
36
|
+
new sessions / inbound DingTalk messages are then executed by it.
|
|
37
|
+
|
|
38
|
+
`.baton.json` is per-directory local state (gitignored by convention). You can
|
|
39
|
+
also create it by hand before registering:
|
|
40
|
+
|
|
41
|
+
```json
|
|
42
|
+
{ "server": "https://baton.fmap.dev/api", "project": 2 }
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
## Other commands
|
|
46
|
+
|
|
47
|
+
`baton init | workspace | project | requirement | task | session` — run
|
|
48
|
+
`baton <command> --help` for details. The back-office management commands hit
|
|
49
|
+
gated routes; set `BATON_USER` / `BATON_PASS` to log in transparently (the
|
|
50
|
+
worker commands above don't need this).
|