pi-herdsman 0.14.0 → 0.14.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.
@@ -1,178 +1,173 @@
1
1
  # Container deployment
2
2
 
3
- [Documentation index](../README.md)
3
+ Run Pi Herdsman as a portable SSH-accessible coding-agent environment with Pi, Herdr, developer tools, and persistent state.
4
4
 
5
- The Pi Herdsman container is a portable, self-hosted execution environment for
6
- coding agents. It packages Pi, herdr, Pi Herdsman, developer tooling, and
7
- OpenSSH while keeping mutable user state under `/home/herdsman`.
5
+ ## Quick start
8
6
 
9
- Use it locally or as a remote coding-agent machine. OpenSSH is the access
10
- boundary; connect with your own SSH key and use Pi and herdr normally.
7
+ Start:
11
8
 
12
- Pi sessions automatically receive image-owned environment context from
13
- `/AGENTS.md`, including persistence boundaries, available tool categories, and
14
- how to install additional tools. User and project context files continue to
15
- layer normally through Pi's native context-file discovery.
9
+ ```sh
10
+ SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" docker compose up -d
11
+ ```
16
12
 
17
- ## Direct SSH
13
+ Connect:
18
14
 
19
- Start the service with a public key authorized for the `herdsman` account:
15
+ ```sh
16
+ ssh -p 2222 herdsman@your-host
17
+ ```
18
+
19
+ Herdr opens automatically. Select a workspace and run:
20
20
 
21
21
  ```sh
22
- SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" docker compose up -d
22
+ pi
23
23
  ```
24
24
 
25
- Connect to the host's configured SSH port (2222 by default):
25
+ That's it.
26
+
27
+ ## Add it to Herdr
26
28
 
27
29
  ```sh
28
- ssh -p 2222 herdsman@host
30
+ herdr machine add ssh://herdsman@your-host:2222 --label my-herd
29
31
  ```
30
32
 
31
- Start or attach to a Herdr session with:
33
+ With an existing `~/.ssh/config` host:
32
34
 
33
35
  ```sh
34
- herdr
36
+ herdr machine add my-herd --label my-herd
35
37
  ```
36
38
 
37
- SSH password authentication and root login are disabled. On first start,
38
- `SSH_AUTHORIZED_KEYS` is required to initialize the account's authorized keys.
39
- The keys are saved in the persistent home volume; changing the environment
40
- variable later does not replace an existing authorized-keys file. SSH agent
41
- forwarding remains available, so `ssh -A` can be used when a session needs
42
- access to private Git repositories without copying private keys into the
43
- container.
39
+ The remote machine then appears alongside Local in Herdr.
44
40
 
45
- ## Herdr Machines
41
+ ## Use Tailscale
46
42
 
47
- After normal SSH access works, save the container as a herdr machine from the
48
- computer running your local herdr client:
43
+ Start with the Tailscale sidecar:
49
44
 
50
45
  ```sh
51
- herdr machine add ssh://herdsman@host:2222 --label my-herd
46
+ TS_AUTHKEY=tskey-auth-... \
47
+ SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
48
+ docker compose \
49
+ -f compose.yaml \
50
+ -f compose.tailscale.yaml \
51
+ up -d
52
52
  ```
53
53
 
54
- For a host already configured in `~/.ssh/config`:
54
+ Connect:
55
55
 
56
56
  ```sh
57
- herdr machine add my-herd --label my-herd
57
+ ssh herdsman@pi-herdsman
58
+ ```
59
+
60
+ Add it to Herdr:
61
+
62
+ ```sh
63
+ herdr machine add ssh://herdsman@pi-herdsman --label my-herd
58
64
  ```
59
65
 
60
- Each machine keeps its own herdr server, sessions, and running processes.
61
- Connected machine workspaces and agents appear alongside Local in the same
62
- herdr window, and disconnecting the client does not stop the remote work.
66
+ Use another hostname:
63
67
 
