Skip to content

Add curl|bash installer for the pino CLI + README install section #13

Description

@leduckhc

Summary

Add a one-line curl | bash installer for the pino CLI and document it in the top-level README.md. This is the v1 install path called for by SPEC-03 ("Locating & installing the pino CLI"), and unblocks the macOS control app, which needs a reliable way to install/find the pino binary.

Background / why

  • @pino/server is a private Node/TS package with bin: { "pino": "./dist/index.js" }. It must be built (pnpm builddist/) before pino works.
  • The macOS control app (SPEC-03) drives the CLI (pino start|stop|restart + control socket). It searches $PATH, ~/.local/bin, /opt/homebrew/bin, /usr/local/bin, and offers a one-click "Install CLI" affordance that should run this same script.
  • Today README.md documents cd server && npm install, which is wrong: server/ is pnpm-only (there is a preinstall guard that rejects npm). The installer and docs must use pnpm.

Scope

Installer script (install.sh, served via raw GitHub URL)

Target UX:

curl -fsSL https://raw.githubusercontent.com/leduckhc/pino/main/install.sh | bash

The script should:

  1. Preflight checks
    • Verify git is present.
    • Verify Node >= 22.13.0 (per server/package.json engines); if missing/too old, print a clear message with a link (do not silently install Node in v1).
    • Ensure pnpm is available — prefer corepack enable (bundled with Node) over a global install.
  2. Fetch source
    • Clone (or update) the repo into a stable location, e.g. ~/.pino/src (or download a release tarball once releases exist). Keep it re-runnable/idempotent.
  3. Build
    • cd server && pnpm install --frozen-lockfile && pnpm build.
  4. Install the binary on PATH
    • Symlink server/dist/index.js (the pino bin) into ~/.local/bin/pino by default; fall back to /usr/local/bin if writable/preferred.
    • chmod +x; make sure the shebang works (node).
    • If ~/.local/bin is not on PATH, print an actionable note (which shell rc line to add).
  5. Verify
    • Run pino --version (or pino status) and print success + the install location.
  6. Ergonomics
    • set -euo pipefail; clear error messages; safe to re-run (upgrade path); support an env override for install dir (e.g. PINO_INSTALL_DIR).

README section

  • Replace the current cd server && npm install quick-start with:
    • A "Install the pino CLI" section featuring the curl | bash one-liner.
    • Keep a "From source (contributors)" subsection using pnpm (corepack enable && pnpm install && pnpm build), not npm.
  • Note that server/ is pnpm-only (npm is blocked by a preinstall guard).

Acceptance criteria

  • install.sh exists at repo root and is idempotent/re-runnable.
  • Running the curl | bash one-liner on a clean macOS machine (with Node ≥22.13) yields a working pino on PATH; pino status runs.
  • Script fails fast with clear messages when Node is missing/old or pnpm can't be enabled.
  • README.md documents the one-liner and a pnpm-based from-source path; the stale npm install instruction is removed.
  • Install dir is overridable (PINO_INSTALL_DIR) and defaults to ~/.local/bin.

Out of scope

  • Bundling the CLI/Node inside the macOS .app (the preferred zero-install end state) — tracked separately under SPEC-03.
  • A Homebrew tap — possible later install channel, not required here.

Pointers

  • Spec: docs/specs/SPEC-03-desktop-control-app.md → "Locating & installing the pino CLI".
  • CLI bin + build: server/package.json (bin, scripts.build, engines, preinstall npm guard).
  • Daemon lifecycle the CLI exposes: docs/specs/SPEC-01-daemon-control-plane.md (pino start|stop|restart|status).

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions