+ ttyinv

TTYINV FOR AGENTS

Your agent can draft.
You keep the source.

Create portable ttyinv Markdown, validate it, and render it for free. Every agent call requires a revocable agent token. No purchase gates any agent operation.

GET STARTED

Three steps, then hand it to your agent.

  1. 01

    Install the portable skill

    Each harness reads skills from its own directory. Set TTYINV_SKILL_DIR to that directory. The command downloads the archive, verifies the checksum, prints the contents, then extracts the skill.

    : "${TTYINV_SKILL_DIR:?Set TTYINV_SKILL_DIR to the skill directory of your harness}" &&
    ttyinv_skill_tmp="$(mktemp -d)" &&
    trap 'test -n "$ttyinv_skill_tmp" && rm -rf -- "$ttyinv_skill_tmp"' EXIT &&
    curl --fail --silent --show-error --location "https://ttyinv.com/skills/ttyinv-invoice.tar.gz" -o "$ttyinv_skill_tmp/ttyinv-invoice.tar.gz" &&
    curl --fail --silent --show-error --location "https://ttyinv.com/skills/ttyinv-invoice.tar.gz.sha256" -o "$ttyinv_skill_tmp/ttyinv-invoice.tar.gz.sha256" &&
    (cd "$ttyinv_skill_tmp" && if command -v sha256sum >/dev/null 2>&1; then sha256sum -c ttyinv-invoice.tar.gz.sha256; else shasum -a 256 -c ttyinv-invoice.tar.gz.sha256; fi) &&
    test "$(tar -tzf "$ttyinv_skill_tmp/ttyinv-invoice.tar.gz")" = "$(printf 'ttyinv-invoice/\nttyinv-invoice/SKILL.md')" &&
    test "$(tar -tzvf "$ttyinv_skill_tmp/ttyinv-invoice.tar.gz" | cut -c1 | tr -d '\n')" = "d-" &&
    tar -xzOf "$ttyinv_skill_tmp/ttyinv-invoice.tar.gz" ttyinv-invoice/SKILL.md > "$ttyinv_skill_tmp/SKILL.md" &&
    test -s "$ttyinv_skill_tmp/SKILL.md" &&
    cat "$ttyinv_skill_tmp/SKILL.md" &&
    mkdir -p "$TTYINV_SKILL_DIR/ttyinv-invoice" &&
    cp "$ttyinv_skill_tmp/SKILL.md" "$TTYINV_SKILL_DIR/ttyinv-invoice/SKILL.md.tmp" &&
    mv "$TTYINV_SKILL_DIR/ttyinv-invoice/SKILL.md.tmp" "$TTYINV_SKILL_DIR/ttyinv-invoice/SKILL.md"
  2. 02

    Create a private token

    Sign in with GitHub on the hosted app, choose an expiry, then store the one-time value in TTYINV_AGENT_TOKEN.

    Manage tokens on app.ttyinv.com
  3. 03

    Connect and create

    Use MCP for tool discovery, or call the same strict contract over REST. Fetch the live contract instead of guessing fields.

    Open the quickstart

CHOOSE A PATH

One contract, three ways to work.

1

MCP

Let tools describe themselves

Streamable HTTP exposes create_invoice, validate_invoice, and render_invoice.

{
  "mcpServers": {
    "ttyinv": {
      "type": "http",
      "url": "https://app.ttyinv.com/mcp",
      "headers": { "Authorization": "Bearer ${TTYINV_AGENT_TOKEN}" }
    }
  }
}

Field names vary by harness. Some harnesses name the block servers, or split the URL and the transport. Keep the endpoint, the transport, and the Authorization header. Read the configuration reference of your harness.

https://app.ttyinv.com/mcp

2

API

Use plain authenticated JSON

Create at https://app.ttyinv.com/api/v1/invoices, then validate the returned source. Discovery and the schema are public. Every invoice operation requires the token.

# Paste the token at the silent prompt. The shell keeps it out of history.
read -r -s TTYINV_AGENT_TOKEN && export TTYINV_AGENT_TOKEN
# Discovery lists every operation, tool, status, and purchase rule.
curl --fail --silent --show-error "https://app.ttyinv.com/api/v1"
# The schema envelope is the authoritative input and output contract.
curl --fail --silent --show-error "https://app.ttyinv.com/api/v1/invoices/schema"
REST contracts and examples
3

CLI

Keep everything local

The Rust CLI validates, inspects, restructures, and renders files without sending invoice contents to ttyinv. It runs the same engine the browser loads as WebAssembly, and the same renderer the hosted API runs, so it is the right path for local-only data.

ttyinv validate invoice.md --json
ttyinv sections invoice.md --json
ttyinv edit move-section invoice.md --from 3 --to 1 --stdout
ttyinv render invoice.md --format pdf --output invoice.pdf
CLI installation and full guide

CAPABILITY MATRIX

What each path gives your agent.

Each harness chooses its own skill directory and its own configuration file. ttyinv states the contract; your harness states the file names.

Capabilities of each agent path
CapabilityMCPAPICLIPortable skill
Tool discoverytools/listGET https://app.ttyinv.com/api/v1ttyinv --helpDescribes both transports
Create and validatecreate_invoicePOST https://app.ttyinv.com/api/v1/invoicesttyinv validateGuides the workflow
Render to a filerender_invoicePOST https://app.ttyinv.com/api/v1/invoices/renderttyinv renderNames the shared renderer
PurchaseNot requiredNot requiredNot requiredStates no purchase gate
Agent tokenRequiredRequiredNot usedExplains token use
Invoice contentCrosses the networkCrosses the networkStays localStates the boundary
SetupConfiguration fileTTYINV_AGENT_TOKENSingle Rust binaryNames skill directory

AUTHENTICATION LIVES ON THE APP

Sign in before handing out a key.

GitHub identifies the owner of each expiring, revocable token. The public website is static; token creation, revocation, and authenticated requests stay on the app runtime.

Continue with GitHub