@lesscap/baton-cli 0.8.2 → 0.8.4
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 +32 -17
- package/dist/baton.mjs +825 -443
- package/package.json +15 -14
- package/skills/baton-publish-artifact/SKILL.md +1 -1
- package/LICENSE +0 -21
package/README.md
CHANGED
|
@@ -4,7 +4,7 @@ The baton CLI: register/run a **worker** on a machine and manage
|
|
|
4
4
|
workspaces/projects/requirements/tasks/sessions against a baton server.
|
|
5
5
|
|
|
6
6
|
A worker is the thing that actually runs agent sessions: it listens to the
|
|
7
|
-
server's command stream and, per session,
|
|
7
|
+
server's command stream and, per session, runs Claude or Codex in the worker’s working directory.
|
|
8
8
|
|
|
9
9
|
## Install
|
|
10
10
|
|
|
@@ -19,17 +19,16 @@ in (the worker spawns it to run each turn). Override the path with
|
|
|
19
19
|
## Run a worker
|
|
20
20
|
|
|
21
21
|
```sh
|
|
22
|
-
# 1. cd into the
|
|
23
|
-
# (
|
|
22
|
+
# 1. cd into the directory the agent should work in
|
|
23
|
+
# (sessions share files; Agent conversations remain independent)
|
|
24
24
|
cd /path/to/your-repo
|
|
25
25
|
|
|
26
26
|
# 2. register this machine as a worker for a project
|
|
27
27
|
baton worker register \
|
|
28
28
|
--url https://baton.fmap.dev/api \
|
|
29
29
|
--project <projectId> \
|
|
30
|
-
--name my-machine
|
|
31
|
-
|
|
32
|
-
# → generates ./.baton.json with server, project, base branch, and worker token
|
|
30
|
+
--name my-machine
|
|
31
|
+
# → generates ./.baton.json with server, project, and worker token
|
|
33
32
|
|
|
34
33
|
# 3. run the worker daemon (foreground; Ctrl-C to stop)
|
|
35
34
|
baton worker run
|
|
@@ -40,17 +39,33 @@ running, it shows up (alive) under the project's workers in the web back-office;
|
|
|
40
39
|
new sessions / inbound DingTalk messages are then executed by it.
|
|
41
40
|
|
|
42
41
|
`.baton.json` is per-directory local state (gitignored by convention) and is
|
|
43
|
-
generated by `baton worker register`; `baton init` is optional.
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
42
|
+
generated by `baton worker register`; `baton init` is optional. Session startup
|
|
43
|
+
never rewrites this project configuration, fetches Git branches, or creates a
|
|
44
|
+
worktree. Existing directories, including non-Git and empty Git repositories,
|
|
45
|
+
can host sessions. Development skills may manage worktrees explicitly.
|
|
46
|
+
|
|
47
|
+
Agent subprocesses inherit `BATON_SERVER`, `BATON_PROJECT_ID`, `BATON_WORKER_ID`,
|
|
48
|
+
and `BATON_WORKER_TOKEN`, so Baton commands keep their context from subdirectories.
|
|
49
|
+
Server resolution is `--url > BATON_SERVER > .baton.json.server > BATON_URL > localhost`;
|
|
50
|
+
project resolution is `--project > BATON_PROJECT_ID > .baton.json.project`.
|
|
51
|
+
|
|
52
|
+
Baton runner records and attachments live under
|
|
53
|
+
`${XDG_DATA_HOME:-~/.local/share}/baton/runtime/<server-hash>/worker-<id>/sessions/<id>`.
|
|
54
|
+
Deleting a session removes its Baton runtime files and preserves project files.
|
|
55
|
+
|
|
56
|
+
## Development services
|
|
57
|
+
|
|
58
|
+
```sh
|
|
59
|
+
baton service run web --cwd /absolute/project/path -- pnpm dev
|
|
60
|
+
baton service ls
|
|
61
|
+
baton service stop web
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
`--cwd` is required; relative paths resolve from the CLI's current directory.
|
|
65
|
+
Services belong to the worker and continue after a session stops or is deleted.
|
|
66
|
+
They stop when explicitly stopped, when the application exits, or when the worker
|
|
67
|
+
exits. Restarting the worker does not restart services. Logs live in the worker's
|
|
68
|
+
runtime `services/` directory; the run result prints their path.
|
|
54
69
|
|
|
55
70
|
## Other commands
|
|
56
71
|
|