knit
Knit your agent into Threads — safely.
An agent-friendly CLI for Instagram's Threads, built on the official API. Read-only by default, posting gated in the binary, prompt-injection-fenced, machine-readable.
go install github.com/rnwolfe/knit/cmd/knit@latest
Plenty of Threads CLIs exist.
None is built for an agent to drive safely.
Read-only by default
Every mutation is blocked unless you pass --allow-mutations — enforced in the binary, returning a structured MUTATION_BLOCKED (exit 12). No "type y" prompt that deadlocks a headless agent.
Reviewed-artifact publishing
post create --dry-run emits the exact plan + a hash; --apply <hash> publishes only that plan. No blind --yes on an irreversible public post.
Prompt-injection-fenced
It's a public feed. Post, reply, search, mention text and bios are wrapped as untrusted data, never instructions — on by default in agent mode.
Machine-readable & official
knit schema dumps the command tree, exit codes, and live safety state; knit agent prints the embedded contract. Built on the official API → low breakage risk.
Noun-verb, read by default
Nine reads, six gated mutations. Every read returns a stable {schemaVersion, data, nextCursor} envelope — --limit and --select keep it inside an agent's context window.
On your machine in one line
$ brew install rnwolfe/tap/knit # macOS / Linux
$ go install github.com/rnwolfe/knit/cmd/knit@latest
# prebuilt binaries (linux · macOS · windows, amd64 · arm64): → github.com/rnwolfe/knit/releases
$ printf '%s' "$THREADS_TOKEN" | knit auth login --token-stdin $ knit auth status --json # account · expiry · publish quota