64
- See the [herdr machine documentation](https://herdr.dev/docs/connecting-machines/)
65
- for machine management and SSH configuration.
68
+ ```sh
69
+ TAILSCALE_HOSTNAME=my-herd \
70
+ TS_AUTHKEY=tskey-auth-... \
71
+ SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
72
+ docker compose \
73
+ -f compose.yaml \
74
+ -f compose.tailscale.yaml \
75
+ up -d
76
+ ```
66
77
 
67
- ## Updates
78
+ Tailscale provides networking only. SSH remains normal OpenSSH.
68
79
 
69
- Pull the current image and recreate the service:
80
+ ## Update
70
81
 
71
82
  ```sh
72
83
  docker compose pull
73
84
  docker compose up -d
74
85
  ```
75
86
 
76
- The container replaces immutable software while the named volumes preserve
77
- `/home/herdsman` and the SSH host identity.
87
+ Persistent state survives container replacement.
78
88
 
79
- ## Persistent state
89
+ ## Use a host bind mount
80
90
 
81
- The default Compose setup persists two volumes:
91
+ The default Docker-managed volume needs no manual permission setup.
82
92
 
83
- - `/home/herdsman` contains Pi authentication, configuration, sessions and
84
- extensions; Herdr configuration, sessions and worktrees; mise-installed
85
- tools; npm globals; Git, GitHub and user SSH state; and repositories.
86
- - `/var/lib/herdsman/ssh` contains the SSH server host key, preserving server
87
- identity when the container is replaced.
88
-
89
- The image uses its built-in `herdsman` UID and GID by default. For Linux or NAS
90
- bind mounts owned by a different host account, set `PUID` and `PGID` to the
91
- directory owner's numeric IDs:
93
+ For a Linux or NAS bind mount, prepare the directory for the UID/GID the
94
+ container will use:
92
95
 
93
96
  ```sh
94
- PUID="$(id -u docker-user)" \
95
- PGID="$(id -g docker-user)" \
96
- SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
97
- docker compose up -d
97
+ PUID=1035
98
+ PGID=65537
99
+
100
+ mkdir -p ./data/herdsman-home
101
+ sudo chown "$PUID:$PGID" ./data/herdsman-home
102
+ sudo chmod go-w ./data/herdsman-home
98
103
  ```
99
104
 
100
- You can also set `PUID` and `PGID` in the Compose `.env` file:
105
+ Set the same IDs in `.env`:
101
106
 
102
107
  ```dotenv
103
108
  PUID=1035
104
109
  PGID=65537
105
110
  ```
106
111
 
107
- The container remaps the `herdsman` account but does not change ownership of
108
- the mounted home. Prepare the host directory so the configured IDs can write
109
- it. Existing volumes are not migrated automatically; startup fails if
110
- `/home/herdsman` is not writable by the resulting account. Repositories can
111
- live under the persistent home, for example `~/projects`. Host checkouts can
112
- be mounted explicitly when needed.
112
+ Create `compose.bind-mount.yaml` to replace the home volume with the host
113
+ directory while keeping the SSH server identity in its named volume:
113
114
 
114
- ## Additional tools
115
+ ```yaml
116
+ services:
117
+ herdsman:
118
+ volumes:
119
+ - ./data/herdsman-home:/home/herdsman
120
+ - herdsman-ssh:/var/lib/herdsman/ssh
121
+ ```
115
122
 
116
- Install tools into the persistent home with mise:
123
+ Start with both Compose files:
117
124
 
118
125
  ```sh
119
- mise use -g uv@latest
120
- uv run ...
126
+ SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
127
+ docker compose -f compose.yaml -f compose.bind-mount.yaml up -d
121
128
  ```
122
129
 
123
- Mise shims and user-installed tools are available in SSH sessions, including
124
- non-interactive commands.
130
+ OpenSSH requires the home directory to be owned by root or the login user and
131
+ not writable by group or others. The container validates this at startup but
132
+ does not change ownership or permissions of host bind mounts.
125
133
 
126
- ## Tailscale
134
+ ## Forward your SSH agent
127
135
 
128
- Tailscale is an optional Compose sidecar. It shares the service network
129
- namespace; it does not run in the Herdsman container. Start both services with:
136
+ For private Git repositories:
130
137
 
131
138
  ```sh
132
- TS_AUTHKEY=... \
133
- SSH_AUTHORIZED_KEYS="$(cat ~/.ssh/id_ed25519.pub)" \
134
- docker compose \
135
- -f compose.yaml \
136
- -f compose.tailscale.yaml \
137
- up -d
139
+ ssh -A -p 2222 herdsman@your-host
138
140
  ```
139
141
 
140
- Connect over the Tailscale hostname using normal OpenSSH:
142
+ ## Install another tool
141
143
 
142
144
  ```sh
143
- ssh herdsman@pi-herdsman
145
+ mise use -g uv@latest
144
146
  ```
145
147
 
146
- Set `TAILSCALE_HOSTNAME` if a different hostname is desired. The overlay uses
147
- Tailscale networking, not Tailscale SSH.
148
-
149
- ## Interactive sessions
148
+ Tools installed with mise persist in the home volume.
150
149
 
151
- Interactive SSH logins automatically open Herdr. This also applies when SSH is
152
- reached through the optional Tailscale sidecar.
150
+ ## What persists?
153
151
 
154
- Exit Herdr to return to the normal shell.
152
+ | Path | Contents |
153
+ | ----------------------- | --------------------------------------------------------------------------------- |
154
+ | `/home/herdsman` | Pi and Herdr state, repositories, config, credentials, SSH state, installed tools |
155
+ | `/var/lib/herdsman/ssh` | SSH server identity |
155
156
 
156
- For interactive Docker access as the normal container user, run:
157
+ Running processes do not survive a container restart.
157
158
 
158
- ```sh
159
- docker exec -it --user herdsman <container> bash
160
- ```
161
-
162
- or with Compose:
163
-
164
- ```sh
165
- docker compose exec --user herdsman herdsman bash
166
- ```
159
+ ## Defaults
167
160
 
168
- Bare `docker exec` uses the container's root user and is intended for
169
- administrative debugging; it does not automatically open Herdr.
161
+ | Setting | Default |
162
+ | ------------------ | ------------- |
163
+ | SSH port | `2222` |
164
+ | User | `herdsman` |
165
+ | Tailscale hostname | `pi-herdsman` |
166
+ | Password login | disabled |
167
+ | Root SSH login | disabled |
170
168
 
171
- Non-interactive SSH commands are unaffected.
169
+ `SSH_AUTHORIZED_KEYS` is required only on first start. Existing authorized keys are not overwritten.
172
170
 
173
- ## Container restart behavior
171
+ Pi sessions automatically receive the container environment context from `/AGENTS.md`.
174
172
 
175
- Herdr detach and reattach keep processes alive while the container itself
176
- remains alive. Replacing or restarting the Docker container kills its
177
- processes. Herdr can restore layout and supported Pi conversations, but
178
- arbitrary processes do not survive a container restart.
173
+ See the [Herdr machine documentation](https://herdr.dev/docs/connecting-machines/) for machine and SSH configuration.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pi-herdsman",
3
- "version": "0.14.0",
3
+ "version": "0.14.1",
4
4
  "type": "module",
5
5
  "description": "Asynchronous Pi subagents and agent fleet orchestration for parallel coding agents with nested delegation, background work, and supervision in herdr.",
6
6
  "license": "Apache-2.0",