cointop

Coin tracking for hackers

cointop
htopvim

In action

Table of Contents

Features

  • Quick sort shortcuts
  • Custom key bindings configuration
  • Vim inspired shortcut keys
  • Fast pagination
  • Charts for coins and global market graphs
  • Quick chart date range change
  • Fuzzy searching for finding coins
  • Currency conversion
  • Save and view favorite coins
  • Portfolio tracking of holdings
  • 256-color support
  • Custom colorschemes
  • Help menu
  • Offline cache
  • Supports multiple coin stat APIs
  • Auto-refresh
  • Works on macOS, Linux, and Windows
  • It's very lightweight; can be left running indefinitely

Installing

There are multiple ways you can install cointop depending on the platform you're on.

From source (always latest and recommeded)

Make sure to have go (1.12+) installed, then do:

go get -u github.com/miguelmota/cointop
$GOPATH/bin$PATH

Now you can run cointop:

cointop

Binary (all platforms)

You can download the binary from the releases page

# replace x.x.x with the latest version
wget https://github.com/miguelmota/cointop/releases/download/x.x.x/cointop_x.x.x_linux_amd64.tar.gz
tar -xvzf cointop_x.x.x_linux_amd64.tar.gz cointop
./cointop

# optionally move to bin path
sudo mv cointop /usr/local/bin/cointop

Docker

docker run -it cointop/cointop

Homebrew (macOS)

cointop is available via Homebrew for macOS:

brew install cointop

Run

cointop

Flatpak (Linux)

cointop is available as a Flatpak package via the Flathub registry.

Add the flathub repository (if not done so already)

sudo flatpak remote-add --if-not-exists flathub https://flathub.org/repo/flathub.flatpakrepo

Install cointop flatpak

sudo flatpak install flathub com.github.miguelmota.Cointop

Run cointop flatpak

flatpak run com.github.miguelmota.Cointop

Copr (Fedora)

cointop is available as a copr package.

First, enable the respository

sudo dnf copr enable miguelmota/cointop -y

Install cointop

sudo dnf install cointop

Run

cointop

AUR (Arch Linux)

cointop is available as an AUR package.

git clone https://aur.archlinux.org/cointop.git
cd cointop
makepkg -si

Using yay

yay -S cointop

Snap (Ubuntu)

cointop is available as a snap for Linux users.

sudo snap install cointop --stable

Running snap:

sudo snap run cointop

Note: snaps don't work in Windows WSL. See this issue thread.

FreeBSD

cointop is available as a FreshPort package.

sudo pkg install cointop

Windows (PowerShell / WSL)

Install Go and git, then:

go get -u github.com/miguelmota/cointop

You'll need additional font support for Windows. Please see the wiki for instructions.

Binaries

You can find pre-built binaries on the releases page.

Updating

-u
go get -u github.com/miguelmota/cointop

Homebrew (macOS)

brew uninstall cointop && brew install cointop

Flatpak (Linux)

sudo flatpak uninstall com.github.miguelmota.Cointop
sudo flatpak install flathub com.github.miguelmota.Cointop

Copr (Fedora)

sudo dnf update cointop

Snap (Ubuntu)

refresh
sudo snap refresh cointop --stable

Getting started

cointop
$ cointop

Navigation

  • Easiest way to navigate up and down is using the arrow keys and , respectively
  • To go the next and previous pages, use and , respectively
  • To go to the top and bottom of the page, use g and G (Shift+g), respectively
  • Check out the rest of shortcut keys for vim-inspired navigation

Favorites

  • To toggle a coin as a favorite, press Space on the highlighted coin
  • To view all your favorite coins, press F (Shift+f)
  • To exit out of the favorites view, press F (Shift+f) again or q

Portfolio

  • To add a coin to your portfolio, press e on the highlighted coin
  • To edit the holdings of coin in your portfolio, press e on the highlighted coin
  • To view your portfolio, press P (Shift+p)
  • To exit out of the portfolio view press, P (Shift+p) again or q

Search

  • To search for coins, press / then enter the search query and hit Enter

Base Currency

  • To change the currency, press c then enter the character next to the desired currency

Shortcuts

List of default shortcut keys:

