### Install and generate completion scripts Source: https://harnery.com/cli/completion Examples for installing dynamic or static completion, and emitting completion scripts to stdout. ```bash # Recommended: install once, never regenerate harn completion install --dynamic # Static (regenerate after adding commands/flags) harn completion install # Emit to stdout instead of installing harn completion bash --dynamic eval "$(harn completion zsh --dynamic)" ``` -------------------------------- ### Run setup script from git clone Source: https://harnery.com/getting-started/install Executes the setup script from the repository root to install dependencies, build the distribution, and link binaries. ```bash ./scripts/setup.sh ``` -------------------------------- ### harn web build and start Source: https://harnery.com/cli/web Builds the production bundle and then starts the production server. Requires prior build. ```bash harn web build && harn web start ``` -------------------------------- ### harn fetch usage examples Source: https://harnery.com/cli/fetch Multiple examples demonstrating common harn fetch usage: GET, piping to harn read, POST with JSON, redirect handling, clean session with JSON output, and saving binary files. ```bash # GET a page (cookies auto-attached and persisted) harn fetch https://example.com ``` ```bash # The canonical scrape-to-markdown pipeline harn fetch https://example.com | harn read - ``` ```bash # POST JSON with explicit headers harn fetch https://example.com/api -X POST -H 'Content-Type: application/json' -d '{"k":"v"}' ``` ```bash # Capture cookies set on intermediate redirects (follow swallows them) harn fetch https://example.com/login --redirect manual --headers ``` ```bash # Clean session, full result as JSON harn fetch https://example.com --no-cookies --json ``` ```bash # Save a binary response to a file harn fetch https://example.com/image.png -o /path/to/image.png ``` -------------------------------- ### harn sync setup workflow Source: https://harnery.com/cli/sync Initial setup steps including rclone configuration, initializing the sync remote, and verifying the connection. ```bash # One-time: configure an rclone remote (interactive OAuth for Google Drive) rclone config # Tell harnery which remote to use (records to ~/.config/harnery/sync.json) harn sync init --remote gdrive --prefix harnery/my-monorepo # Verify the connection harn sync status # First push harn sync push -v ``` -------------------------------- ### Build and start production dashboard Source: https://harnery.com/concepts/web-ui Commands to build and start the dashboard for long-running operator panels. ```bash harn web build # next build harn web start # next start ``` -------------------------------- ### Complete configuration example Source: https://harnery.com/getting-started/configuration A comprehensive example of a config.jsonc file demonstrating project identity, coordination settings, artifact retention, log storage budgets, web UI settings, and backup configurations. ```json { "$schema": "https://harnery.com/schemas/config.schema.json", // Project identity surfaced to peers + in log lines. "project_name": "my-project", // Coord layer "coord": { "freshness_seconds": 600, // how stale a peer heartbeat can get before sweep "finalization": { "archive_grace_seconds": 600, "idle_observe_seconds": 259200, "idle_finalize_seconds": 604800, "cascade_grace_seconds": 3600, "reconcile_interval_seconds": 900 }, "run_quality": { "mode": "off" // opt into shadow or report only after local evaluation } }, // Repository-local working files "artifacts": { "default_retention_days": 3 }, // Soft storage budgets for manifest-backed operational and debug logs. "logs": { "storage": { "classes": { "operational-log": { "max_bytes": 134217728, "max_age_days": 30 }, "debug-log": { "max_bytes": 67108864, "max_age_days": 7 } }, "families": { "web-performance-log": { "max_bytes": 67108864, "max_age_days": 14 } } } }, // Web UI "web": { "port": 4276, "bind": "127.0.0.1" }, // Backup (restic) "backup": { "repo": "rclone:gdrive:harnery-backup/my-project", "keep_daily": 7, "keep_weekly": 4, "keep_monthly": 6 } } ``` -------------------------------- ### harn tunnel command examples Source: https://harnery.com/cli/tunnel Examples of `harn tunnel` subcommands: starting instances with various options (target, vhost, name, provider, visibility, path), checking status, stopping, reloading, and tailing logs. ```bash harn tunnel up # start the default instance harn tunnel up --target 127.0.0.1:4276 --vhost localhost:4276 # Harnery web upstream + Host harn tunnel up --name web # a second, independently-managed instance harn tunnel up --provider cloudflare # default: random *.trycloudflare.com URL + IP allowlist harn tunnel up --provider tailscale # tailnet-only Tailscale Serve URL harn tunnel up --provider tailscale --visibility public # public Tailscale Funnel URL harn tunnel up --provider tailscale --name web --path /web # named instance at a path harn tunnel status # table of running instances + their URLs harn tunnel down [--name |--all] # stop one / all harn tunnel reload [--name |--all] # pick up allowlist edits, keeping the URL harn tunnel logs [-f] # tail the gate log (--provider for the provider log) ``` -------------------------------- ### Detect unwired adapter warning Source: https://harnery.com/cli/doctor Example output when doctor detects that an adapter CLI is installed but no Harnery hooks are wired for it. ```bash $ harn doctor ... ⚠ adapter hooks .codex/hooks.json: codex CLI installed, no harnery hooks wired ↳ run `harn init --adapter codex` (idempotent, additive) ``` -------------------------------- ### harn web up examples Source: https://harnery.com/cli/web Shows two examples of the up command: default boot and with custom port and coord-root. The first outputs http://localhost:4276, the second http://localhost:4000 reading .harnery/ from the specified directory. ```bash harn web up # → http://localhost:4276 ``` ```bash harn web up --port 4000 --coord-root /path/to/some/repo # → http://localhost:4000, reading .harnery/ from /path/to/some/repo ``` -------------------------------- ### Install Harnery with custom flags Source: https://harnery.com/getting-started/install Passes flags to the installation script to specify the package manager, version, or runtime installation. ```bash curl -fsSL https://harnery.com/install.sh | bash -s -- --method bun --version 0.3.2 ``` -------------------------------- ### Create a review pack with desktop dark context and pricing card scope Source: https://harnery.com/cli/review-pack Creates a review pack from a localhost URL, limiting to desktop dark context and scoping tiles to elements matching '.price-card'. ```bash harn review-pack create http://localhost:3000/pricing --context desktop:dark --scope '.price-card' ``` -------------------------------- ### Install Harnery globally with bun Source: https://harnery.com/getting-started/install Installs the package globally using bun. ```bash bun add -g harnery ``` -------------------------------- ### Install Harnery globally with npm Source: https://harnery.com/getting-started/install Installs the package globally using npm. ```bash npm install -g harnery ``` -------------------------------- ### Run command with admission control Source: https://harnery.com/cli/admission Example of using the admission run command to queue a build process. ```bash harn admission run --resource build -- npm run build ``` -------------------------------- ### Create a work-root with replanning policy Source: https://harnery.com/cli/governor Initialize a work-root using the team configuration and the previously defined replanning policy file. ```bash harn governor create work-root --team ./team.json \ --replanning ./replanning.json --id goal-release ``` -------------------------------- ### Initialize with --instructions-only Source: https://harnery.com/cli/init Use the --instructions-only flag to refresh managed regions and skills without enabling local coordination runtime wiring. ```bash harn init --adapter codex --instructions-only ``` -------------------------------- ### Install Harnery via shell script Source: https://harnery.com/getting-started/install Installs the harn CLI globally using a non-interactive and idempotent script. ```bash curl -fsSL https://harnery.com/install.sh | bash ``` -------------------------------- ### Launch with live CLI control file Source: https://harnery.com/cli/browse Creates a private directory and uses --control-file to enable live session management. ```bash install -d -m 700 ~/.cache/harnery/live-session harn browse --login \ --control-file ~/.cache/harnery/live-session/control.json \ https://example.com ```