Skip to content

birdknife is a Twitter CLI based on Vorpal inspired by TTYtter.

License

Notifications You must be signed in to change notification settings

vanita5/birdknife

Repository files navigation

Twitter CLI

Build Status NPM Downloads NPM Version Dependency Status XO code style

birdknife is a Twitter CLI based on Vorpal inspired by TTYtter. TTYtter hasn't been updated for some time now and doesn't support new features introduced by Twitter. This project aims to be a completely functional Twitter client for your CLI.

Features

  • Full featured Twitter CLI
  • Cross platform
  • Read your timeline and interact with tweets
    • Reply, retweet, like (fav), quote,...
  • Interact with users
    • Follow, block, mute
  • Update your status with media and location
  • Search on Twitter
  • Hashtag and @screen_name autocompletion
  • Notifications (Cross platform)

In the future

  • Work with lists
    • Follow, view, create, add/remove users,...
  • Manage multiple accounts
  • Open/View media and urls (browser or image viewer)

Installation

Install birdknife globally via npm:

$ npm install birdknife -g

Configuration

After initially calling birdknife, you should find a configuration file in your home directory.

GNU/Linux, Mac OS X,... ~/.birdknife.json

Windows C:\Users\user\.birdknife.json

Example:

{
  "version": 5,
  "auth": {
    "consumer_key": "XXXXXXXXXXXXXXXXXXXXXX",
    "consumer_secret": "XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX",
    "access_token": "00000000-xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "access_token_secret": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx"
  },
  "preferences": {
    "debug": false,
    "notifications": true,
    "location": false,
    "tweet_protection": false,
    "timestamp": 5
  }
}

Only edit values under the preferences section!

Preferences

Preference Description Values Default
debug Enable/Disable debug output for streaming events like limits, disconnects and reconnects. true, false false
notifications Enable/Disable notifications. birdknife can display notifications for mentions, likes, retweets, followings,...
This is a cross platform feature running on GNU/Linux (notify-osd or libnotify),
Mac OS X (NotificationCenter, since 10.8) and Windows 8 (and newer).
Alternatively it supports Growl in case nothing else works.
true, false true
location Enable/Disable posting your location. The location can be detected automatically.
Alternatively you can provide coordinations.
false, "auto" (or true),
{ lat: 57.52936, lng: -6.24176 }
false
tweet_protection If set to true this should prevent accidentally posting a status update. To post a status, enter /tweet first.
This command provides a new prompt where you can enter your status update.
false, true false
timestamp Set the time interval in minutes where birdknife will print out timestamps.
To disable timestamps, set timestamp to 0.
0-59 5

Edit preferences

Note: You can also directly edit the config file!

List preferences
birdknife [---]> /preferences
|
|   debug:          false
|   notifications:  true
|   location:       "auto"
|
Set preference
birdknife [---]> /set notifications false
notifications is now set to false

birdknife [---]> /set location { "lat": 57.52936, "lng": -6.24176 }
location is now set to [object Object]

birdknife [---]> /preferences
|
|   debug:          false
|   notifications:  false
|   location:       {"lat":57.52936,"lng":-6.24176}
|

Information

Tweet prefix

Some tweets have a prefix before the username. Those prefixes indicate characteristics of a tweet.

Example: b1> <*@username>: What a beautiful day!

Prefix Description
* Indicates that this tweet is a reply to another tweet. It is probably part of a conversation/thread.
Hint: Run /thread to view the thread.
This tweet is either a reply to the tweet above (only in conversations) or has been quoted by the tweet above.

Usage

Login (PIN authorization)
birdknife [---]> /login

Login and copy the PIN number: https://twitter.com/oauth/authorize?oauth_token=XXXX-XXXXXXXXXXXXXXXXXXXXXX
PIN:

To remove your account from birdknife: /logout

Tweet

The easy way:

birdknife [128]> Hello World!

How to post multiline tweets:

birdknife [...]> /tweet

Enter /send to update your status.
Tweet [136]> This
Tweet [133]> is
Tweet [131]> a
Tweet [121]> multiline
Tweet [114]> tweet!
Tweet [...]> /send

a1> <@_vanita5>: This
is
a
multiline
tweet!

How to post tweets with media:

birdknife [...]> /tweet /home/vanita5/dog.png /home/vanita5/cat.png

Enter /send to update your status.
Tweet [124]> Look at my pets!
Tweet [123]> /send
-- Uploading file: /home/vanita5/dog.png
-- Uploading file: /home/vanita5/cat.png

ab> <@_vanita5>: Look at my pets! pic.twitter.com/xxxxxxxxx

Note: This command has filesystem autocompletion!

View threads / conversations
birdknife [---]> /thread <id>
Reply to a tweet
a1> <@twitter>: #birdknife is kinda nice!

birdknife [124]> /reply a1 FAAAKE!

Alias: /re

Quote a tweet
a1> <@twitter>: #birdknife is kinda nice!

birdknife [109]> /quote a1 FAAAKE!

a2> <@_vanita5>: FAAAKE! https://twitter.com/twitter/status/12345678901234

a3> |   <↑@twitter>: #birdknife is kinda nice!
Retweet
birdknife [---]> /retweet <id>

Alias: /rt

Like / Favorite
birdknife [---]> /like <id>

Alias: /fav

Remove from likes / favorites
birdknife [---]> /unlike <id>

Alias: /unfav

Follow / Unfollow
birdknife [---]> /follow _vanita5
birdknife [---]> /unfollow _vanita5
Block / Unblock
birdknife [---]> /block _vanita5
birdknife [---]> /unblock _vanita5
Mute / Unmute
birdknife [---]> /mute _vanita5
birdknife [---]> /unmute _vanita5
Mentions / Replies
birdknife [---]> /replies

Show recent mentions.

Direct messages

Note: You can reply to dms directly with the /reply <id> command!

birdknife [---]> /dms

Display direct messages inbox.

birdknife [---]> /dm _vanita5 Hello, this is a test from birdknife.

Send DMs to a user.

Search
birdknife [---]> /search <query>

Search for tweets.

Quit
birdknife [---]> /exit
Other commands
/again [screen_name]

Reloads your timeline or loads recent tweets of a user if screen_name is given.

/delete <id>

Delete a tweet.

/user <screen_name>

Display user information

/show <id>

Display a tweet with additional information.

Development

Fork, clone, npm install, code, pull request. :)

License

(The MIT License)

Copyright (c) 2016 vanita5 <mail@vanit.as>

Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
'Software'), to deal in the Software without restriction, including
without limitation the rights to use, copy, modify, merge, publish,
distribute, sublicense, and/or sell copies of the Software, and to
permit persons to whom the Software is furnished to do so, subject to
the following conditions:

The above copyright notice and this permission notice shall be
included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.