create-pmos 0.549.0 → 0.550.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/cloud-setup.sh +438 -0
- package/package.json +15 -14
- package/payload/KIT-VERSION +1 -1
- package/payload/planning/evals/eval-calibration.md +1 -1
- package/payload/planning/okrs/health-budgets.md +1 -1
- package/payload/state/discoveries.md +1 -1
- package/workspace/changelog.json +13 -0
- package/workspace/guide/cloud.md +100 -0
- package/workspace/guide/index.md +1 -0
- package/workspace/package-lock.json +2 -2
- package/workspace/package.json +1 -1
package/cloud-setup.sh
ADDED
|
@@ -0,0 +1,438 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# PMOS in the cloud: run the PMOS workspace on an always-on Linux server (initiative workspace-run-in-cloud).
|
|
3
|
+
# Guide: workspace/guide/cloud.md ("Run PMOS in the cloud").
|
|
4
|
+
#
|
|
5
|
+
# 1. On the Mac that runs PMOS today, one paste moves PMOS to a new server and starts it there:
|
|
6
|
+
#
|
|
7
|
+
# curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash -s -- move root@<server-ip>
|
|
8
|
+
#
|
|
9
|
+
# It checks that it can reach the server, stops PMOS on the Mac (Online off, the minute check paused, Remote
|
|
10
|
+
# Control left running), packs the PMOS state folder, every registered repository (with its git history), the
|
|
11
|
+
# Cloudflare tunnel files, the Claude profile names and ~/.gitconfig, copies the pack to the server and runs step 2
|
|
12
|
+
# there. Nothing is deleted on the Mac. `cloud-setup.sh mac-on` on the Mac turns the Mac back on.
|
|
13
|
+
#
|
|
14
|
+
# 2. On the server (Ubuntu 22.04 or newer, as root). `move` runs this for you; without a Mac, paste it yourself:
|
|
15
|
+
#
|
|
16
|
+
# curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash
|
|
17
|
+
#
|
|
18
|
+
# Makes the same user and home folder as on the Mac (so every path, product id and tunnel file stays valid),
|
|
19
|
+
# installs git, tmux, build tools, cloudflared and the GitHub CLI, turns on the firewall (SSH only), unpacks the
|
|
20
|
+
# pack, installs Node, Claude Code and PMOS for that user, and adds a systemd timer that runs the same minute
|
|
21
|
+
# check as the Mac login item: `pmos up --keep`, plus Remote Control in tmux after the sign-in.
|
|
22
|
+
# Running it again is safe: it skips what is there and never overwrites a repository or a state folder.
|
|
23
|
+
#
|
|
24
|
+
# 3. Sign in once, from any computer:
|
|
25
|
+
#
|
|
26
|
+
# ssh -t <user>@<server-ip> pmos-cloud signin
|
|
27
|
+
#
|
|
28
|
+
# Claude Code (your own account; its claude.ai connectors bring Jira and Slack) and GitHub (for record sync).
|
|
29
|
+
#
|
|
30
|
+
# Settings (environment variables, step 2):
|
|
31
|
+
# PMOS_SEED=<file> the pack made by `move` (move sets it)
|
|
32
|
+
# PMOS_USER=<name> the user to make when there is no pack (default: pmos)
|
|
33
|
+
# PMOS_PKG=<spec> the create-pmos release (default: the newest that downloads)
|
|
34
|
+
# PMOS_NO_SYSTEMD=1 write the minute check but do not install the timer (containers, tests)
|
|
35
|
+
# PMOS_NO_FIREWALL=1 leave the firewall alone
|
|
36
|
+
# PMOS_SKIP_CLAUDE=1 do not install Claude Code (tests)
|
|
37
|
+
set -euo pipefail
|
|
38
|
+
|
|
39
|
+
SCRIPT_URL="${PMOS_SCRIPT_URL:-https://unpkg.com/create-pmos/cloud-setup.sh}"
|
|
40
|
+
INSTALL_URL="${PMOS_INSTALL_URL:-https://unpkg.com/create-pmos/install.sh}"
|
|
41
|
+
RC_SESSION=pmos-remote-control
|
|
42
|
+
|
|
43
|
+
say() { printf '\033[1m==>\033[0m %s\n' "$*"; }
|
|
44
|
+
ok() { printf ' \033[32m✓\033[0m %s\n' "$*"; }
|
|
45
|
+
note() { printf ' %s\n' "$*"; }
|
|
46
|
+
fail() { printf '\n\033[31m✗ %s\033[0m\n' "$1" >&2; [ -n "${2:-}" ] && printf ' Try: %s\n' "$2" >&2; exit 1; }
|
|
47
|
+
have() { command -v "$1" >/dev/null 2>&1; }
|
|
48
|
+
|
|
49
|
+
# ── The workspace's own files, wherever npm put them (the same lookup on the Mac and the server) ─────────────────
|
|
50
|
+
ws_dir() {
|
|
51
|
+
local r; r="$(npm root -g 2>/dev/null || true)"
|
|
52
|
+
[ -n "$r" ] && [ -f "$r/pmos-workspace/package.json" ] && { echo "$r/pmos-workspace"; return; }
|
|
53
|
+
local b; b="$(command -v pmos 2>/dev/null || true)"
|
|
54
|
+
[ -n "$b" ] && node -e 'const fs=require("fs"),p=require("path");console.log(p.resolve(p.dirname(fs.realpathSync(process.argv[1])),".."))' "$b" 2>/dev/null
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
state_dir() {
|
|
58
|
+
if [ -n "${PMOS_STATE_DIR:-}" ]; then echo "$PMOS_STATE_DIR"
|
|
59
|
+
elif [ "$(uname -s)" = Darwin ]; then echo "$HOME/Library/Application Support/pmos"
|
|
60
|
+
elif [ -n "${XDG_STATE_HOME:-}" ]; then echo "$XDG_STATE_HOME/pmos"
|
|
61
|
+
else echo "$HOME/.local/state/pmos"; fi
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
# ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
65
|
+
# move <user@host> — on the Mac: pack PMOS, stop it here, copy the pack to the server and set the server up.
|
|
66
|
+
# ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
67
|
+
cmd_move() {
|
|
68
|
+
local target="${1:-}"
|
|
69
|
+
[ -n "$target" ] || fail "Name the server." "curl -fsSL $SCRIPT_URL | bash -s -- move root@<server-ip>"
|
|
70
|
+
have pmos || fail "pmos is not installed on this computer." "run this on the Mac that runs PMOS"
|
|
71
|
+
local STATE; STATE="$(state_dir)"
|
|
72
|
+
[ -f "$STATE/workspaces.json" ] || fail "No PMOS state folder at $STATE." "run this on the Mac that runs PMOS"
|
|
73
|
+
|
|
74
|
+
say "Checking that this Mac can reach $target"
|
|
75
|
+
ssh -o BatchMode=yes -o ConnectTimeout=15 -o StrictHostKeyChecking=accept-new "$target" true </dev/null \
|
|
76
|
+
|| fail "Could not sign in to $target with this Mac's SSH key." "add this Mac's key (cat ~/.ssh/id_ed25519.pub) to the server, then paste the line again"
|
|
77
|
+
ok "reached $target"
|
|
78
|
+
|
|
79
|
+
local WS; WS="$(ws_dir)"
|
|
80
|
+
local tmp; tmp="$(mktemp -d)"
|
|
81
|
+
# The repositories PMOS hosts, as paths under the home folder; the first is the one the minute check names.
|
|
82
|
+
node -e '
|
|
83
|
+
const fs = require("fs"), path = require("path"), home = process.env.HOME;
|
|
84
|
+
const reg = JSON.parse(fs.readFileSync(process.argv[1], "utf8"));
|
|
85
|
+
const roots = reg.map((w) => w.root).filter((r) => r && fs.existsSync(r) && r.startsWith(home + "/"));
|
|
86
|
+
// The minute check names one repository; a product with the PMOS kit, so the server-side install adds nothing to it.
|
|
87
|
+
const first = roots.find((r) => fs.existsSync(path.join(r, "pmos", "AGENTS.md"))) || roots[0] || "";
|
|
88
|
+
fs.writeFileSync(process.argv[2], roots.map((r) => path.relative(home, r)).join("\n") + "\n");
|
|
89
|
+
console.log(first);
|
|
90
|
+
' "$STATE/workspaces.json" "$tmp/repos.txt" >"$tmp/first.txt"
|
|
91
|
+
local FIRST; FIRST="$(cat "$tmp/first.txt")"
|
|
92
|
+
[ -n "$FIRST" ] || fail "No registered repository was found under $HOME."
|
|
93
|
+
|
|
94
|
+
# The Claude profile unattended work runs as (Settings › Claude), and the folder it keeps its sign-in in.
|
|
95
|
+
local PROFILE="" CLAUDE_DIR=""
|
|
96
|
+
PROFILE="$(node -e 'try{const p=JSON.parse(require("fs").readFileSync(process.argv[1],"utf8"));if(p&&typeof p.claude==="string")console.log(p.claude)}catch{}' "$STATE/prefs.json")"
|
|
97
|
+
if [ -n "$PROFILE" ] && [ -n "$WS" ]; then
|
|
98
|
+
CLAUDE_DIR="$(node -e 'const r=require(process.argv[1]).resolveProfile(process.argv[2],process.env.HOME);if(r&&r.configDir)console.log(r.configDir)' "$WS/lib/launcher-cli.js" "$PROFILE" 2>/dev/null || true)"
|
|
99
|
+
fi
|
|
100
|
+
ok "Claude profile: ${PROFILE:-the default Claude login}${CLAUDE_DIR:+ ($CLAUDE_DIR)}"
|
|
101
|
+
|
|
102
|
+
say "Stopping PMOS on this Mac (nothing is deleted)"
|
|
103
|
+
# Online off first, so the Mac's tunnel does not answer pmos.pm-os.app beside the server's. The server turns it on
|
|
104
|
+
# when it was on here and the tunnel files came along.
|
|
105
|
+
local ONLINE=0
|
|
106
|
+
node -e 'try{process.exit(JSON.parse(require("fs").readFileSync(process.argv[1],"utf8")).on===true?0:1)}catch{process.exit(1)}' "$STATE/online.json" && ONLINE=1
|
|
107
|
+
if [ -f "$STATE/online.json" ]; then
|
|
108
|
+
node -e 'const fs=require("fs"),f=process.argv[1];const o=JSON.parse(fs.readFileSync(f,"utf8"));o.on=false;fs.writeFileSync(f,JSON.stringify(o),{mode:0o600})' "$STATE/online.json" \
|
|
109
|
+
&& ok "Online off on this Mac"
|
|
110
|
+
fi
|
|
111
|
+
if [ "$(uname -s)" = Darwin ]; then
|
|
112
|
+
launchctl disable "gui/$(id -u)/com.pmos.workspace" 2>/dev/null || true
|
|
113
|
+
launchctl bootout "gui/$(id -u)/com.pmos.workspace" 2>/dev/null || true
|
|
114
|
+
ok "minute check paused (Remote Control keeps running, so Claude can still reach this Mac)"
|
|
115
|
+
fi
|
|
116
|
+
(cd "$FIRST" && pmos stop </dev/null >/dev/null 2>&1 || true)
|
|
117
|
+
pkill -f 'cloudflared tunnel --no-autoupdate run' 2>/dev/null || true
|
|
118
|
+
ok "workspace stopped"
|
|
119
|
+
|
|
120
|
+
say "Packing PMOS"
|
|
121
|
+
printf 'PM_USER=%q\nPM_HOME=%q\nPM_FIRST=%q\nPM_PROFILE=%q\nPM_CLAUDE_DIR=%q\nPM_ONLINE=%q\nPM_FROM=%q\nPM_AT=%q\n' \
|
|
122
|
+
"$(id -un)" "$HOME" "$FIRST" "$PROFILE" "$CLAUDE_DIR" "$ONLINE" "$(hostname)" "$(date -u +%FT%TZ)" >"$tmp/meta.env"
|
|
123
|
+
# COPYFILE_DISABLE: no macOS ._ files. Sockets and node_modules stay behind; everything else in the state folder goes.
|
|
124
|
+
COPYFILE_DISABLE=1 tar -czf "$tmp/state.tgz" -C "$STATE" --exclude='*.sock' --exclude='node_modules' --exclude='*.partial' .
|
|
125
|
+
# Plain strings, not arrays: the Mac's /bin/bash is 3.2, where an empty array under `set -u` is an error.
|
|
126
|
+
local nrepos extra="" p; nrepos="$(wc -l <"$tmp/repos.txt" | tr -d ' ')"
|
|
127
|
+
for p in .cloudflared .claude/profiles .gitconfig; do [ -e "$HOME/$p" ] && extra="$extra, $p" && echo "$p" >>"$tmp/repos.txt"; done
|
|
128
|
+
COPYFILE_DISABLE=1 tar -czf "$tmp/home.tgz" -C "$HOME" --exclude='node_modules' --exclude='.DS_Store' -T "$tmp/repos.txt"
|
|
129
|
+
tar -cf "$tmp/pmos-seed.tar" -C "$tmp" meta.env state.tgz home.tgz
|
|
130
|
+
ok "$(du -h "$tmp/pmos-seed.tar" | cut -f1) — $nrepos repositories, the state folder$extra"
|
|
131
|
+
|
|
132
|
+
say "Copying the pack to $target"
|
|
133
|
+
scp -q "$tmp/pmos-seed.tar" "$target:pmos-seed.tar" </dev/null || fail "The copy to $target failed." "paste the line again"
|
|
134
|
+
rm -rf "$tmp"
|
|
135
|
+
ok "copied"
|
|
136
|
+
|
|
137
|
+
say "Setting up the server"
|
|
138
|
+
# The variables are on the command line, so sudo keeps them. </dev/tty: under `curl | bash` stdin is the script,
|
|
139
|
+
# and the server setup shows its progress in a real terminal.
|
|
140
|
+
ssh -t "$target" "curl -fsSL '$SCRIPT_URL' -o /tmp/pmos-cloud-setup.sh && sudo PMOS_SEED=\"\$HOME/pmos-seed.tar\" ${PMOS_PKG:+PMOS_PKG='$PMOS_PKG'} bash /tmp/pmos-cloud-setup.sh" </dev/tty \
|
|
141
|
+
|| fail "The server setup stopped with an error (shown above)." "fix it, then on this Mac: curl -fsSL $SCRIPT_URL | bash -s -- move $target"
|
|
142
|
+
echo
|
|
143
|
+
ok "PMOS moved. This Mac is the fallback: \`curl -fsSL $SCRIPT_URL | bash -s -- mac-on\` turns it back on."
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
# mac-on — on the Mac: undo the stop that `move` did (turn the minute check on; Online is turned on in Settings).
|
|
147
|
+
cmd_mac_on() {
|
|
148
|
+
[ "$(uname -s)" = Darwin ] || fail "mac-on is for the Mac."
|
|
149
|
+
launchctl enable "gui/$(id -u)/com.pmos.workspace" 2>/dev/null || true
|
|
150
|
+
launchctl bootstrap "gui/$(id -u)" "$HOME/Library/LaunchAgents/com.pmos.workspace.plist" 2>/dev/null || true
|
|
151
|
+
ok "minute check on; PMOS starts within a minute"
|
|
152
|
+
note "Turn Online on in Settings › Online here, and stop the server first (ssh -t <user>@<server-ip> pmos-cloud stop),"
|
|
153
|
+
note "so only one computer answers pmos.pm-os.app."
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
# ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
157
|
+
# setup — on the server, as root.
|
|
158
|
+
# ════════════════════════════════════════════════════════════════════════════════════════════════════════════════
|
|
159
|
+
cmd_setup() {
|
|
160
|
+
[ "$(uname -s)" = Linux ] || fail "The server setup is for Linux. On the Mac, use: bash -s -- move root@<server-ip>"
|
|
161
|
+
[ "$(id -u)" = 0 ] || fail "Run the server setup as root." "curl -fsSL $SCRIPT_URL | sudo bash"
|
|
162
|
+
have apt-get || fail "This setup needs Ubuntu or Debian (apt-get)."
|
|
163
|
+
|
|
164
|
+
# ── 1. The pack ──────────────────────────────────────────────────────────────────────────────────────────────
|
|
165
|
+
local SEED_DIR="" PM_USER="${PMOS_USER:-pmos}" PM_HOME="" PM_FIRST="" PM_PROFILE="" PM_CLAUDE_DIR="" PM_ONLINE=0 PM_FROM="" PM_AT=""
|
|
166
|
+
if [ -n "${PMOS_SEED:-}" ]; then
|
|
167
|
+
[ -f "$PMOS_SEED" ] || fail "No pack at $PMOS_SEED."
|
|
168
|
+
SEED_DIR="$(mktemp -d)"
|
|
169
|
+
tar -xf "$PMOS_SEED" -C "$SEED_DIR"
|
|
170
|
+
# shellcheck disable=SC1091
|
|
171
|
+
. "$SEED_DIR/meta.env"
|
|
172
|
+
say "Pack from $PM_FROM, made $PM_AT"
|
|
173
|
+
fi
|
|
174
|
+
PM_HOME="${PM_HOME:-/home/$PM_USER}"
|
|
175
|
+
PM_FIRST="${PM_FIRST:-$PM_HOME/PMOS}"
|
|
176
|
+
case "$PM_USER" in root|'') fail "PMOS runs as a normal user, not root.";; esac
|
|
177
|
+
|
|
178
|
+
# ── 2. System packages ───────────────────────────────────────────────────────────────────────────────────────
|
|
179
|
+
say "Installing system packages"
|
|
180
|
+
export DEBIAN_FRONTEND=noninteractive
|
|
181
|
+
apt-get update -qq
|
|
182
|
+
apt-get install -y -qq git tmux build-essential python3 curl ca-certificates gnupg ufw gh >/dev/null 2>&1 \
|
|
183
|
+
|| apt-get install -y -qq git tmux build-essential python3 curl ca-certificates gnupg ufw >/dev/null
|
|
184
|
+
ok "git, tmux, build tools$(have gh && echo ', GitHub CLI')"
|
|
185
|
+
if ! have cloudflared; then
|
|
186
|
+
mkdir -p --mode=0755 /usr/share/keyrings
|
|
187
|
+
curl -fsSL https://pkg.cloudflare.com/cloudflare-main.gpg -o /usr/share/keyrings/cloudflare-main.gpg
|
|
188
|
+
echo 'deb [signed-by=/usr/share/keyrings/cloudflare-main.gpg] https://pkg.cloudflare.com/cloudflared any main' >/etc/apt/sources.list.d/cloudflared.list
|
|
189
|
+
apt-get update -qq && apt-get install -y -qq cloudflared >/dev/null
|
|
190
|
+
fi
|
|
191
|
+
ok "$(cloudflared --version 2>/dev/null | head -1 || echo 'cloudflared')"
|
|
192
|
+
if [ "${PMOS_NO_FIREWALL:-}" != 1 ] && have ufw; then
|
|
193
|
+
ufw allow OpenSSH >/dev/null && ufw --force enable >/dev/null && ok "firewall on: SSH only (PMOS listens on this server only; Cloudflare reaches it from inside)"
|
|
194
|
+
fi
|
|
195
|
+
|
|
196
|
+
# ── 3. The user ──────────────────────────────────────────────────────────────────────────────────────────────
|
|
197
|
+
say "Setting up the user $PM_USER ($PM_HOME)"
|
|
198
|
+
if ! id "$PM_USER" >/dev/null 2>&1; then
|
|
199
|
+
mkdir -p "$(dirname "$PM_HOME")"
|
|
200
|
+
useradd -m -d "$PM_HOME" -s /bin/bash "$PM_USER"
|
|
201
|
+
ok "user made (the same home folder as on the Mac, so every path and product id stays valid)"
|
|
202
|
+
else ok "user exists"; fi
|
|
203
|
+
if [ -f /root/.ssh/authorized_keys ] && [ ! -f "$PM_HOME/.ssh/authorized_keys" ]; then
|
|
204
|
+
install -d -m 700 -o "$PM_USER" -g "$PM_USER" "$PM_HOME/.ssh"
|
|
205
|
+
install -m 600 -o "$PM_USER" -g "$PM_USER" /root/.ssh/authorized_keys "$PM_HOME/.ssh/authorized_keys"
|
|
206
|
+
ok "your SSH key signs in as $PM_USER too"
|
|
207
|
+
fi
|
|
208
|
+
loginctl enable-linger "$PM_USER" >/dev/null 2>&1 || true
|
|
209
|
+
|
|
210
|
+
# ── 4. Unpack ────────────────────────────────────────────────────────────────────────────────────────────────
|
|
211
|
+
local STATE="$PM_HOME/.local/state/pmos"
|
|
212
|
+
if [ -n "$SEED_DIR" ]; then
|
|
213
|
+
say "Unpacking"
|
|
214
|
+
# Repositories and files that are already here are kept: a second run never overwrites cloud work.
|
|
215
|
+
tar -xzf "$SEED_DIR/home.tgz" -C "$PM_HOME" --skip-old-files --warning=no-unknown-keyword --no-same-owner
|
|
216
|
+
ok "repositories and settings files"
|
|
217
|
+
if [ -f "$STATE/workspaces.json" ]; then
|
|
218
|
+
note "the state folder is already here; kept it (the pack's copy is not used)"
|
|
219
|
+
else
|
|
220
|
+
mkdir -p "$STATE"
|
|
221
|
+
tar -xzf "$SEED_DIR/state.tgz" -C "$STATE" --warning=no-unknown-keyword --no-same-owner
|
|
222
|
+
ok "state folder (chats, notes, settings, Online)"
|
|
223
|
+
# Online was on at the Mac and its tunnel files came along: on here too (the same tunnel; only this server runs it now).
|
|
224
|
+
if [ "$PM_ONLINE" = 1 ] && [ -f "$PM_HOME/.cloudflared/config.yml" ] && [ -f "$STATE/online.json" ]; then
|
|
225
|
+
sed -i 's/"on":false/"on":true/' "$STATE/online.json" && ok "Online on (the Mac's tunnel files came along)"
|
|
226
|
+
fi
|
|
227
|
+
fi
|
|
228
|
+
chown -R "$PM_USER:$PM_USER" "$PM_HOME"
|
|
229
|
+
rm -rf "$SEED_DIR"
|
|
230
|
+
fi
|
|
231
|
+
|
|
232
|
+
# ── 5. Node, Claude Code and PMOS, as the user ───────────────────────────────────────────────────────────────
|
|
233
|
+
say "Installing Node, Claude Code and PMOS for $PM_USER"
|
|
234
|
+
local inst; inst="$(mktemp)"
|
|
235
|
+
local here="${BASH_SOURCE[0]:-}"
|
|
236
|
+
if [ -f "$here" ] && [ -f "$(dirname "$here")/install.sh" ]; then cp "$(dirname "$here")/install.sh" "$inst"; else curl -fsSL "$INSTALL_URL" -o "$inst"; fi
|
|
237
|
+
chmod 644 "$inst"
|
|
238
|
+
sudo -u "$PM_USER" -H env PMOS_DIR="$PM_FIRST" PMOS_NO_OPEN=1 ${PMOS_PKG:+PMOS_PKG="$PMOS_PKG"} ${PMOS_SKIP_CLAUDE:+PMOS_SKIP_CLAUDE=1} SHELL=/bin/bash \
|
|
239
|
+
bash -c 'cd ~ && bash "$0"' "$inst" </dev/null || fail "The PMOS install stopped with an error (shown above)." "paste the line again"
|
|
240
|
+
rm -f "$inst"
|
|
241
|
+
|
|
242
|
+
# ── 6. Git on Linux: no macOS keychain; GitHub over HTTPS through the GitHub CLI's sign-in ─────────────────────
|
|
243
|
+
sudo -u "$PM_USER" -H bash -c '
|
|
244
|
+
git config --global --get-all credential.helper 2>/dev/null | grep -q osxkeychain && git config --global --unset-all credential.helper osxkeychain
|
|
245
|
+
git config --global url."https://github.com/".insteadOf "git@github.com:"
|
|
246
|
+
true'
|
|
247
|
+
|
|
248
|
+
# ── 7. The Claude profile (Settings › Claude) ────────────────────────────────────────────────────────────────
|
|
249
|
+
if [ -n "$PM_PROFILE" ] && [ -n "$PM_CLAUDE_DIR" ]; then
|
|
250
|
+
# The same command name as on the Mac, so PMOS finds the profile the way it does there (an alias that sets
|
|
251
|
+
# CLAUDE_CONFIG_DIR). The sign-in itself is `pmos-cloud signin`.
|
|
252
|
+
sudo -u "$PM_USER" -H bash -c 'mkdir -p "$1"; grep -qs "alias $2=" ~/.bashrc || printf "\nalias %s='"'"'CLAUDE_CONFIG_DIR=%s claude'"'"' # added by PMOS cloud setup\n" "$2" "$1" >>~/.bashrc' _ "$PM_CLAUDE_DIR" "$PM_PROFILE"
|
|
253
|
+
ok "Claude profile $PM_PROFILE ($PM_CLAUDE_DIR)"
|
|
254
|
+
fi
|
|
255
|
+
|
|
256
|
+
# ── 8. The minute check ──────────────────────────────────────────────────────────────────────────────────────
|
|
257
|
+
say "Adding the minute check"
|
|
258
|
+
local CLOUD="$PM_HOME/.pmos/cloud"
|
|
259
|
+
install -d -o "$PM_USER" -g "$PM_USER" "$CLOUD"
|
|
260
|
+
# Where install.sh put node (and so pmos) and claude; a systemd job has no shell profile.
|
|
261
|
+
local found; found="$(sudo -u "$PM_USER" -H bash -lc 'printf "%s:%s/bin:" "$(dirname "$(command -v node)")" "$(npm prefix -g)"' 2>/dev/null || true)"
|
|
262
|
+
local UPATH="$found$PM_HOME/.pmos/node/bin:$PM_HOME/.pmos/npm-global/bin:$PM_HOME/.local/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
|
|
263
|
+
printf 'REPO=%q\nPATH=%q\nCLAUDE_DIR=%q\nRC_NAME=%q\n' "$PM_FIRST" "$UPATH" "${PM_CLAUDE_DIR:-}" "PMOS cloud ($(hostname))" >"$CLOUD/env"
|
|
264
|
+
cat >"$CLOUD/keep.sh" <<'KEEP'
|
|
265
|
+
#!/bin/bash
|
|
266
|
+
# Written by cloud-setup.sh. systemd (pmos-keep.timer) runs it every minute, like the Mac's login item.
|
|
267
|
+
# 1. `pmos up --keep`: silent when the workspace answers; starts it when it is down; replaces one stuck for a minute.
|
|
268
|
+
# 2. After `pmos-cloud signin`: keeps `claude remote-control` running in tmux, so Claude can reach this server.
|
|
269
|
+
. "$HOME/.pmos/cloud/env"; export PATH
|
|
270
|
+
LOG="$HOME/.pmos/cloud/keep.log"
|
|
271
|
+
[ -f "$HOME/.pmos/cloud/stopped" ] && exit 0 # `pmos-cloud stop`
|
|
272
|
+
pmos up "$REPO" --no-open --keep >>"$LOG" 2>&1
|
|
273
|
+
if [ -f "$HOME/.pmos/cloud/remote-control.on" ] && ! tmux has-session -t pmos-remote-control 2>/dev/null; then
|
|
274
|
+
echo "$(date -u +%FT%TZ) remote-control: starting" >>"$LOG"
|
|
275
|
+
cd "$REPO" && tmux new-session -d -s pmos-remote-control \
|
|
276
|
+
"${CLAUDE_DIR:+CLAUDE_CONFIG_DIR='$CLAUDE_DIR' }claude remote-control --name '$RC_NAME' --permission-mode auto"
|
|
277
|
+
fi
|
|
278
|
+
# Keep the log small.
|
|
279
|
+
[ "$(wc -c <"$LOG")" -gt 1000000 ] && tail -c 200000 "$LOG" >"$LOG.tmp" && mv "$LOG.tmp" "$LOG"
|
|
280
|
+
exit 0
|
|
281
|
+
KEEP
|
|
282
|
+
chmod 755 "$CLOUD/keep.sh"; chown "$PM_USER:$PM_USER" "$CLOUD/env" "$CLOUD/keep.sh"
|
|
283
|
+
|
|
284
|
+
if [ "${PMOS_NO_SYSTEMD:-}" = 1 ] || ! have systemctl || [ ! -d /run/systemd/system ]; then
|
|
285
|
+
note "no systemd here: run $CLOUD/keep.sh yourself (PMOS_NO_SYSTEMD)"
|
|
286
|
+
else
|
|
287
|
+
cat >/etc/systemd/system/pmos-keep.service <<UNIT
|
|
288
|
+
[Unit]
|
|
289
|
+
Description=PMOS minute check (pmos up --keep, Remote Control keeper)
|
|
290
|
+
After=network-online.target
|
|
291
|
+
Wants=network-online.target
|
|
292
|
+
|
|
293
|
+
[Service]
|
|
294
|
+
Type=oneshot
|
|
295
|
+
User=$PM_USER
|
|
296
|
+
WorkingDirectory=$PM_HOME
|
|
297
|
+
ExecStart=$CLOUD/keep.sh
|
|
298
|
+
# The workspace server and the tmux sessions it starts must outlive this check.
|
|
299
|
+
KillMode=process
|
|
300
|
+
UNIT
|
|
301
|
+
cat >/etc/systemd/system/pmos-keep.timer <<'UNIT'
|
|
302
|
+
[Unit]
|
|
303
|
+
Description=Run the PMOS minute check every minute
|
|
304
|
+
|
|
305
|
+
[Timer]
|
|
306
|
+
OnBootSec=20
|
|
307
|
+
OnUnitActiveSec=60
|
|
308
|
+
AccuracySec=5
|
|
309
|
+
|
|
310
|
+
[Install]
|
|
311
|
+
WantedBy=timers.target
|
|
312
|
+
UNIT
|
|
313
|
+
systemctl daemon-reload
|
|
314
|
+
systemctl enable --now pmos-keep.timer >/dev/null 2>&1
|
|
315
|
+
ok "pmos-keep.timer: every minute, and 20 s after a restart"
|
|
316
|
+
fi
|
|
317
|
+
|
|
318
|
+
# ── 9. The helper command ────────────────────────────────────────────────────────────────────────────────────
|
|
319
|
+
write_helper >/usr/local/bin/pmos-cloud
|
|
320
|
+
chmod 755 /usr/local/bin/pmos-cloud
|
|
321
|
+
ok "pmos-cloud: status, signin, online, add, logs, stop, start"
|
|
322
|
+
|
|
323
|
+
# ── 10. Check ────────────────────────────────────────────────────────────────────────────────────────────────
|
|
324
|
+
say "Checking"
|
|
325
|
+
sudo -u "$PM_USER" -H "$CLOUD/keep.sh"
|
|
326
|
+
sleep 3
|
|
327
|
+
sudo -u "$PM_USER" -H /usr/local/bin/pmos-cloud status || true
|
|
328
|
+
|
|
329
|
+
local IP; IP="$(curl -fsS -4 --max-time 5 https://api.ipify.org 2>/dev/null || hostname -I | awk '{print $1}')"
|
|
330
|
+
echo
|
|
331
|
+
ok "PMOS runs on this server."
|
|
332
|
+
echo
|
|
333
|
+
echo " Your one step left: sign in to Claude and GitHub (about two minutes):"
|
|
334
|
+
echo
|
|
335
|
+
echo " ssh -t $PM_USER@$IP pmos-cloud signin"
|
|
336
|
+
echo
|
|
337
|
+
if [ ! -f "$PM_HOME/.cloudflared/config.yml" ]; then
|
|
338
|
+
echo " Then, for pmos.pm-os.app: ssh -t $PM_USER@$IP pmos-cloud online pmos.pm-os.app"
|
|
339
|
+
echo
|
|
340
|
+
fi
|
|
341
|
+
echo " Open PMOS without Cloudflare: ssh -N -L 7433:127.0.0.1:7433 $PM_USER@$IP then http://localhost:7433"
|
|
342
|
+
}
|
|
343
|
+
|
|
344
|
+
# The `pmos-cloud` helper, installed to /usr/local/bin. It runs as the PMOS user.
|
|
345
|
+
write_helper() {
|
|
346
|
+
cat <<'HELPER'
|
|
347
|
+
#!/bin/bash
|
|
348
|
+
# pmos-cloud — look after PMOS on this server (written by create-pmos cloud-setup.sh; guide: "Run PMOS in the cloud").
|
|
349
|
+
set -uo pipefail
|
|
350
|
+
. "$HOME/.pmos/cloud/env" 2>/dev/null || { echo "PMOS cloud setup is not on this user. Sign in as the PMOS user."; exit 1; }
|
|
351
|
+
export PATH
|
|
352
|
+
CLOUD="$HOME/.pmos/cloud"
|
|
353
|
+
cl() { if [ -n "${CLAUDE_DIR:-}" ]; then CLAUDE_CONFIG_DIR="$CLAUDE_DIR" claude "$@"; else claude "$@"; fi; }
|
|
354
|
+
claude_signed_in() { cl auth status --json 2>/dev/null | grep -q '"loggedIn": *true' || [ -s "${CLAUDE_DIR:-$HOME/.claude}/.credentials.json" ]; }
|
|
355
|
+
case "${1:-status}" in
|
|
356
|
+
status)
|
|
357
|
+
echo "PMOS cloud — $(hostname)"
|
|
358
|
+
v="$(node -p 'require(require("child_process").execSync("npm root -g").toString().trim()+"/pmos-workspace/package.json").version' 2>/dev/null)"
|
|
359
|
+
if (cd "$REPO" && pmos status 2>/dev/null | grep -q '✓ running'); then echo " ✓ workspace: running${v:+ ($v)}"; else echo " ✗ workspace: not answering (the minute check starts it; see: pmos-cloud logs)"; fi
|
|
360
|
+
if claude_signed_in; then echo " ✓ Claude: signed in${CLAUDE_DIR:+ ($CLAUDE_DIR)}"; else echo " ✗ Claude: not signed in — run: pmos-cloud signin"; fi
|
|
361
|
+
if tmux has-session -t pmos-remote-control 2>/dev/null; then echo " ✓ Remote Control: running as \"$RC_NAME\""; elif [ -f "$CLOUD/remote-control.on" ]; then echo " … Remote Control: starts within a minute"; else echo " ○ Remote Control: starts after the sign-in"; fi
|
|
362
|
+
if gh auth status >/dev/null 2>&1; then echo " ✓ GitHub: signed in (records sync)"; else echo " ○ GitHub: not signed in — run: pmos-cloud signin"; fi
|
|
363
|
+
if pgrep -u "$(id -u)" -f 'cloudflared tunnel' >/dev/null; then echo " ✓ Online: the tunnel runs"; elif [ -f "$HOME/.cloudflared/config.yml" ]; then echo " ○ Online: tunnel files are here; turn Online on in Settings › Online"; else echo " ○ Online: not set up — run: pmos-cloud online pmos.pm-os.app"; fi
|
|
364
|
+
;;
|
|
365
|
+
signin)
|
|
366
|
+
if claude_signed_in; then echo "✓ Claude is signed in."
|
|
367
|
+
else
|
|
368
|
+
echo "Claude: open the link it shows on any device, sign in with your Claude account, and paste the code back here."
|
|
369
|
+
mkdir -p "${CLAUDE_DIR:-$HOME/.claude}"
|
|
370
|
+
(cd "$REPO" && cl auth login --claudeai)
|
|
371
|
+
claude_signed_in && echo "✓ Claude signed in." || echo "✗ Claude is still not signed in. Run: pmos-cloud signin"
|
|
372
|
+
fi
|
|
373
|
+
if gh auth status >/dev/null 2>&1; then echo "✓ GitHub is signed in."
|
|
374
|
+
elif command -v gh >/dev/null; then
|
|
375
|
+
echo "GitHub: open the link it shows, enter the code, and allow access. PMOS uses it to sync records."
|
|
376
|
+
gh auth login --hostname github.com --git-protocol https --web && gh auth setup-git && echo "✓ GitHub signed in."
|
|
377
|
+
fi
|
|
378
|
+
if claude_signed_in; then
|
|
379
|
+
touch "$CLOUD/remote-control.on"; "$CLOUD/keep.sh"; sleep 3
|
|
380
|
+
if tmux has-session -t pmos-remote-control 2>/dev/null; then
|
|
381
|
+
echo "Remote Control runs as \"$RC_NAME\". It opens now: answer any question it asks (such as trusting the folder),"
|
|
382
|
+
echo "then press Ctrl-B and then D. It keeps running after you leave."
|
|
383
|
+
read -r -p "Press Enter to open it. " _
|
|
384
|
+
tmux attach -t pmos-remote-control
|
|
385
|
+
else echo "✗ Remote Control stopped at once. See: tmux new -s rc-test 'claude remote-control'"; fi
|
|
386
|
+
fi
|
|
387
|
+
;;
|
|
388
|
+
online)
|
|
389
|
+
HOST="${2:-pmos.pm-os.app}"; TUNNEL="${3:-pmos}"
|
|
390
|
+
command -v cloudflared >/dev/null || { echo "cloudflared is missing; run the setup again."; exit 1; }
|
|
391
|
+
[ -f "$HOME/.cloudflared/cert.pem" ] || { echo "Cloudflare: open the link, sign in, and pick the domain of $HOST."; cloudflared tunnel login || exit 1; }
|
|
392
|
+
ID="$(cloudflared tunnel list -o json -n "$TUNNEL" 2>/dev/null | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>{try{const t=JSON.parse(s)[0];if(t)console.log(t.id)}catch{}})')"
|
|
393
|
+
if [ -z "$ID" ]; then
|
|
394
|
+
cloudflared tunnel create "$TUNNEL" >/dev/null || exit 1
|
|
395
|
+
ID="$(cloudflared tunnel list -o json -n "$TUNNEL" | node -e 'let s="";process.stdin.on("data",d=>s+=d).on("end",()=>console.log(JSON.parse(s)[0].id))')"
|
|
396
|
+
cloudflared tunnel route dns "$TUNNEL" "$HOST"
|
|
397
|
+
fi
|
|
398
|
+
# The existing tunnel and its DNS record stay; this server gets its own copy of the tunnel's credentials.
|
|
399
|
+
[ -f "$HOME/.cloudflared/$ID.json" ] || cloudflared tunnel token --cred-file "$HOME/.cloudflared/$ID.json" "$TUNNEL" >/dev/null || exit 1
|
|
400
|
+
DOMAIN="${HOST#*.}"
|
|
401
|
+
cat >"$HOME/.cloudflared/config.yml" <<YML
|
|
402
|
+
tunnel: $TUNNEL
|
|
403
|
+
credentials-file: $HOME/.cloudflared/$ID.json
|
|
404
|
+
ingress:
|
|
405
|
+
- hostname: $HOST
|
|
406
|
+
service: http://127.0.0.1:7433
|
|
407
|
+
- hostname: share.$DOMAIN
|
|
408
|
+
service: http://127.0.0.1:7434
|
|
409
|
+
- service: http_status:404
|
|
410
|
+
YML
|
|
411
|
+
echo "✓ Tunnel $TUNNEL ($ID) is ready for $HOST."
|
|
412
|
+
echo " Now turn Online on in Settings › Online (open PMOS through: ssh -N -L 7433:127.0.0.1:7433 $(id -un)@<server-ip>)."
|
|
413
|
+
echo " Make sure Online is off on the Mac, so only this server answers $HOST."
|
|
414
|
+
;;
|
|
415
|
+
add)
|
|
416
|
+
shift; [ $# -gt 0 ] || { echo "usage: pmos-cloud add <owner/repo | git URL>..."; exit 1; }
|
|
417
|
+
mkdir -p "$HOME/Project"
|
|
418
|
+
for r in "$@"; do
|
|
419
|
+
case "$r" in http*|git@*) url="$r";; *) url="https://github.com/$r.git";; esac
|
|
420
|
+
dir="$HOME/Project/$(basename "$r" .git)"
|
|
421
|
+
[ -d "$dir/.git" ] || git clone -q "$url" "$dir" || { echo "✗ could not clone $r"; continue; }
|
|
422
|
+
pmos "$dir" --no-open >/dev/null 2>&1 && echo "✓ $dir"
|
|
423
|
+
done
|
|
424
|
+
;;
|
|
425
|
+
logs) tail -n "${2:-60}" "$CLOUD/keep.log" ;;
|
|
426
|
+
stop) rm -f "$CLOUD/remote-control.on"; touch "$CLOUD/stopped"; (cd "$REPO" && pmos stop); tmux kill-session -t pmos-remote-control 2>/dev/null; pkill -u "$(id -u)" -f 'cloudflared tunnel' 2>/dev/null; echo "✓ stopped. The minute check waits until: pmos-cloud start" ;;
|
|
427
|
+
start) rm -f "$CLOUD/stopped"; claude_signed_in && touch "$CLOUD/remote-control.on"; "$CLOUD/keep.sh"; echo "✓ started" ;;
|
|
428
|
+
*) echo "usage: pmos-cloud status | signin | online [host] [tunnel] | add <owner/repo>... | logs [n] | stop | start"; exit 1 ;;
|
|
429
|
+
esac
|
|
430
|
+
HELPER
|
|
431
|
+
}
|
|
432
|
+
|
|
433
|
+
case "${1:-setup}" in
|
|
434
|
+
move) shift; cmd_move "$@" ;;
|
|
435
|
+
mac-on) cmd_mac_on ;;
|
|
436
|
+
setup) cmd_setup ;;
|
|
437
|
+
*) fail "unknown command: $1" "move root@<server-ip> · mac-on · (no argument: set up this server)" ;;
|
|
438
|
+
esac
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "create-pmos",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.550.0",
|
|
4
4
|
"description": "Scaffold the PMOS portable kit — run the PMOS product-management workflow (initiative → lane-fit spec → contract → build → three gates, with work-type lanes for features, research, maintenance, incidents, and content) entirely inside your own repo, with all state as git-versioned files. Includes `workflow-sweep`, which audits the state every board derives from and separates real defects from work you simply have not done. `create-pmos workspace` also installs + launches the local Terminal Workspace GUI. No database, no network, no telemetry.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"bin": {
|
|
@@ -11,6 +11,7 @@
|
|
|
11
11
|
"payload/",
|
|
12
12
|
"workspace/",
|
|
13
13
|
"install.sh",
|
|
14
|
+
"cloud-setup.sh",
|
|
14
15
|
"install.ps1",
|
|
15
16
|
"README.md",
|
|
16
17
|
"LICENSE"
|
|
@@ -32,6 +33,19 @@
|
|
|
32
33
|
"audit"
|
|
33
34
|
],
|
|
34
35
|
"pmosChanges": [
|
|
36
|
+
{
|
|
37
|
+
"v": "0.550.0",
|
|
38
|
+
"at": "2026-11-10T08:31:44.572Z",
|
|
39
|
+
"f": 4,
|
|
40
|
+
"prs": [
|
|
41
|
+
{
|
|
42
|
+
"n": 1278,
|
|
43
|
+
"t": "Run PMOS on an always-on cloud server — one paste on the Mac moves it, the Mac stays as the fallback",
|
|
44
|
+
"s": "Run PMOS on an always-on cloud server — one paste on the Mac moves it, the Mac stays as the fallback",
|
|
45
|
+
"k": "new"
|
|
46
|
+
}
|
|
47
|
+
]
|
|
48
|
+
},
|
|
35
49
|
{
|
|
36
50
|
"v": "0.549.0",
|
|
37
51
|
"at": "2026-11-10T07:06:56.286Z",
|
|
@@ -350,19 +364,6 @@
|
|
|
350
364
|
"k": "new"
|
|
351
365
|
}
|
|
352
366
|
]
|
|
353
|
-
},
|
|
354
|
-
{
|
|
355
|
-
"v": "0.530.0",
|
|
356
|
-
"at": "2026-11-04T14:38:26.528Z",
|
|
357
|
-
"f": 4,
|
|
358
|
-
"prs": [
|
|
359
|
-
{
|
|
360
|
-
"n": 1246,
|
|
361
|
-
"t": "Send meeting captures to Jev and keep only the slide (MpJ)",
|
|
362
|
-
"s": "Send meeting captures to Jev and keep only the slide (MpJ)",
|
|
363
|
-
"k": "new"
|
|
364
|
-
}
|
|
365
|
-
]
|
|
366
367
|
}
|
|
367
368
|
]
|
|
368
369
|
}
|
package/payload/KIT-VERSION
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Eval calibration log"
|
|
4
4
|
description: "Append-only record of every PM override of an evaluator verdict."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-10T08:31:41Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Health budgets"
|
|
4
4
|
description: "Closed registry of health-budget anchors (D59), edited only by the PM."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-10T08:31:41Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
type: Reference
|
|
3
3
|
title: "Discoveries and friction log"
|
|
4
4
|
description: "Append-only record of what runs discovered and where the process rubbed."
|
|
5
|
-
generated: {by: process:create-pmos, at: "2026-11-
|
|
5
|
+
generated: {by: process:create-pmos, at: "2026-11-10T08:31:41Z"}
|
|
6
6
|
status: stable
|
|
7
7
|
---
|
|
8
8
|
|
package/workspace/changelog.json
CHANGED
|
@@ -1,4 +1,17 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"v": "0.550.0",
|
|
4
|
+
"at": "2026-11-10T08:31:44.572Z",
|
|
5
|
+
"f": 4,
|
|
6
|
+
"prs": [
|
|
7
|
+
{
|
|
8
|
+
"n": 1278,
|
|
9
|
+
"t": "Run PMOS on an always-on cloud server — one paste on the Mac moves it, the Mac stays as the fallback",
|
|
10
|
+
"s": "Run PMOS on an always-on cloud server — one paste on the Mac moves it, the Mac stays as the fallback",
|
|
11
|
+
"k": "new"
|
|
12
|
+
}
|
|
13
|
+
]
|
|
14
|
+
},
|
|
2
15
|
{
|
|
3
16
|
"v": "0.549.0",
|
|
4
17
|
"at": "2026-11-10T07:06:56.286Z",
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
---
|
|
2
|
+
type: Guide
|
|
3
|
+
title: "Run PMOS in the cloud"
|
|
4
|
+
timestamp: 2026-11-10
|
|
5
|
+
---
|
|
6
|
+
|
|
7
|
+
# Run PMOS in the cloud
|
|
8
|
+
|
|
9
|
+
PMOS can run on a small always-on Linux server instead of a Mac. The server keeps PMOS up, keeps Claude signed in, keeps Remote Control on and answers your Online address (such as `pmos.pm-os.app`). The Mac stays as the fallback: nothing on it is deleted, and one line turns it back on.
|
|
10
|
+
|
|
11
|
+
The server runs the same `pmos` as the Mac. Records still sync through each repository's own git remote. Your Jira and Slack reads come from the claude.ai connectors of the Claude account you sign in with.
|
|
12
|
+
|
|
13
|
+
## What you do
|
|
14
|
+
|
|
15
|
+
There are four steps. The first and the last need you, because they are accounts and sign-ins. The two pastes do everything else.
|
|
16
|
+
|
|
17
|
+
1. **Make the server (about 5 minutes).** Use [Hetzner Cloud](https://console.hetzner.cloud). Select **Add server** and set:
|
|
18
|
+
- **Location:** the one nearest to you (Singapore for South-East Asia).
|
|
19
|
+
- **Image:** Ubuntu 24.04.
|
|
20
|
+
- **Type:** shared vCPU, 4 vCPU and 8 GB RAM. Each Claude session uses up to 0.5 GB, and a smaller server slows down when several run.
|
|
21
|
+
- **SSH key:** paste the Mac's public key. To show it, run `cat ~/.ssh/id_ed25519.pub` on the Mac. If the file is missing, run `ssh-keygen -t ed25519` first.
|
|
22
|
+
- **Backups:** on. Hetzner then keeps a copy of the whole server every day.
|
|
23
|
+
|
|
24
|
+
Copy the server's IP address.
|
|
25
|
+
|
|
26
|
+
2. **On the Mac, paste one line.** Use the IP address from step 1:
|
|
27
|
+
|
|
28
|
+
```sh
|
|
29
|
+
curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash -s -- move root@<server-ip>
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
It takes about 10 minutes. It checks that the Mac can reach the server, then stops PMOS on the Mac. It copies PMOS to the server and starts it there.
|
|
33
|
+
|
|
34
|
+
3. **Sign in once (about 2 minutes).** From the Mac or any computer:
|
|
35
|
+
|
|
36
|
+
```sh
|
|
37
|
+
ssh -t <your-mac-user>@<server-ip> pmos-cloud signin
|
|
38
|
+
```
|
|
39
|
+
|
|
40
|
+
Claude shows a link. Open it on any device, sign in with your Claude account and paste the code back. GitHub then shows a code: open its link, enter the code and allow access. Last, Remote Control opens: answer any question it asks, such as trusting the folder, then press Ctrl-B and then D. It keeps running after you leave.
|
|
41
|
+
|
|
42
|
+
4. **Check it.** Open your Online address on your phone, or run `ssh <your-mac-user>@<server-ip> pmos-cloud status`. Every line shows ✓ when all is ready.
|
|
43
|
+
|
|
44
|
+
When the Mac is off or cannot be reached, skip step 2. Paste this on the server instead, as root:
|
|
45
|
+
|
|
46
|
+
```sh
|
|
47
|
+
curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash
|
|
48
|
+
```
|
|
49
|
+
|
|
50
|
+
This starts an empty PMOS for the user `pmos`. After the sign-in, add each product repository with `pmos-cloud add <owner/repo>`, and set up the Online address with `pmos-cloud online pmos.pm-os.app`. Chats, notes and settings that are only on the Mac stay there until you run step 2.
|
|
51
|
+
|
|
52
|
+
## What the move copies
|
|
53
|
+
|
|
54
|
+
| Item | Where it goes on the server | Why |
|
|
55
|
+
|---|---|---|
|
|
56
|
+
| The PMOS state folder: chats, notes, settings, Online and the product list | `~/.local/state/pmos` | Your PMOS is the same as it was on the Mac. |
|
|
57
|
+
| Every repository PMOS hosts, with its git history (no `node_modules`) | The same path as on the Mac | Paths and product ids do not change. |
|
|
58
|
+
| `~/.cloudflared`: the tunnel's files | The same path | The same tunnel and DNS record answer your Online address. No DNS change is needed. |
|
|
59
|
+
| The name and folder of the Claude profile in Settings › Claude | An alias in `~/.bashrc` | Unattended Claude work runs as that profile, as on the Mac. |
|
|
60
|
+
| `~/.gitconfig` | The same path | Your git name and email. The macOS keychain line is removed, and GitHub is reached over HTTPS. |
|
|
61
|
+
|
|
62
|
+
The server uses the same user name and home folder as the Mac, such as `/Users/<you>`. That is why no path needs to change.
|
|
63
|
+
|
|
64
|
+
The move does not copy Claude or GitHub sign-ins, because the Mac keeps them in its keychain. Step 3 makes new ones on the server.
|
|
65
|
+
|
|
66
|
+
## What runs on the server
|
|
67
|
+
|
|
68
|
+
- **The minute check.** A systemd timer runs `pmos up --keep` every minute and 20 seconds after a restart, like the Mac's login item. It does nothing when PMOS answers. It starts PMOS when PMOS is down, and replaces PMOS when PMOS is stuck. It waits while an in-page update runs.
|
|
69
|
+
- **Remote Control.** After the sign-in, the same check keeps `claude remote-control` running in the tmux session `pmos-remote-control`, as "PMOS cloud (<server>)". It uses `--permission-mode auto`, because nobody is at the server to answer.
|
|
70
|
+
- **Online.** If Online was on at the Mac, it is on at the server, and the server runs the tunnel. The move turned Online off on the Mac, so only one computer answers.
|
|
71
|
+
- **The firewall.** Only SSH is open. PMOS listens on the server only. Cloudflare reaches it through the tunnel from inside the server.
|
|
72
|
+
- **Backups.** PMOS copies its state folder every night to `~/pmos-backups`, as on the Mac. Hetzner's Backups copies the whole server every day.
|
|
73
|
+
|
|
74
|
+
## `pmos-cloud` on the server
|
|
75
|
+
|
|
76
|
+
| Command | What it does |
|
|
77
|
+
|---|---|
|
|
78
|
+
| `pmos-cloud status` | Shows the workspace, the Claude sign-in, Remote Control, GitHub and Online, each with ✓ or the next step. |
|
|
79
|
+
| `pmos-cloud signin` | Signs in to Claude and GitHub. It skips a sign-in that is already done. Remote Control then starts. |
|
|
80
|
+
| `pmos-cloud online [host] [tunnel]` | Sets up the Online address on a server that has no tunnel files. It signs in to Cloudflare, uses the tunnel `pmos` (or makes it), and writes `~/.cloudflared/config.yml`. Then turn Online on in Settings › Online. |
|
|
81
|
+
| `pmos-cloud add <owner/repo>…` | Clones a repository to `~/Project` and adds it to PMOS. |
|
|
82
|
+
| `pmos-cloud logs [n]` | Shows the last lines of the minute check's log. |
|
|
83
|
+
| `pmos-cloud stop` · `pmos-cloud start` | Stops PMOS, Remote Control and the tunnel, and keeps the minute check from starting them again. `start` undoes this. |
|
|
84
|
+
|
|
85
|
+
To open PMOS without the Online address, run `ssh -N -L 7433:127.0.0.1:7433 <you>@<server-ip>`. Then open `http://localhost:7433`. Settings › Online can be changed only this way, because PMOS treats the request as one from the server itself.
|
|
86
|
+
|
|
87
|
+
## Go back to the Mac
|
|
88
|
+
|
|
89
|
+
1. On the server: `pmos-cloud stop`.
|
|
90
|
+
2. On the Mac: `curl -fsSL https://unpkg.com/create-pmos/cloud-setup.sh | bash -s -- mac-on`. PMOS starts within a minute.
|
|
91
|
+
3. On the Mac, turn Online on in Settings › Online.
|
|
92
|
+
|
|
93
|
+
Records that both computers push to a git remote stay in step. Chats, notes and settings that changed on the server after the move are only on the server.
|
|
94
|
+
|
|
95
|
+
## Limits
|
|
96
|
+
|
|
97
|
+
- The server must run Ubuntu or Debian. Other Linux systems need the steps done by hand.
|
|
98
|
+
- A product repository with no git remote is copied once, at the move. After that, the Mac and the server do not sync it.
|
|
99
|
+
- Claude's sign-in on the server lasts as long as a sign-in on any computer. When it expires, `pmos-cloud status` shows ✗ for Claude, and Settings › Claude shows the sign-in prompt. Run `pmos-cloud signin` again.
|
|
100
|
+
- The two pastes download the newest create-pmos release from `unpkg.com`. If unpkg is down, copy `cloud-setup.sh` from the create-pmos package (`npm pack create-pmos`) and run it with `bash cloud-setup.sh move root@<server-ip>`.
|
package/workspace/guide/index.md
CHANGED
|
@@ -41,6 +41,7 @@ PMOS has three places: **Home**, **Board** and **Intelligence**. The round menu
|
|
|
41
41
|
|
|
42
42
|
- [What Claude does behind the scenes](agent-capabilities.md): every job Claude runs by itself, when it runs, what it reads, where you see it, how to stop it, and what it fixes by itself; the three classes of change (D106), what is applied at once with Undo, what waits for you, and how a job goes back to propose; long-running goals; the team of role agents; the idle lab; and the PM-only acts, how each is checked and recorded, and how an agent's act is logged under its name (D98).
|
|
43
43
|
- [Layout and first run](layout.md): the three places, the menu button, the Viewer and its trail, docking panels, the keys and the phone; the first run; why a new PMOS starts quiet and what opens each place; the PMOS app and the login item; and Adler, Claude's face, with Settings › General › Adler.
|
|
44
|
+
- [Run PMOS in the cloud](cloud.md): move PMOS from the Mac to an always-on server with one paste, the one sign-in that is yours, what runs on the server, `pmos-cloud`, and how to go back to the Mac.
|
|
44
45
|
- [Settings, switches and data freshness](settings-and-switches.md): what each section of Settings holds, every `PMOS_` environment variable with its default and the Settings entry that does the same, and when each source is read again and how old it is.
|
|
45
46
|
|
|
46
47
|
### Home and your day
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pmos-workspace",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.550.0",
|
|
4
4
|
"lockfileVersion": 3,
|
|
5
5
|
"requires": true,
|
|
6
6
|
"packages": {
|
|
7
7
|
"": {
|
|
8
8
|
"name": "pmos-workspace",
|
|
9
|
-
"version": "0.
|
|
9
|
+
"version": "0.550.0",
|
|
10
10
|
"license": "MIT",
|
|
11
11
|
"dependencies": {
|
|
12
12
|
"@anthropic-ai/sdk": "^1.3.0",
|
package/workspace/package.json
CHANGED