diff --git a/README.md b/README.md index e753f0d..63b87aa 100644 --- a/README.md +++ b/README.md @@ -31,12 +31,21 @@ already set up prints status and changes nothing. | --- | --- | | `--skill-only` | skill and hooks only; no daemon, no service | | `--no-node` | never provision Node; falls back to skill-only if yours is too old | +| `--no-codex` | don't wire Codex, even if it's installed | | `--registry ` | install from somewhere other than the default registry | | `--yes` | don't prompt | Node 20 is the floor for single mode. The daemon needs 22.13 or newer, because it uses `node:sqlite` without a flag. +Claude Code gets wired up either way. If `codex` is on your PATH that gets +wired too — hooks, the skill, and a marked block in your project's `AGENTS.md`. +If it isn't installed, nothing is written for it. `--no-codex` skips it on a +box that does have it. + +Windows uses the same flags with PowerShell spelling: `-SkillOnly`, `-NoNode`, +`-NoCodex`, `-Registry `, `-Yes`. + ## Your licence key You'll get a key as one long line with a dot in the middle: @@ -45,16 +54,17 @@ You'll get a key as one long line with a dot in the middle: eyJob2xkZXIiOiJBY21lIENvcnAiLCJlZGl0aW9uIjoicHJvIi...}.VI7V1ZkucEx_Vn7qxh2ep... ``` -Install it either way: +Install it via cli: ```sh standup license install ~/Downloads/acme.key --code YOUR-OPERATOR-CODE ``` -Or open **http://127.0.0.1:7335/license** and paste the key into the box. +...or by opening **http://127.0.0.1:7335/license** and pasting your key in the +box. -The key is copied to `~/.standup/license.key` at `0600`. Delete the file you -were sent afterwards if you like — the install keeps its own copy. +The key will be installed to `~/.standup/license.key`, you do not need to save +your key file after installation. ```sh standup license show # check what you're running under @@ -80,11 +90,11 @@ If a key is refused, the error names which problem it is: ## Keeping the daemon alive -Use `standup service` rather than touching systemd, launchd or Task Scheduler -yourself. One set of commands, three platforms: +Use `standup service` instead of touching systemd, launchd or Task Scheduler +yourself — same commands on all three: ```sh -standup service install # install and enable at login +standup service install # install it, start it at login standup service start standup service status standup service restart @@ -92,42 +102,55 @@ standup service stop --code standup service uninstall --code ``` -Under the hood that's a systemd `--user` unit on Linux, a launchd agent on -macOS, and a scheduled task on Windows. `stop` and `uninstall` are -operator-only, so they want `--code`. +Behind that it's a systemd `--user` unit on Linux, a launchd agent on macOS and +a scheduled task on Windows. `stop` and `uninstall` need `--code` because +they're operator-only. -The installer runs `service install` and `start` for you on first run. +The installer does `install` and `start` for you on first run, so normally you +don't touch any of this. ### Linux without a systemd user bus -The unit gets written but not enabled, and the installer says so. **On WSL2**, -systemd is usually just off: +You'll get the unit written but not started, and the installer will say so. +**On WSL2** this is usually just systemd being off: ```sh -# add to /etc/wsl.conf +# /etc/wsl.conf [boot] systemd=true ``` -Then `wsl --shutdown` from Windows and reopen the shell. After that -`standup service install` works normally. +Then `wsl --shutdown` from Windows, reopen your shell, and +`standup service install` will work. -**Containers and minimal boxes** may have no user bus at all. Run the daemon -directly and keep it up however you already supervise things: +Containers and stripped-down boxes may have no user bus at all. Run the daemon +yourself and supervise it however you already do: ```sh standup daemon ``` -### Checking it's up +### Is it up? ```sh standup status ``` -The daemon listens on `127.0.0.1:7335` by default. `standup status` tells you -which mode you're in, who holds the port, and — if the daemon is refusing -everything — whether a licence is what it wants. +That tells you which mode you're in, who's holding the port, and — if the +daemon is refusing everything — whether a licence is what it's waiting for. +The daemon listens on `127.0.0.1:7335` unless you've moved it. + +## Where things live + +| | | +| --- | --- | +| the `standup` binary | npm's global prefix (`npm config get prefix`) | +| all your data | `~/.standup/` — rooms, KB, config, licence | +| the service definition | `~/.config/systemd/user/standupd.service`, or `~/Library/LaunchAgents/io.rethinkstudios.standupd.plist`, or a scheduled task named `agent-standups standupd` | + +`~/.standup/` is the whole install as far as your data goes — back that up and +you've backed up everything. Set `STANDUP_HOME` to put it somewhere else, and +you get a genuinely separate install sharing the same binary. ## Uninstall @@ -135,4 +158,4 @@ everything — whether a licence is what it wants. standup uninstall --yes --code ``` -Add `--purge` to take the data with it. +Add `--purge` if you want your data gone with it. diff --git a/install.ps1 b/install.ps1 index bfba433..618f41d 100644 --- a/install.ps1 +++ b/install.ps1 @@ -2,7 +2,7 @@ # # irm https://git.rethinkstudios.io/rethink-software/agent-standups/raw/tag/v0.1.0/install.ps1 | iex # -# Flags (when invoked as a file): -SkillOnly -NoNode -Registry -Yes +# Flags (when invoked as a file): -SkillOnly -NoNode -NoCodex -Registry -Yes # Through `irm | iex` the defaults apply; download it to pass flags. # # Idempotent: on an installed box it prints status and changes nothing. @@ -11,6 +11,7 @@ param( [switch]$SkillOnly, [switch]$NoNode, + [switch]$NoCodex, [string]$Registry = 'https://git.rethinkstudios.io/api/packages/rethink-software/npm/', [switch]$Yes ) @@ -83,6 +84,8 @@ Say "winget : $(if (Have winget) { 'present' } else { 'not available' })" $standupBin = if (Have standup) { (Get-Command standup).Source } else { '' } Say "standup : $(if ($standupBin) { $standupBin } else { 'not installed' })" +$codexBin = (Get-Command codex -ErrorAction SilentlyContinue).Source +Say "codex : $(if ($codexBin) { "$codexBin$(if ($NoCodex) { ' (-NoCodex)' })" } else { 'not installed' })" $standupHome = if ($env:STANDUP_HOME) { $env:STANDUP_HOME } else { Join-Path $HOME '.standup' } Say "config : $(if (Test-Path (Join-Path $standupHome 'config.toml')) { 'exists' } else { 'absent' })" @@ -240,6 +243,15 @@ if (-not $serviceOnly) { & standup install --runtime claude if ($LASTEXITCODE -ne 0) { Warn 'runtime install reported a problem; see doctor below' } + # Codex only where its binary exists: `--runtime codex` writes to + # $CODEX_HOME/hooks.json, ~/.agents/skills/ and the project's AGENTS.md, and + # leaving marked blocks for a tool that is not installed is worse than + # skipping. -NoCodex opts out on a box that does have it. + if (-not $NoCodex -and $codexBin) { + & standup install --runtime codex + if ($LASTEXITCODE -ne 0) { Warn 'codex runtime install reported a problem; see doctor below' } + } + if ($probe -and -not $probe.HasExited) { Stop-Process -Id $probe.Id -Force -ErrorAction SilentlyContinue } Remove-Item -Recurse -Force $probeDir -ErrorAction SilentlyContinue } diff --git a/install.sh b/install.sh index c4b01e6..8f347ee 100755 --- a/install.sh +++ b/install.sh @@ -23,12 +23,14 @@ PKG="agent-standups" SKILL_ONLY=0 NO_NODE=0 +NO_CODEX=0 ASSUME_YES=0 while [ $# -gt 0 ]; do case "$1" in --skill-only) SKILL_ONLY=1 ;; --no-node) NO_NODE=1 ;; + --no-codex) NO_CODEX=1 ;; --yes|-y) ASSUME_YES=1 ;; --registry) shift; REGISTRY="${1:-$REGISTRY}" ;; --registry=*) REGISTRY="${1#--registry=}" ;; @@ -38,6 +40,7 @@ agent-standups installer --skill-only install the skill and hooks only; no daemon, no service --no-node never provision Node; fall back to skill-only if too old + --no-codex never wire the Codex runtime, even where codex is installed --registry npm registry for a standalone install --yes no prompts; also sets the provisioned Node as your default USAGE @@ -119,7 +122,9 @@ say " nvm : $([ "$NVM_PRESENT" = 1 ] && echo "present ($NVM_DIR_RESOLVE # Existing install. STANDUP_BIN="" have standup && STANDUP_BIN="$(command -v standup)" +CODEX_BIN="$(command -v codex 2>/dev/null || true)" say " standup : ${STANDUP_BIN:-not installed}" +say " codex : ${CODEX_BIN:-not installed}$([ -n "$CODEX_BIN" ] && [ "$NO_CODEX" = 1 ] && echo ' (--no-codex)')" say " config : $([ -f "${STANDUP_HOME:-$HOME/.standup}/config.toml" ] && echo exists || echo absent)" # ------------------------------------------------- 2. choose the target path -- @@ -397,7 +402,7 @@ say " standup $(standup version 2>/dev/null || echo '?') at $(command -v standu # The runtime install ends with a synthetic Stop proving the hook is REACHABLE, # not merely present. That needs a server answering, so start a throwaway one. if [ "$SERVICE_ONLY" = 0 ]; then - step "installing the Claude runtime" + step "installing the agent runtimes" PROBE_DIR="$(mktemp -d)" # `--no-git`: the probe project is a throwaway in a bare mktemp dir, and # `create` requires a git work tree (spec 06 §3). Without this flag it exits @@ -421,6 +426,13 @@ if [ "$SERVICE_ONLY" = 0 ]; then done fi standup install --runtime claude || warn "runtime install reported a problem; see doctor below" + # Codex only where its binary exists: `--runtime codex` writes to + # $CODEX_HOME/hooks.json, ~/.agents/skills/ and the project's AGENTS.md, and + # leaving marked blocks for a tool that is not installed is worse than + # skipping. `--no-codex` opts out on a box that does have it. + if [ "$NO_CODEX" = 0 ] && [ -n "$CODEX_BIN" ]; then + standup install --runtime codex || warn "codex runtime install reported a problem; see doctor below" + fi [ -n "$PROBE_PID" ] && { kill "$PROBE_PID" 2>/dev/null || true; wait "$PROBE_PID" 2>/dev/null || true; PROBE_PID=""; } rm -rf "$PROBE_DIR"; PROBE_DIR="" fi