Ht ml

From mvanhorn/printing-press-library · View interactive version

Ht ml is an AI agent skill from the GitHub repository mvanhorn/printing-press-library. The only ht-ml.app tool that remembers what you published, a local registry of every site, its once-only update_key, and full version history, plus one-command publish-with-assets. Trigger phrases: `publish this HTML`, `get me a public URL for this page`, `host this HTML file`, `update my ht-ml site

How to use this skill

Skill file

ht-ml.app — Printing Press CLI

Prerequisites: Install the CLI

This skill drives the ht-ml-pp-cli binary. You must verify the CLI is installed before invoking any command from this skill. If it is missing, install it first:

  1. Install via the Printing Press installer. It defaults binaries to $HOME/.local/bin on macOS/Linux and %LOCALAPPDATA%\Programs\PrintingPress\bin on Windows:

```bash

npx -y @mvanhorn/printing-press-library install ht-ml --cli-only

```

  1. Verify: ht-ml-pp-cli --version
  2. Ensure the reported install directory is on $PATH for the agent/runtime that will invoke this skill.

If the npx install fails (no Node, offline, etc.), fall back to a direct Go install (requires Go 1.26.6 or newer). This installs into $GOPATH/bin (default $HOME/go/bin), so add that directory to $PATH instead:

go install github.com/mvanhorn/printing-press-library/library/cloud/ht-ml/cmd/ht-ml-pp-cli@latest

If --version reports "command not found" after install, the runtime cannot see the binary directory on $PATH. Do not proceed with skill commands until verification succeeds.

ht-ml.app is deliberately accountless: you POST one HTML document, get a public URL, and a write key shown exactly once. That makes publishing frictionless and management impossible. This CLI is the missing memory layer. Every publish is captured to a local SQLite store, so you can list and audit everything you've shipped, update a site by id without ever touching its key, auto-upload referenced assets in one pass, roll back to any prior version, and export a passphrase-sealed vault of your keys for disaster recovery.

When to Use This CLI

Use this CLI whenever an agent needs to publish a single HTML document to a public URL fast (prototypes, diagrams, decks, status reports, code reviews) and then manage it over time. It is the right tool when you will publish more than once and need to find, update, version, or recover past sites, capabilities ht-ml.app's accountless API does not provide on its own.

Anti-triggers

Do not use this CLI for:

Unique Capabilities

These capabilities aren't available in any other tool for this API.

Registry & recovery

_Reach for this to recall or audit what you've shipped; it's the only way to enumerate sites the accountless API won't list._

```bash

ht-ml-pp-cli list --agent --select url,title,status

```

_Use after publishing or before switching machines; without a vault, a lost key orphans the site forever._

```bash

ht-ml-pp-cli keys export --out ht-ml-keys.vault

```

Asset reconciliation

_Pick this whenever a published page has broken images; it fixes all of them at once instead of one upload per file._

```bash

ht-ml-pp-cli assets sync <site_id> --root ./public

```

_Run during a review to catch broken client-facing pages before someone else does._

```bash

ht-ml-pp-cli assets audit --missing-only --agent

```

Versioning & living docs

_Use when a republish shipped bad data; it restores the last-good HTML in one command._

```bash

ht-ml-pp-cli rollback <site_id>

```

_Pick this for scheduled or daily publishes so the public URL never churns._

```bash

ht-ml-pp-cli republish --as status-report ./status.html

```

Publish safety

_Run before any publish on a person's behalf; it returns a typed exit code so it can gate a pipeline._

```bash

ht-ml-pp-cli scan ./page.html

```

Command Reference

sites — Inspect ht-ml.app sites

Finding the right command

When you know what you want to do but not which command does it, ask the CLI directly:

ht-ml-pp-cli which "<capability in your own words>"

which resolves a natural-language capability query to the best matching command from this CLI's curated feature index. Exit code 0 means at least one match; exit code 2 means no confident match — fall back to --help or use a narrower query.

Recipes

Publish a deck and get just the URL

ht-ml-pp-cli publish ./deck.html --agent --select url,site_id

Publish and return only the live URL and id, ready to hand to a downstream step.

Inspect a site's referenced assets compactly

ht-ml-pp-cli sites <site_id> --agent --select status,assets.relative_path,assets.status

Use dotted --select to narrow the verbose site-plus-assets payload to just status and each asset's path and status.

Audit every site for broken images

ht-ml-pp-cli assets audit --missing-only --agent

Cross-site join that lists publicly-visible missing assets the API cannot surface in one call.

List your published sites by title

ht-ml-pp-cli list --sort title --agent --select site_id,title,url

The local registry is the only inventory of what you have shipped (the API has no list endpoint); sort by title to find a page fast.

Recover keys on a second machine

ht-ml-pp-cli keys import ht-ml-keys.vault

Import a passphrase-sealed vault so update and rollback work from another machine.

Auth Setup

ht-ml.app has no global API key. Creating and reading sites needs no credential at all. Each site mints a high-entropy update_key once at creation — the only write credential, with no recovery endpoint. This CLI captures that key into a local store at create time, so update, asset, and password commands resolve it automatically by site_id. Keep the store safe and back it up with keys export; losing an update_key with no backup orphans the site forever.

Run ht-ml-pp-cli doctor to verify setup.

Agent Mode

Add --agent to any command. Expands to: --json --compact --no-input --no-color --yes.

```bash

