[`cointop`](https://github.com/cointop-sh/cointop) is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.
[`cointop`](https://github.com/miguelmota/cointop) is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.
The interface is inspired by [`htop`](https://en.wikipedia.org/wiki/Htop) and shortcut keys are inspired by [`vim`](https://en.wikipedia.org/wiki/Vim_(text_editor)).
@ -25,8 +25,6 @@ The interface is inspired by [`htop`](https://en.wikipedia.org/wiki/Htop) and sh
## Demo
This connects to an instance of Cointop using SSH:
```bash
ssh cointop.sh
```
@ -37,18 +35,16 @@ In action
## Table of Contents
Documentation has been moved to [docs.cointop.sh](https://docs.cointop.sh/)
- **Colorschemes**: Custom colorscheme configuration, 256-color and 24-bit support
- **Favorites**: Save and view favorite coins
- **Portfolio**: Portfolio tracking of holdings, view profit & loss
- **Charts**: Charts for coin price history and global market graphs
- **Search**: Fuzzy searching for finding coins
- **Conversion**: Currency conversion
- **Price Alerts**: Price alerts with desktop notifications
- **Multiple APIs**: Supports multiple coin data APIs; CoinGecko and CoinMarketCap
- **Mouse**: Mouse support
- **Offline**: Offline cache
- **Fast**: Fast sort shortcuts, pagination, chart date range change, auto-refresh
- **Lightweight**: It's very lightweight; can be left running indefinitely
- 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
## Documentation
Documentation has been moved to [docs.cointop.sh](https://docs.cointop.sh/)
Some helpful documentation links are provided below.
## Install
See [docs.cointop.sh/install](https://docs.cointop.sh/install)
## Update
See [docs.cointop.sh/update](https://docs.cointop.sh/update)
## Shortcuts
See [docs.cointop.sh/shortcuts](https://docs.cointop.sh/shortcuts)
## Colorschemes
See [docs.cointop.sh/colorschemes](https://docs.cointop.sh/colorschemes)
## Config
See [docs.cointop.sh/config](https://docs.cointop.sh/config)
## SSH Server
See [docs.cointop.sh/ssh](https://docs.cointop.sh/ssh)
## FAQ
See [docs.cointop.sh/faq](https://docs.cointop.sh/faq)
## Contributing
See [docs.cointop.sh/contributing](https://docs.cointop.sh/contributing)
_Many thanks to [Simon Roberts](https://github.com/lyricnz), [Alexis Hildebrandt](https://github.com/afh), and all the [contributors](https://github.com/cointop-sh/cointop/graphs/contributors) that made cointop better._
## Social
- Follow on twitter [@cointop](https://twitter.com/cointop)
- Chat on [Telegram](https://telegram.me/cointopsh)
- Discuss on [Discord](https://discord.gg/pUVGy7ECGg)
@ -94,12 +130,10 @@ Cointop has been mentioned in:
[![BTC Tip Jar](https://img.shields.io/badge/BTC-tip-yellow.svg?logo=bitcoin&style=flat)](https://www.blockchain.com/btc/address/3KdMW53vUMLPEC33xhHAUx4EFtvmXQF8Kf) `3KdMW53vUMLPEC33xhHAUx4EFtvmXQF8Kf`
[![ETH Tip Jar](https://img.shields.io/badge/ETH-tip-blue.svg?logo=ethereum&style=flat)](https://etherscan.io/address/0xC014b8F6F43f467922E93De62C9216F0538E0F8f) `0xC014b8F6F43f467922E93De62C9216F0538E0F8f`
[![ETH Tip Jar](https://img.shields.io/badge/ETH-tip-blue.svg?logo=ethereum&style=flat)](https://etherscan.io/address/0x0072cdd7c3d9963ba69506ECf50e16E963B35bb1) `0x0072cdd7c3d9963ba69506ECf50e16E963B35bb1`
Thank you for tips! 🙏
## License
Released under the [Apache 2.0](./LICENSE) license.
holdingsCmd.Flags().BoolVarP(&hideBalances,"hide-balances","",hideBalances,"Hide portfolio balances. Useful for when sharing screen or taking screenshotss")
holdingsCmd.Flags().StringVarP(&sortBy,"sort-by","s",sortBy,`Sort by column. Options are "name", "symbol", "price", "holdings", "balance", "24h"`)
holdingsCmd.Flags().BoolVarP(&sortDesc,"sort-desc","d",sortDesc,"Sort in descending order")
holdingsCmd.Flags().StringVarP(&format,"format","",format,`Ouput format. Options are "table", "csv", "json"`)
holdingsCmd.Flags().StringSliceVarP(&filter,"filter","",filter,`Filter portfolio entries by coin name or symbol, comma separated without spaces. Example: "btc,eth,doge"`)
holdingsCmd.Flags().StringSliceVarP(&cols,"cols","",cols,`Filter portfolio columns, comma separated without spaces. Example: "symbol,holdings,balance"`)
holdingsCmd.Flags().StringSliceVarP(&filter,"filter","",filter,`Filter portfolio entries by coin name or symbol, comma separated. Example: "btc,eth,doge"`)
holdingsCmd.Flags().StringVarP(&convert,"convert","f",convert,"The currency to convert to")
@ -62,27 +55,21 @@ See git.io/cointop for more info.`,
returnnil
}
// wipe before starting program
ifreset||clean{
ct,err:=cointop.NewCointop(&cointop.Config{
CacheDir:cacheDir,
ConfigFilepath:config,
})
iferr!=nil{
// NOTE: if reset flag enabled, reset and run cointop
ifreset{
iferr:=cointop.Reset(&cointop.ResetConfig{
Log:!silent,
});err!=nil{
returnerr
}
ifreset{
iferr:=ct.Reset(&cointop.ResetConfig{
Log:!silent,
});err!=nil{
returnerr
}
}elseifclean{
iferr:=ct.Clean(&cointop.CleanConfig{
Log:!silent,
});err!=nil{
returnerr
}
}
// NOTE: if clean flag enabled, clean and run cointop
ifclean{
iferr:=cointop.Clean(&cointop.CleanConfig{
Log:!silent,
});err!=nil{
returnerr
}
}
@ -90,34 +77,22 @@ See git.io/cointop for more info.`,
ifcmd.Flags().Changed("refresh-rate"){
refreshRateP=&refreshRate
}
ifrefreshRateP==nil{
value,ok:=getEnvInt("COINTOP_REFRESH_RATE")
ifok{
uv:=uint(value)
refreshRateP=&uv
}
}
ct,err:=cointop.NewCointop(&cointop.Config{
CacheDir:cacheDir,
ColorsDir:colorsDir,
NoCache:noCache,
ConfigFilepath:config,
CoinMarketCapAPIKey:cmcAPIKey,
CoinGeckoAPIKey:coingeckoAPIKey,
CoinGeckoProAPIKey:coingeckoProAPIKey,
APIChoice:apiChoice,
Colorscheme:colorscheme,
HideMarketbar:hideMarketbar,
HideChart:hideChart,
HideTable:hideTable,
HideStatusbar:hideStatusbar,
OnlyTable:onlyTable,
OnlyChart:onlyChart,
RefreshRate:refreshRateP,
PerPage:perPage,
MaxPages:maxPages,
HidePortfolioBalances:hidePortfolioBalances,
CacheDir:cacheDir,
ColorsDir:colorsDir,
NoCache:noCache,
ConfigFilepath:config,
CoinMarketCapAPIKey:cmcAPIKey,
APIChoice:apiChoice,
Colorscheme:colorscheme,
HideMarketbar:hideMarketbar,
HideChart:hideChart,
HideStatusbar:hideStatusbar,
OnlyTable:onlyTable,
RefreshRate:refreshRateP,
PerPage:perPage,
MaxPages:maxPages,
})
iferr!=nil{
returnerr
@ -127,58 +102,25 @@ See git.io/cointop for more info.`,
},
}
rootCmd.Flags().BoolVarP(&version,"version","v",version,"Display current version")
rootCmd.Flags().BoolVarP(&test,"test","",test,"Run test (for Homebrew)")
rootCmd.Flags().BoolVarP(&clean,"clean","",clean,"Wipe clean the cache")
rootCmd.Flags().BoolVarP(&reset,"reset","",reset,"Reset the config. Make sure to backup any relevant changes first!")
rootCmd.Flags().BoolVarP(&hideMarketbar,"hide-marketbar","",hideMarketbar,"Hide the top marketbar")
rootCmd.Flags().BoolVarP(&hideChart,"hide-chart","",hideChart,"Hide the chart view")
rootCmd.Flags().BoolVarP(&hideTable,"hide-table","",hideTable,"Hide the table view")
rootCmd.Flags().BoolVarP(&hideStatusbar,"hide-statusbar","",hideStatusbar,"Hide the bottom statusbar")
rootCmd.Flags().BoolVarP(&hidePortfolioBalances,"hide-portfolio-balances","",hidePortfolioBalances,"Hide portfolio balances. Useful for when sharing screen or taking screenshots")
rootCmd.Flags().BoolVarP(&onlyTable,"only-table","",onlyTable,"Show only the table. Hides the chart and top and bottom bars")
rootCmd.Flags().BoolVarP(&onlyChart,"only-chart","",onlyChart,"Show only the chart. Hides the table and top and bottom bars")
rootCmd.Flags().StringVarP(&cmcAPIKey,"coinmarketcap-api-key","",cmcAPIKey,"Set the CoinMarketCap Pro API key")
rootCmd.Flags().StringVarP(&coingeckoAPIKey,"coingecko-api-key","",coingeckoAPIKey,"Set the CoinGecko Demo API key")
rootCmd.Flags().StringVarP(&coingeckoProAPIKey,"coingecko-pro-api-key","",coingeckoProAPIKey,"Set the CoinGecko Pro API key")
rootCmd.Flags().StringVarP(&apiChoice,"api","",apiChoice,"API choice. Available choices are \"coinmarketcap\" and \"coingecko\"")
rootCmd.Flags().StringVarP(&colorscheme,"colorscheme","",colorscheme,fmt.Sprintf("Colorscheme to use (default \"cointop\").\n%s",cointop.ColorschemeHelpString()))
rootCmd.Flags().StringVarP(&cmcAPIKey,"coinmarketcap-api-key","","","Set the CoinMarketCap API key")
rootCmd.Flags().StringVarP(&apiChoice,"api","","","API choice. Available choices are \"coinmarketcap\" and \"coingecko\"")
rootCmd.Flags().StringVarP(&colorscheme,"colorscheme","","",fmt.Sprintf("Colorscheme to use (default \"cointop\").\n%s",cointop.ColorschemeHelpString()))
[`cointop`](https://github.com/cointop-sh/cointop) is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.
[`cointop`](https://github.com/miguelmota/cointop) is a fast and lightweight interactive terminal based UI application for tracking and monitoring cryptocurrency coin stats in real-time.
The interface is inspired by [`htop`](https://en.wikipedia.org/wiki/Htop) and shortcut keys are inspired by [`vim`](https://en.wikipedia.org/wiki/Vim_(text_editor)).
@ -19,19 +11,24 @@ The interface is inspired by [`htop`](https://en.wikipedia.org/wiki/Htop) and sh
Note: depending on your system, this may not be the correct location. The "colors" directory needs to go in the same place as your config.toml file.
Then edit your config `~/.config/cointop/config.toml` and set the colorscheme you want to use:
```toml
colorscheme = "cointop"
colorscheme = "<colorscheme>"
```
The colorscheme name is the name of the colorscheme TOML file.
By default, the colorscheme files should go under `~/.config/cointop/colors/`
For example, if you have `matrix.toml` under `~/.config/cointop/colors/matrix.toml` then the `colorscheme` property in `config.toml` should be set to:
For example, if you have `matrix.toml` in `~/.cointop/colors/` then the `colorscheme` property should be set to:
```toml
colorscheme = "matrix"
@ -41,96 +37,3 @@ $ cointop --colorscheme matrix
```
To create your own colorscheme; simply copy an existing [colorscheme](https://github.com/cointop-sh/colors/blob/master/cointop.toml), rename it, and customize the colors.
For contributions please create a new branch and submit a pull request for review.
Huge thanks to all the [contributors](https://github.com/cointop-sh/cointop/graphs/contributors) that have made cointop better.
Huge thanks to all the [contributors](https://github.com/miguelmota/cointop/graphs/contributors) that have made cointop better.
## Documentation
Keeping documentation up-to-date is always appreciated! If you'd like to make edits or make additions to the docs, the respective files are located under [`docs/content`](https://github.com/cointop-sh/cointop/tree/master/docs/content)
Keeping documentation up-to-date is always appreciated! If you'd like to make edits or make additions to the docs, the respective files are located under [`docs/content`](https://github.com/miguelmota/cointop/tree/master/docs/content)
This supports any coin supported by the API being used to fetch coin information. There is, however, a limit on the number of coins that
cointop fetches by default. You can increase this by passing `--max-pages` and `--per-page` arguments on the command line.
This supports any coin supported by the API being used to fetch coin information.
## How do I set the API to use?
@ -42,31 +41,10 @@ draft: false
Copy an existing [colorscheme](https://github.com/cointop-sh/colors/blob/master/cointop.toml) to `~/.config/cointop/colors/` and customize the colors. Then run cointop with `--colorscheme <colorscheme>` to use the colorscheme.
You can use any of the 250-odd X11 colors by name. See https://en.wikipedia.org/wiki/X11_color_names (use lower-case and without spaces). You can also include 24-bit colors by using the #rrggbb hex code.
You can also define values in the colorscheme file, and reference them from throughout the file, using the following syntax:
```toml
define_base03 = "#002b36"
menu_header_fg = "$base03"
```
## How do I make the background color transparent?
Change the background color options in the colorscheme file to `default` to use the system default color, eg. `base_bg = "default"`
## Where is the config file located?
The default configuration file is located under `~/.config/cointop/config.toml`
However it may vary depending on your operating system since the config directory is determinedby by [`os.UserConfigDir()`](https://pkg.go.dev/os#UserConfigDir).
On Unix systems, the default config path is `$XDG_CONFIG_HOME/cointop/config.toml`
On macOS (darwin), the default config path is `$HOME/Library/Application Support/cointop/config.toml`
On Windows, the default config path is `%AppData%\cointop\config.toml`
Note: Previous versions of cointop used `~/.cointop/config` or `~/.cointop/config.toml` as the default config filepath. Cointop will use those config filepaths respectively if they exist.
## What format is the configuration file in?
@ -95,9 +73,9 @@ draft: false
## I'm no longer seeing any data!
Run cointop with the `--clean` flag to delete the cache. If you're still not seeing any data, then please [submit an issue](https://github.com/cointop-sh/cointop/issues/new).
Run cointop with the `--clean` flag to delete the cache. If you're still not seeing any data, then please [submit an issue](https://github.com/miguelmota/cointop/issues/new).
## How do I get a CoinMarketCap Pro (Paid) API key?
## How do I get a CoinMarketCap Pro API key?
Create an account on [CoinMarketCap](https://pro.coinmarketcap.com/signup) and visit the [Account](https://pro.coinmarketcap.com/account) page to copy your Pro API key.
Fork cointop and add the API that implements the API [interface](https://github.com/cointop-sh/cointop/blob/master/cointop/common/api/interface.go) to [`cointop/cointop/common/api/impl/`](https://github.com/cointop-sh/cointop/tree/master/cointop/common/api/impl). You can use the CoinGecko [implementation](https://github.com/cointop-sh/cointop/blob/master/cointop/common/api/impl/coingecko/coingecko.go) as reference.
Fork cointop and add the API that implements the API [interface](https://github.com/miguelmota/cointop/blob/master/cointop/common/api/interface.go) to [`cointop/cointop/common/api/impl/`](https://github.com/miguelmota/cointop/tree/master/cointop/common/api/impl). You can use the CoinGecko [implementation](https://github.com/miguelmota/cointop/blob/master/cointop/common/api/impl/coingecko/coingecko.go) as reference.
## I installed cointop without errors but the command is not found.
@ -180,13 +116,10 @@ draft: false
## How do I search?
The default key to open search is <kbd>/</kbd>. Type the search query after the `/` in the field and hit <kbd>Enter</kbd>.
Each search starts from the current cursor position. To search for the same term again, hit <kbd>/</kbd> then <kbd>Enter</kbd>.
The default behaviour will start to search by symbol first, then it will continues searching by name if there is no result. To search by only symbol, type the search query after `/s:`. To search by only name, type the search query after `/n:`.
## How do I exit search?
Press <kbd>Esc</kbd> to exit search.
Press <kbd>ESC</kbd> to exit search.
## Does this work on the Raspberry Pi?
@ -206,7 +139,7 @@ draft: false
## What does the yellow asterisk in the row mean?
The yellow asterisk `*` star means that you've selected that coin to be a favorite.
The yellow asterisk or star means that you've selected that coin to be a favorite.
## My favorites aren't being saved?
@ -216,8 +149,6 @@ draft: false
Press <kbd>e</kbd> on the highlighted coin to enter holdings and add to your portfolio.
This dialog supports basic expressions including `+``-``*``/` etc.
## How do I edit the holdings of a coin in my portfolio?
Press <kbd>e</kbd> on the highlighted coin to edit the holdings.
@ -234,35 +165,6 @@ draft: false
Your portfolio is autosaved after you edit holdings. You can also press <kbd>ctrl</kbd>+<kbd>s</kbd> to manually save your portfolio holdings to the config file.
## How do I include buy/cost price in my portfolio?
Currently there is no UI for this. If you want to include the cost of your coins in the Portfolio screen, you will need to edit your config.toml
Each coin consists of four values: coin name, coin amount, cost-price, cost-currency.
For example, the following configuration includes 100 ALGO at USD1.95 each; and 0.1 BTC at AUD50100.83 each.
With this configuration, four new columns are useful:
- `cost_price` the price and currency that the coins were purchased at
- `cost` the cost (in the current currency) of the coins
- `pnl` the PNL of the coins (current value vs original cost)
- `pnl_percent` the PNL of the coins as a fraction of the original cost
With the holdings above, and the currency set to GBP (British Pounds) cointop will look something like this:
![portfolio profit and loss](https://user-images.githubusercontent.com/122371/138361142-8e1f32b5-ca24-471d-a628-06968f07c65f.png)
## How do I hide my portfolio balances (private mode)?
You can run cointop with the `--hide-portfolio-balances` flag to hide portfolio balances or use the keyboard shortcut <kbd>Ctrl</kbd>+<kbd>space</kbd> on the portfolio page to toggle hide/show.
## I'm getting question marks or weird symbols instead of the correct characters.
Make sure that your terminal has the encoding set to UTF-8 and that your terminal font supports UTF-8.
@ -273,11 +175,11 @@ draft: false
LANG=en_US.utf8 TERM=xterm-256color cointop
```
If you're on Windows (PowerShell, Command Prompt, or WSL), please see the [wiki](https://github.com/cointop-sh/cointop/wiki/Windows-Command-Prompt-and-WSL-Font-Support) for font support instructions.
If you're on Windows (PowerShell, Command Prompt, or WSL), please see the [wiki](https://github.com/miguelmota/cointop/wiki/Windows-Command-Prompt-and-WSL-Font-Support) for font support instructions.
## How do I install Go on Ubuntu?
There's instructions on installing Go on Ubuntu in the [wiki](https://github.com/cointop-sh/cointop/wiki/Installing-Go-on-Ubuntu).
There's instructions on installing Go on Ubuntu in the [wiki](https://github.com/miguelmota/cointop/wiki/Installing-Go-on-Ubuntu).
## I'm getting errors installing the snap in Windows WSL.
The save command (<kbd>ctrl</kbd>+<kbd>s</kbd>) saves your selected currency, selected favorite coins, and portfolio coins to the cointop config file.
@ -410,39 +294,10 @@ draft: false
In the config file, set `default_view = "default"`
## How do I set the default chart range?
In the config file, set `default_chart_range = "3M"`
Supported date ranges are `All Time`, `YTD`, `1Y`, `6M`, `3M`, `1M`, `7D`, `3D`, `24H`.
## How do I set the table columns?
In the config file, set `columns` value in one of the favorites, portfolio, table sections. The list of available columns can be seen on the help menu - look for "sort_column_XXX".
Supported columns relating to price change are `1h_change`, `24h_change`, `7d_change`, `30d_change`, `1y_change`
## How can I use K (thousand), M (million), B (billion), T (trillion) suffixes for shorter numbers?
There is a setting at the top-level of the configuration file called `compact_notation=true` which changes the marketbar values `market cap`, `volume` and `portfolio total value`.
The same setting can be applied at in the `[table]` section to impact the `24h_volume`, `market_cap`, `total_supply`, `available_supply` columns in the main coin view; and in the `[favorites]` section to change the same columns. The setting also changes the column names to be shorter.
## How can use a different config file other than the default?
Run cointop with the `--config` flag, eg `cointop --config="/path/to/config.toml"`, to use the specified file as the config.
Alternatively, you can set the config file path via the environment variable `COINTOP_CONFIG`, eg `export COINTOP_CONFIG="/path/to/config.toml"`
## I'm getting the error `open /dev/tty: no such device or address`.
Usually this error occurs when cointop is running as a daemon or slave which means that there is no terminal allocated, so `/dev/tty` doesn't exist for that process. Try running it with the following environment variables:
@ -453,7 +308,7 @@ draft: false
## I can only view the first page, why isn't the pagination is working?
Sometimes the coin APIs will make updates and break things. If you see this problem please [submit an issue](https://github.com/cointop-sh/cointop/issues/new).
Sometimes the coin APIs will make updates and break things. If you see this problem please [submit an issue](https://github.com/miguelmota/cointop/issues/new).
## How can run cointop with just the table?
@ -545,53 +400,10 @@ draft: false
The public SSH instance is for demo use or short-term usage and will disconnect users after an idle timeout to allow other users to try it out.
## How do I fix the error `SSH key is required to start server` when trying to run SSH server?
Generate the SSH key if the host machine doesn't have one:
```bash
$ ssh-keygen
```
Make sure the host key flag points to the location of the SSH key:
```bash
cointop server -k ~/.ssh/id_rsa [...]
```
## How do I fix the error `no matching host key type found. Their offer: ssh-rsa` when trying to SSH?
Use the following flag when connecting to the SSH server:
```bash
ssh -oHostKeyAlgorithms=+ssh-rsa cointop.sh
```
You can also add this config to the `~/.ssh/config` file so you don't have to use the flag every time:
```
Host cointop.sh
HostName cointop.sh
HostKeyAlgorithms=+ssh-rsa
```
## Why doesn't the version number work when I install with `go get`?
The version number is read from the git tag during the build process but this requires the `GO111MODULE` environment variable to be set in order for Go to read the build information:
```bash
GO111MODULE=on go get github.com/cointop-sh/cointop
GO111MODULE=on go get github.com/miguelmota/cointop
```
## How can I get more information when something is going wrong?
Cointop creates a logfile at `/tmp/cointop.log`. Normally nothing is written to this, but if you set the environment variable
`DEBUG=1` cointop will write a lot of output describing its operation. Furthermore, if you also set `DEBUG_HTTP=1` it will
emit lots about every HTTP request that cointop makes to coingecko (backend). Developers may ask for this information
to help diagnose any problems you may experience.
```bash
DEBUG=1 DEBUG_HTTP=1 cointop
```
If you set environment variable `DEBUG_FILE` you can explicitly provide a logfile location, rather than `/tmp/cointop.log`
To view your portfolio, press <kbd>F</kbd> (Shift+f)
## Exit favorites
To exit out of the portfolio view press, <kbd>F</kbd> (Shift+f) again or <kbd>q</kbd> or <kbd>Esc</kbd>
## Add favorite
To add a coin to your favorites, press <kbd>f</kbd> or <kbd>Space</kbd> on the highlighted coin to favorite. Favorited coins are marked with an `*` asterisk.
## Remove favorite
To remove a coin from your favorites, press <kbd>f</kbd> or <kbd>Space</kbd> on the favorited highlighted coin to unfavorite.
cointop is available as a [FreshPort](https://www.freshports.org/finance/cointop/) package.
@ -176,10 +154,10 @@ sudo pkg install cointop
Install [Go](https://golang.org/doc/install) and [git](https://git-scm.com/download/win), then:
```powershell
go get -u github.com/cointop-sh/cointop
go get -u github.com/miguelmota/cointop
```
You'll need additional font support for Windows. Please see the [wiki](https://github.com/cointop-sh/cointop/wiki/Windows-Command-Prompt-and-WSL-Font-Support) for instructions.
You'll need additional font support for Windows. Please see the [wiki](https://github.com/miguelmota/cointop/wiki/Windows-Command-Prompt-and-WSL-Font-Support) for instructions.
## Docker
@ -189,12 +167,6 @@ cointop is available on [Docker Hub](https://hub.docker.com/r/cointop/cointop).
docker run -it cointop/cointop
```
Note: the config is under `/root/.config/cointop` in container, so attach a volume to make it persistent in host:
```bash
docker run -v ~/.cache/cointop:/root/.config/cointop -it cointop/cointop
```
## Binaries
You can find pre-built binaries on the [releases](https://github.com/cointop-sh/cointop/releases) page.
You can find pre-built binaries on the [releases](https://github.com/miguelmota/cointop/releases) page.
To view your portfolio, press <kbd>P</kbd> (Shift+p)
## Exit portfolio
To exit out of the portfolio view press, <kbd>P</kbd> (Shift+p) again or <kbd>q</kbd> or <kbd>Esc</kbd>
## Add entry
To add a coin to your portfolio, press <kbd>e</kbd> on the highlighted coin, enter a value, and then press <kbd>Enter</kbd>
## Edit entry
To edit the holdings of coin in your portfolio, press <kbd>e</kbd> on the highlighted coin, enter the new value, and then press <kbd>Enter</kbd>
## Remove Entry
To remove an entry in your portfolio, press <kbd>e</kbd> on the highlighted coin and set the value to an empty value and press <kbd>Enter</kbd>
## Changing chart
To change the coin for the chart, press <kbd>Enter</kbd> on the highlighted coin. Pressing <kbd>Enter</kbd> again on the same highlighted row will show the global chart again.
# CLI
The portfolio holdings can be retrieved with the `holdings` command.
To search for coins, press <kbd>/</kbd> to bring up the search prompt. Enter the search query and then hit <kbd>Enter</kbd> to submit. The coin that matches closes to the query will be highlighted.
The SSH server requires that the host has SSH keys, so generate SSH keys if not already:
```bash
$ ssh-keygen
```
Check keys were generated:
```bash
$ ls ~/.ssh
id_rsa id_rsa.pub
```
Run SSH server:
```bash
cointop server -p 2222
```
If the host SSH keys live elsewhere, specify the location:
```bash
cointop server -p 2222 -k ~/.ssh/some-dir/id_rsa
```
SSH into server to see cointop:
```bash
ssh localhost -p 2222
```
The cointop SSH server will use the client's public SSH key as the identifier for persistent config by default. You may change it to use the username instead:
```bash
cointop server -p 2222 --user-config-type=username
```
SSH'ing into server with same username will use the same respective config now:
SSH demo:
```bash
ssh alice@localhost -p 2222
ssh cointop.sh
```
Pass arguments to cointop on SSH server by using SSH `-t` flag followed by cointop command and arguments. For example:
docker run -p 2222:22 -v ~/.ssh:/keys --entrypoint cointop -it cointop/cointop server -k /keys/id_rsa
```
cointop server writes the client config to `/tmp/cointop_config` within the container, so to make it persistent in host attach a volume. The following example will to write the cached config to `~/.cache/cointop` on the host:
```bash
docker run -p 2222:22 -v ~/.ssh:/keys -v ~/.cache/cointop:/tmp/cointop_config --entrypoint cointop -it cointop/cointop server -k /keys/id_rsa
[![BTC Tip Jar](https://img.shields.io/badge/BTC-tip-yellow.svg?logo=bitcoin&style=flat)](https://www.blockchain.com/btc/address/3KdMW53vUMLPEC33xhHAUx4EFtvmXQF8Kf) `3KdMW53vUMLPEC33xhHAUx4EFtvmXQF8Kf`
[![ETH Tip Jar](https://img.shields.io/badge/ETH-tip-blue.svg?logo=ethereum&style=flat)](https://etherscan.io/address/0xC014b8F6F43f467922E93De62C9216F0538E0F8f) `0xC014b8F6F43f467922E93De62C9216F0538E0F8f`
[![ETH Tip Jar](https://img.shields.io/badge/ETH-tip-blue.svg?logo=ethereum&style=flat)](https://etherscan.io/address/0x0072cdd7c3d9963ba69506ECf50e16E963B35bb1) `0x0072cdd7c3d9963ba69506ECf50e16E963B35bb1`