Key Action
Move up
Move down
Go to next page
Go to previous page
Page Up Jump page up
Page Down Jump page down
Home Go to first line of page
End Go to last line of page
Enter Toggle chart for highlighted coin
Esc Quit view
Space Toggle coin as favorite
Tab Move down or next page
Ctrl+c Quit application
Ctrl+d Jump page down (vim inspired)
Ctrl+f Search
Ctrl+n Go to next page
Ctrl+p Go to previous page
Ctrl+r Force refresh data
Ctrl+s Save config
Ctrl+u Jump page up (vim inspired)
Ctrl+j Increase chart height
Ctrl+k Decrease chart height
Alt+ Sort current column in ascending order
Alt+ Sort current column in descending order
Alt+ Sort column to the left
Alt+ Sort column to the right
F1 Show help
F5 Force refresh data
0 Go to first page (vim inspired)
1 Sort table by [1] hour change
2 Sort table by [2]4 hour change
7 Sort table by [7] day change
a Sort table by [a]vailable supply
b Sort table by [b]alance
c Show currency convert menu
C Show currency convert menu
e Show portfolio edit holdings menu
E (Shift+e) Show portfolio edit holdings menu
f Toggle coin as favorite
F (Shift+f) Toggle show favorites
g Go to first line of page (vim inspired)
G (Shift+g) Go to last line of page (vim inspired)
h Go to previous page (vim inspired)
h Sort table by [h]oldings (portfolio view only)
H (Shift+h) Go to top of table window (vim inspired)
j Move down (vim inspired)
k Move up (vim inspired)
l Go to next page (vim inspired)
L (Shift+l) Go to last line of visible table window (vim inspired)
m Sort table by [m]arket cap
M (Shift+m) Go to middle of visible table window (vim inspired)
n Sort table by [n]ame
o [o]pen link to highlighted coin (visits the API's coin page)
p Sort table by [p]rice
P (Shift+p) Toggle show portfolio
r Sort table by [r]ank
s Sort table by [s]ymbol
t Sort table by [t]otal supply
u Sort table by last [u]pdated
v Sort table by 24 hour [v]olume
q Quit view
$ Go to last page (vim inspired)
? Show help
/ Search (vim inspired)
] Next chart date range
[ Previous chart date range
} Last chart date range
{ First chart date range
\ Toggle table fullscreen

Colorschemes

cointop supports custom colorschemes (themes).

To use standard colorschemes, clone the colors repository into the config directory:

$ cd ~/.config/cointop
$ git clone git@github.com:cointop-sh/colors.git
~/.config/cointop/config.toml
colorscheme = "<colorscheme>"

The colorscheme name is the name of the colorscheme TOML file.

matrix.toml~/.cointop/colors/colorscheme
colorscheme = "matrix"
--colorscheme
$ cointop --colorscheme matrix

To create your own colorscheme; simply copy an existing colorscheme, rename it, and customize the colors.

Config

The first time you run cointop, it'll create a config file in:

~/.config/cointop/config.toml

You can then configure the actions you want for each key:

~/.config/cointop/config.toml
currency = "USD"
default_view = ""
api = "coingecko"
colorscheme = "cointop"
refresh_rate = 60

[shortcuts]
  "$" = "last_page"
  0 = "first_page"
  1 = "sort_column_1h_change"
  2 = "sort_column_24h_change"
  7 = "sort_column_7d_change"
  "?" = "help"
  "/" = "open_search"
  "[" = "previous_chart_range"
  "\\" = "toggle_table_fullscreen"
  "]" = "next_chart_range"
  "{" = "first_chart_range"
  "}" = "last_chart_range"
  C = "show_currency_convert_menu"
  E = "show_portfolio_edit_menu"
  G = "move_to_page_last_row"
  H = "move_to_page_visible_first_row"
  L = "move_to_page_visible_last_row"
  M = "move_to_page_visible_middle_row"
  O = "open_link"
  P = "toggle_portfolio"
  a = "sort_column_available_supply"
  "alt+down" = "sort_column_desc"
  "alt+left" = "sort_left_column"
  "alt+right" = "sort_right_column"
  "alt+up" = "sort_column_asc"
  down = "move_down"
  left = "previous_page"
  right = "next_page"
  up = "move_up"
  c = "show_currency_convert_menu"
  b = "sort_column_balance"
  "ctrl+c" = "quit"
  "ctrl+d" = "page_down"
  "ctrl+f" = "open_search"
  "ctrl+j" = "enlarge_chart"
  "ctrl+k" = "shorten_chart"
  "ctrl+n" = "next_page"
  "ctrl+p" = "previous_page"
  "ctrl+r" = "refresh"
  "ctrl+s" = "save"
  "ctrl+u" = "page_up"
  e = "show_portfolio_edit_menu"
  end = "move_to_page_last_row"
  enter = "toggle_row_chart"
  esc = "quit"
  f = "toggle_favorite"
  F = "toggle_show_favorites"
  F1 = "help"
  g = "move_to_page_first_row"
  h = "previous_page"
  home = "move_to_page_first_row"
  j = "move_down"
  k = "move_up"
  l = "next_page"
  m = "sort_column_market_cap"
  n = "sort_column_name"
  o = "open_link"
  p = "sort_column_price"
  pagedown = "page_down"
  pageup = "page_up"
  q = "quit_view"
	Q = "quit_view"
  r = "sort_column_rank"
  s = "sort_column_symbol"
  space = "toggle_favorite"
  tab = "move_down_or_next_page"
  t = "sort_column_total_supply"
  u = "sort_column_last_updated"
  v = "sort_column_24h_volume"

[favorites]

[portfolio]

[coinmarketcap]
  pro_api_key = ""
--config
cointop --config="/path/to/config.toml"

List of actions

This are the action keywords you may use in the config file to change what the shortcut keys do.

first_chart_rangefirst_pageenlarge_charthelphide_currency_convert_menulast_chart_rangelast_pagemove_to_page_first_rowmove_to_page_last_rowmove_to_page_visible_first_rowmove_to_page_visible_last_rowmove_to_page_visible_middle_rowmove_upmove_downmove_down_or_next_pagemove_up_or_previous_pagenext_chart_rangenext_pageopen_linkopen_searchpage_downpage_upprevious_chart_rangeprevious_pagequitquit_viewrefreshsaveshorten_chartshow_currency_convert_menushow_favoritessort_column_1h_changesort_column_24h_changesort_column_24h_volumesort_column_7d_changesort_column_ascsort_column_available_supplysort_column_balancesort_column_descsort_column_holdingssort_column_last_updatedsort_column_market_capsort_column_namesort_column_pricesort_column_ranksort_column_symbolsort_column_total_supplysort_left_columnsort_right_columntoggle_row_charttoggle_favoritetoggle_show_currency_convert_menutoggle_show_favoritestoggle_portfoliotoggle_show_portfolioshow_portfolio_edit_menutoggle_table_fullscreen

FAQ

Frequently asked questions:

api = "coingecko"
refresh_rate = 60
[coinmarketcap]
  pro_api_key = "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx"
export CMC_PRO_API_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
cointop --coinmarketcap-api-key=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
export GOPATH=$HOME/go
export PATH=$PATH:$GOPATH/bin
$ Get-ChildItem Env:GOPATH

Name                           Value
----                           -----
GOPATH                         C:\Users\alice\go
> md C:\Users\Josem\go\src\github.com\miguelmota -ea 0
> git clone https://github.com/miguelmota/cointop.git
> go build -o cointop.exe main.go
> cointop.exe
rm -rf ~/.cointop
DEV_IN=/dev/stdout DEV_OUT=/dev/stdout cointop
$ cointop price --coin ethereum
$277.76

$ cointop price -c ethereum --currency btc
Ƀ0.02814

$ cointop -c ethereum -f eur
€245.51

$ cointop price -c ethereum -f usd --api coinmarketcap
$276.37

Mentioned in

Cointop has been mentioned in:

Contributing

Pull requests are welcome!

For contributions please create a new branch and submit a pull request for review.

Development

Go

Running cointop from source

make run

Update vendor dependencies

make deps

Homebrew

Installing from source

make brew/build

Flatpak

Install the freedesktop runtime (if not done so already)

sudo flatpak install flathub org.freedesktop.Platform//1.6 org.freedesktop.Sdk//1.6

Install golang extension

sudo flatpak install flathub org.freedesktop.Sdk.Extension.golang

Building flatpak package

make flatpak/build

Copr

Install dependencies

make copr/install/cli
make rpm/install/deps
make rpm/dirs

Build package

make rpm/cp/specs
make rpm/download
make rpm/build
make copr/build

Snap

Building snap

make snap/build

Deployment

See this wiki.

Tip Jar

3KdMW53vUMLPEC33xhHAUx4EFtvmXQF8Kf
0x0072cdd7c3d9963ba69506ECf50e16E963B35bb1

Thank you for tips! 🙏

License

Released under the Apache 2.0 license.