ht-ml-pp-cli sites mock-value --agent --select id,name,status

```

Response envelope

Commands that read from the local store or the API wrap output in a provenance envelope:

{
  "meta": {"source": "live" | "local", "synced_at": "...", "reason": "..."},
  "results": <data>
}

Parse .results for data and .meta.source to know whether it's live or local. A human-readable N results (live) summary is printed to stderr only when stdout is a terminal AND no machine-format flag (--json, --csv, --compact, --quiet, --plain, --select) is set — piped/agent consumers and explicit-format runs get pure JSON on stdout.

Paths and state

Agents should treat the CLI's path resolver as part of the runtime contract:

```json

{

"mcpServers": {

"ht-ml": {

"command": "ht-ml-pp-mcp",

"env": {

"HT_ML_HOME": "/srv/ht-ml"

}

}

}

}

```

Fleet precedence: an inherited per-kind env var overrides an explicit --home for that kind. Use HT_ML_HOME or per-kind vars as durable fleet levers, and use --home only for a single invocation. Relocation is not reversible by unsetting env vars; move files manually before clearing HT_ML_HOME, or doctor will not find credentials left under the former root.

Agent Feedback

When you (or the agent) notice something off about this CLI, record it:

ht-ml-pp-cli feedback "the --since flag is inclusive but docs say exclusive"
ht-ml-pp-cli feedback --stdin < notes.txt
ht-ml-pp-cli feedback list --json --limit 10

Entries are stored locally as feedback.jsonl under the resolved data dir. They are never POSTed unless HT_ML_FEEDBACK_ENDPOINT is set AND either --send is passed or HT_ML_FEEDBACK_AUTO_SEND=true. Default behavior is local-only.

Write what surprised you, not a bug report. Short, specific, one line: that is the part that compounds.

Output Delivery

Every command accepts --deliver <sink>. The output goes to the named sink in addition to (or instead of) stdout, so agents can route command results without hand-piping. Three sinks are supported:

| Sink | Effect |

|------|--------|

| stdout | Default; write to stdout only |

| file:<path> | Atomically write output to <path> (tmp + rename) |

| webhook:<url> | POST the output body to the URL (application/json or application/x-ndjson when --compact) |

Unknown schemes are refused with a structured error naming the supported set. Webhook failures return non-zero and log the URL + HTTP status on stderr.

Named Profiles

A profile is a saved set of flag values, reused across invocations. Use it when a scheduled agent calls the same command every run with the same configuration - HeyGen's "Beacon" pattern.

ht-ml-pp-cli profile save briefing --json
ht-ml-pp-cli --profile briefing sites mock-value
ht-ml-pp-cli profile list --json
ht-ml-pp-cli profile show briefing
ht-ml-pp-cli profile delete briefing --yes

Explicit flags always win over profile values; profile values win over defaults. agent-context lists all available profiles under available_profiles so introspecting agents discover them at runtime.

Exit Codes

| Code | Meaning |

|------|---------|

| 0 | Success |

| 2 | Usage error (wrong arguments) |

| 3 | Resource not found |

| 5 | API error (upstream issue) |

| 7 | Rate limited (wait and retry) |

| 10 | Config error |

Argument Parsing

Parse $ARGUMENTS:

  1. Empty, help, or --help → show ht-ml-pp-cli --help output
  2. Starts with install → ends with mcp → MCP installation; otherwise → see Prerequisites above
  3. Anything else → Direct Use (execute as CLI command with --agent)

MCP Server Installation

  1. Install the MCP server:

```bash

go install github.com/mvanhorn/printing-press-library/library/cloud/ht-ml/cmd/ht-ml-pp-mcp@latest

```

  1. Register with Claude Code:

```bash

claude mcp add ht-ml-pp-mcp -- ht-ml-pp-mcp

```

  1. Verify: claude mcp list

Direct Use

  1. Check if installed: which ht-ml-pp-cli

If not found, offer to install (see Prerequisites at the top of this skill).

  1. Match the user query to the best command from the Unique Capabilities and Command Reference above.
  2. Execute with the --agent flag:

```bash

ht-ml-pp-cli <command> [subcommand] [args] --agent

```

  1. If ambiguous, drill into subcommand help: ht-ml-pp-cli <command> --help.
Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.