Skip to content

Releases: tamnd/threads-cli

v0.1.1

13 Jun 19:09
v0.1.1
ae98952

Choose a tag to compare

A pass over every command, run live against threads.com, turned up four rough edges. This release fixes them.

A missing profile no longer returns fake data

Asking for a handle with no public profile used to return a record built from the logged-out page's generic "Join Threads" description, with no id and a placeholder bio, and exit 0. A real profile page always embeds the user object, the only place the numeric id appears, so a page without one is the wall, not a profile. th profile now reports not found (exit 3).

--fields and --template share one field vocabulary

--template used to accept only the Go field names ({{.LikeCount}}), while --fields and the table header used the short column aliases (likes). You can now name a field three ways in either flag: the column alias (likes), the JSON key (like_count), or the Go field name (LikeCount). This also lets --fields pull a field with no column alias, such as user_id or quote_count.

Misuse exits 2

A wrong argument count, an unknown flag, and an unknown command now all exit 2, matching the documented exit-code table, instead of the generic 1.

Install

go install github.com/tamnd/threads-cli/cmd/th@latest

Or download a prebuilt binary below, or run ghcr.io/tamnd/th:0.1.1.

v0.1.0

13 Jun 18:04
v0.1.0
3b40942

Choose a tag to compare

The first release of th, a command line for Threads.

th reads threads.com anonymously, as a web crawler, with no login and no
browser. It fetches the server-rendered page behind a profile or post, parses
the embedded JSON into typed records, and prints them in whatever format you
ask for.

Commands

  • profile resolves a profile to a full record, and walks its posts (--posts) or replies (--replies).
  • post fetches a single post in full, streams its reply thread (--replies), or prints the upstream HTML (--raw).
  • replies streams a post's replies as their own records.
  • feed walks a profile's most-recent posts.
  • search runs a logged-out keyword search.
  • id classifies any handle, id, shortcode, or URL offline, rewriting threads.net links to their canonical threads.com form.
  • db build / db query crawl a profile into a local SQLite dataset and query it. The store is pure Go, so the binary stays cgo-free.
  • whoami, config, cache, completion, and version round out the tree.

How it reads

Every record is a plain struct with JSON tags, rendered through one formatter: table on a terminal, JSON Lines when piped, plus json, csv, tsv, yaml, and url. Narrow columns with --fields or template each row with --template. Responses are cached on disk by URL, and requests are paced and retried.

Private or walled content exits 4; the logged-out GraphQL paths that ride on rotating query ids exit 3 when an id goes stale, while the server-rendered surface keeps working. Optional token and session modes add depth on your own account, off by default.

Install

go install github.com/tamnd/threads-cli/cmd/th@latest

Or download a prebuilt binary below, or run the container image ghcr.io/tamnd/th:0.1.0.