Posting¶
Basic post¶
The URL of the new status is printed on success:
Reading from a file¶
Use --file to read the status text from a file instead of passing it on the command line.
This is useful for longer posts composed in an editor.
--file is mutually exclusive with a positional text argument.
Reading from stdin¶
Pass - as the text argument to read from standard input:
Multi-line posts using a here-document:
Visibility¶
Control who can see the post with --visibility / -v.
| Value | Meaning |
|---|---|
public |
Visible to everyone; appears in public timelines (default) |
unlisted |
Visible to everyone; does not appear in public timelines |
private |
Visible to followers only |
direct |
Visible only to mentioned accounts |
taibai post "A quiet thought." --visibility unlisted
taibai post "Just for followers." -v private
taibai post "@friend@example.com Hey, DM!" -v direct
Content warnings¶
Add a subject line / content warning with --cw. Followers see the warning and can choose
whether to expand the post.
Media attachments¶
Attach images, videos, or audio files with --attach. The flag is repeatable; servers typically
enforce a maximum of four attachments per post.
Attach multiple files:
taibai post "A trip in photos." \
--attach monday.jpg \
--attach tuesday.jpg \
--attach wednesday.jpg
Alt text¶
Pair each --attach with --alt-text in the same positional order to provide accessibility
descriptions:
taibai post "Sunset over the sea." \
--attach sunset.jpg \
--alt-text "Orange and pink sky reflected in calm water at dusk."
When attaching multiple files, each --alt-text corresponds to the --attach at the same
position:
taibai post "Before and after." \
--attach before.png --alt-text "Empty room with bare walls." \
--attach after.png --alt-text "Same room, now furnished and painted."
Sensitive media¶
Mark all attached media as sensitive with --sensitive. Viewers must opt in to see the content:
Note — polls and attachments are mutually exclusive
The Mastodon API does not allow a post to contain both a poll and media attachments. If both
--poll-optionand--attachare supplied, taibai exits with an error before contacting the server.
Polls¶
Add a poll with one or more --poll-option flags (minimum 2, maximum 4 options):
taibai post "Favourite season?" \
--poll-option "Spring" \
--poll-option "Summer" \
--poll-option "Autumn" \
--poll-option "Winter"
Poll duration¶
--poll-expires sets the poll duration in seconds. The default is 86 400 seconds (24 hours).
The minimum is 300 seconds (5 minutes).
taibai post "Quick vote — tabs or spaces?" \
--poll-option "Tabs" \
--poll-option "Spaces" \
--poll-expires 3600
Multiple-choice polls¶
Allow voters to select more than one option with --poll-multiple:
taibai post "Which do you use?" \
--poll-option "Mastodon" \
--poll-option "Pleroma" \
--poll-option "GotoSocial" \
--poll-multiple
Hidden totals¶
Hide vote counts until the poll closes with --poll-hide-totals:
taibai post "Blind taste test — A or B?" \
--poll-option "A" \
--poll-option "B" \
--poll-hide-totals
Replies¶
Use --reply-to to make a post a reply to an existing status. Pass the status URL or bare ID:
taibai post "Great point!" --reply-to 109031952222346765
taibai post "Great point!" --reply-to https://mastodon.social/@user/109031952222346765
Building a thread manually¶
Combine --reply-to with --json | jq to chain posts into a thread. Each reply captures the
ID of the previous post and uses it as the parent:
# Post the opening toot and capture its ID
ID=$(taibai post "1/3 — Starting a thread." --json | jq -r '.id')
# Reply to it
ID=$(taibai post "2/3 — Continuing the thread." --reply-to "$ID" --json | jq -r '.id')
# Continue the chain
taibai post "3/3 — Wrapping up." --reply-to "$ID"
Each --json | jq -r '.id' captures the ID of the post just made, so the next post becomes
a reply in the same thread. Extend the pattern for as many posts as you need.
Posting a thread from a file¶
For longer threads composed in an editor, use the thread command to post an
entire thread from a single formatted file:
See the Posting Threads page for the file format and all options.
JSON output¶
Pass --json to dump the posted status as JSON instead of printing its URL. Only fields that
have a value are included. Useful for scripting or capturing the new status ID:
Complete options reference¶
| Option | Short | Default | Description |
|---|---|---|---|
TEXT |
— | — | Status text; use - to read from stdin |
--file |
— | — | Read status text from a file (exclusive with TEXT) |
--visibility |
-v |
public |
Visibility: public, unlisted, private, or direct |
--cw |
— | — | Content warning / subject line |
--attach |
— | — | Media file to attach (repeatable) |
--alt-text |
— | — | Alt text paired positionally with --attach (repeatable) |
--sensitive |
— | off | Mark attached media as sensitive |
--poll-option |
— | — | Poll option (repeatable; min 2, max 4) |
--poll-expires |
— | 86400 |
Poll duration in seconds (min 300) |
--poll-multiple |
— | off | Allow multiple selections in a poll |
--poll-hide-totals |
— | off | Hide vote totals until poll closes |
--reply-to |
— | — | Reply to this status URL or ID |
--json |
— | off | Dump the posted status as JSON instead of printing its URL |
--profile |
-p |
default |
Profile name (TAIBAI_PROFILE env var) |