Skip to content

bitpanda-labs/bitpanda-cli

Repository files navigation

bitpanda-cli (bp)

CI Go Version License Latest Release

A command-line tool for the Bitpanda Developer API. View your portfolio, check prices, browse trades and transactions — all from your terminal.

Installation

Homebrew (macOS / Linux)

brew install bitpanda-labs/tap/bp

Shell script (macOS / Linux)

curl -fsSL https://raw.githubusercontent.com/bitpanda-labs/bitpanda-cli/main/install.sh | sh

Debian / Ubuntu (.deb)

Download the .deb package from the latest release and install:

sudo dpkg -i bp_*_linux_amd64.deb

Fedora / RHEL (.rpm)

Download the .rpm package from the latest release and install:

sudo rpm -i bp_*_linux_amd64.rpm

Go

go install github.com/bitpanda-labs/bitpanda-cli/cmd/bp@latest

From source

git clone https://github.com/bitpanda-labs/bitpanda-cli.git
cd bitpanda-cli
make install

Pre-built binaries

Download from Releases.

Configuration

bp needs a Bitpanda API key. Get one at bitpanda.com/my-account/apikey.

Three ways to provide it (in priority order):

# 1. Flag (highest priority)
bp portfolio --api-key YOUR_KEY

# 2. Environment variable
export BITPANDA_API_KEY=YOUR_KEY
bp portfolio

# 3. Config file (~/.config/bitpanda/config.yaml)
mkdir -p ~/.config/bitpanda
echo "api_key: YOUR_KEY" > ~/.config/bitpanda/config.yaml
chmod 600 ~/.config/bitpanda/config.yaml
bp portfolio

Tip: bp will warn on stderr if the config file has permissions more permissive than 0600. Since the file contains your API key, restrict access with chmod 600 ~/.config/bitpanda/config.yaml.

Usage

Portfolio

bp portfolio              # aggregated holdings with EUR valuations
bp portfolio --sort value # sort by EUR value (descending)
bp portfolio -o json      # JSON output

Note: The portfolio command uses the Bitpanda ticker API, which returns all prices in EUR. All valuations shown (EUR Price, EUR Value, TOTAL) assume EUR as the base currency. The price command displays the raw Currency field from the API response, which currently also returns EUR but is shown explicitly per asset.

Balances

bp balances                  # all wallets
bp balances --non-zero       # only wallets with balance > 0
bp balances --asset-id UUID  # filter by asset
bp balances --limit 10       # cap results

Trades

bp trades                          # recent trades (first page)
bp trades --all                    # full trade history (may be slow)
bp trades --operation buy          # only buys
bp trades --asset-type cryptocoin  # only crypto trades
bp trades --from 2024-01-01 --to 2024-06-30
bp trades --limit 20

Transactions

bp transactions                       # recent transactions (first page)
bp transactions --all                 # full transaction history (may be slow)
bp transactions --flow incoming       # only incoming
bp transactions --wallet-id UUID
bp transactions --from 2024-01-01 --to 2024-12-31
bp transactions -o csv                # CSV output for spreadsheets

Prices

bp price BTC       # single asset price
bp price btc       # case-insensitive
bp prices          # prices for held assets
bp prices --all    # all available prices

Asset lookup

bp asset UUID      # asset metadata by ID

Shell Completion

bp completion bash       # generate bash completions
bp completion zsh        # generate zsh completions
bp completion fish       # generate fish completions
bp completion powershell # generate PowerShell completions

To load completions in your current shell session:

# Bash
source <(bp completion bash)

# Zsh
source <(bp completion zsh)

# Fish
bp completion fish | source

# PowerShell
bp completion powershell | Out-String | Invoke-Expression

Output Formats

All commands support -o/--output with three formats:

Format Flag Description
Table --output table (default) Human-readable table
JSON --output json For scripting and piping
CSV --output csv For spreadsheets

Exit Codes

Code Meaning
0 Success
1 General error
2 Authentication error
3 API error

Development

make build    # build to bin/bp
make test     # run tests
make install  # install to $GOPATH/bin
make lint     # run linter

License

Apache 2.0 — see LICENSE for details.

About

No description, website, or topics provided.

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors