BTI(1)

πŸ’… bti β€” the BTI(1) manual, but make it a group chat πŸ’…

okay so bestie, welcome to BTI(1), aka the manual page for bti. she's small, she's mighty, she tweets from your terminal. let's get into it 🫢


✨ NAME ✨

bti β€” send a tweet to twitter.com from the command line πŸ¦πŸ’–


✨ SYNOPSIS ✨

bti [--account account] [--password password] [--action action]
    [--user screenname] [--host HOST_NAME] [--proxy PROXY:PORT]
    [--logfile LOGFILE] [--config CONFIGFILE] [--replyto ID]
    [--retweet ID] [--page PAGENUMBER] [--bash] [--shrink-urls]
    [--debug] [--dry-run] [--verbose] [--version] [--help]

✨ DESCRIPTION ✨

bti sends a tweet message to twitter.com. that's it. that's the whole personality. simple, iconic, no notes πŸ’…


πŸ’– OPTIONS πŸ’–

  • --account account β€” tells bti which twitter.com account name to use 🫢
  • --password password β€” the password for your twitter.com account. keep it cute, keep it secret 🀫
  • --action action β€” which thing do you wanna do?? valid options are: "update" to send a message, "friends" to see your friends timeline, "public" to track the public timeline, "replies" to see replies to your messages, "user" to see a specific user's timeline, and "direct" to send a direct message to a friend. the default is "update" ✨
  • --user screenname β€” when the action is "user", this is whose messages you wanna see. when the action is "direct", this is the receiver of the DM (and bestie, the sender must be following the receiver, that's the rule πŸ‘€)
  • --host HOST_NAME β€” which host you're sending your message to. valid options are "twitter", to send to twitter.com.
    • if you don't specify a host, it defaults to sending to twitter.com πŸ’«
  • --proxy PROXY:PORT β€” an http proxy value. not required, only needed if your system is behind an http proxy 😭
    • if --proxy isn't specified but the environment variable http_proxy is set, then http_proxy gets used instead. she's flexible like that.
  • --logfile LOGFILE β€” a logfile for bti to write status messages to. heads up: LOGFILE is relative to your home directory, not an absolute path to a file. important detail, don't skip it πŸŽ€
  • --config CONFIGFILE β€” a config file for bti to read from. by default bti goes looking in ~/.bti for config values, but you can override that default location by pointing at a specific file with this option πŸ’–
  • --replyto ID β€” the status ID of a single post you wanna create a threaded reply to.
    • for twitter, this gets ignored unless your message starts with the @name of the owner of the post with that status ID πŸ‘‘
    • for status.net, this can link any two messages into context with each other. status.net will also link a message that contains an @name without this, without regard to context. yeah. she does that.
  • --retweet ID β€” the status ID of a single post you wanna retweet πŸ”
  • --shrink-urls β€” scans the tweet text for valid URL patterns and passes each one through the supplied bti-shrink-urls script. that script hands the URL to a web service that shrinks it, which makes it way more suitable for micro-blogging πŸ’…
  • --debug β€” prints a whole bunch of debugging messages to stdout. a lot. a whole bunch. you've been warned πŸ’€
  • --page PAGENUMBER β€” when the action is to retrieve updates, it usually only grabs one page. use this option and you can specify the page number πŸ¦‹
  • --dry-run β€” does every single step that would normally happen for a given action, but will not connect to the service to post or retrieve data. it's the rehearsal, not the show ✨
  • --verbose β€” verbose mode. prints status IDs and timestamps πŸ•
  • --bash β€” adds the working directory and a '$' in the tweet message to help specify it's coming from a command line. and like, don't put the working directory and the '$' in the tweet message yourself, okay? let her do it.
    • this option implies --background πŸŒ™
  • --background β€” does not report back any errors that might have happened while sending the message, and sends it in the background, returning immediately so you can keep doing your thing πŸƒβ€β™€οΈ
  • --version β€” print version number πŸ”’
  • --help β€” print help text 🫢

✨ DESCRIPTION ✨

okay so bti gives you an easy way to send tweet messages directly from the command line or from any script. it reads the message on standard input, and it uses the account and password settings either from the command line options or from a config file, and then it sends the message out πŸ’Œ

her primary focus? letting you log everything you type into a bash shell, in a crazy "this is what I'm doing right now!!" type of way, letting the world follow along with you as you constantly move between directories and refresh your email queue to see if anything interesting is going on. main character energy, honestly πŸ‘‘

to hook bti up to your bash shell, export the following variable:

PROMPT_COMMAND='history 1 | sed -e "s/^\s*[0-9]*\s*//" | bti --bash'

this example assumes you already have ~/.bti set up with your account and password info in it β€” otherwise you can just specify them as an option πŸ’–


πŸŽ€ CONFIGURATION πŸŽ€

the account and password can be stored in a configuration file in the user's home directory, in a file named .bti. the structure of this file is as follows:

  • account β€” the twitter.com account name you wanna use to send this message with.
  • password β€” the twitter.com password for the account you wanna use to send this message with.
  • --action action β€” specify the action you wanna perform. valid options are "update" to send a message, "friends" to see your friends timeline, "public" to track the public timeline, "replies" to see replies to your messages, and "user" to see a specific user's timeline.
  • --user screenname β€” specify the user whose messages you wanna see while the action is "user".
  • host β€” the host you wanna use to send the message to. valid options are "twitter", or "custom" to specify your own server.
  • proxy β€” the http proxy needed to send data out to the Internet.
  • logfile β€” the logfile name for bti to write what happened to. this file is relative to the user's home directory. if this file isn't specified here or on the command line, no logging will be written to the disk πŸ“
  • replyto β€” the status ID to which all notices will be linked to.
    • there is no sane reason for a need to have this set in a config file. one such reason is to have all your messages as children to a particular status. (her words, not mine 😭)
  • shrink-urls β€” setting this variable to 'true' or 'yes' enables the URL shrinking feature. this is equivalent to using the --shrink-urls option ✨
  • verbose β€” setting this variable to 'true' or 'yes' enables verbose mode πŸ—£οΈ

there's an example config file in /usr/share/doc/bti/examples/bti.example that shows the structure of the file πŸ‘€

configuration options have the following priority:

  • command line option
  • config file option
  • environment variables

for example, command line options always override any config file option, or any environment variables. unless a config file is specified by the command line. at that point, the new config file is read, and any previous options set by a command line option would be overridden. the way that a later config file just swoops in and takes over?? it's giving plot twist πŸŒͺ️


πŸ’œ AUTHOR πŸ’œ

written by Greg Kroah-Hartman <greg@kroah.com> and Amir Mohammad Saied <amirsaied@gmail.com>. legends, honestly 🫢


and that's the whole page, bestie!! this was bti from May 2008, living in the BTI(1) section of your manual pages. go forth and tweet from your terminal, you absolute icon πŸ’…βœ¨πŸ’–