tweet-hs: Command-line tool for twitter

[ bsd3, library, web ] [ Propose Tags ]

a Command Line Interface Tweeter

[Skip to Readme]
Versions [faq],,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
Dependencies ansi-wl-pprint (>= && <0.7), authenticate-oauth (==1.6.*), base (>= && <4.10), bytestring (>= && <0.11), composition (>= && <1.1), data-default (>= && <0.8), directory (>= && <1.4), extra (>=1.5.1 && <1.6), http-client (>= && <0.6), http-client-tls (>=0.3.4 && <0.4), http-types (>=0.9.1 && <0.10), lens (>=4.15.1 && <4.16), megaparsec (>=5.2.0 && <5.3), MissingH (>= && <1.5), optparse-applicative (>= && <0.14), split (>= && <0.3), text (>= && <1.3), tweet-hs (>= && <0.6) [details]
License BSD-3-Clause
Copyright 2016 Vanessa McHale
Author Vanessa McHale
Category Web
Home page
Source repo head: git clone
Uploaded by vmchale at Mon Mar 27 05:31:07 UTC 2017
Distributions NixOS:
Executables tweet
Downloads 11214 total (331 in the last 30 days)
Rating (no votes yet) [estimated by rule of succession]
Your Rating
  • λ
  • λ
  • λ
Status Hackage Matrix CI
Docs uploaded by user [build log]
All reported builds failed as of 2017-03-27 [all 3 reports]





Enable build with llvm backend


Use -f <flag> to enable a flag, or -f -<flag> to disable that flag. More info


Maintainer's Corner

For package maintainers and hackage trustees

Readme for tweet-hs-

[back to package description]

Command Line Interface Tweeter

Build Status

Displaying a user timeline in a terminal.


Generate a token to authorize access to your twitter account by following the guide here

Then place your API keys and OAuth tokens in a file ~/.cred, separated by a line break:

api-key: API_KEY_HERE


If you're on Linux/Windows the best way is probably to download the binaries from the releases page here.

To build from source, install haskell stack; on unix systems this is as simple as

wget -qO- | sh

Then type stack install tweet-hs it will generate an executable called tweet, which is what we want.


View Profiles and timelines

To get your timeline, simply type:

tweet view

To view a user's profile, type e.g.

tweet user pinepapplesmear --color

Sending tweets

To tweet from stderr, run a command that pipes stderr to stdin, i.e.

YOUR_BUILD_COMMAND 2>&1 >/dev/null | tweet input

The tweet executable reads from stdIn only, but you can view the options (replies, number of tweets to thread, etc.) with

tweet --help

This script powers the twitter account @my_build_errors for instance. There's an example bash script for in bash/example

Viewing your timeline

You can also use

tweet view


tweet view --color

to view your own timeline.


The directory bash/ has a mkCompletions script to allow command completions for your convenience.


A haskell package is included. It's fairly easy to use once you have the credentials set up, with two main functions: thread and basicTweet: the first for threading your own tweets or replying to someone else's and the second for just tweeting.

Finer details

The function tweetData will tweet an object of type Tweet. Its use is pretty self-explanatory, but how to best form Tweets is not immediately obvious.

Tweet is an instance of Default so you can use def to get an empty tweet replying to nobody and not fetching extended user data. This is especially useful if you want to use lenses and avoid ugly record syntax, e.g.

set status "This is the new status field" $ def

will give you a Tweet with sensible defaults and the desired text.