A CLI for trading stocks, ETFs, options, and crypto via Public.com's API.
brew install jonandersen/tap/pubDownload the latest release for your platform from GitHub Releases, or use the GitHub CLI:
# macOS (Apple Silicon)
gh release download --repo jonandersen/public-cli --pattern '*darwin_arm64.tar.gz'
tar xzf pub_*_darwin_arm64.tar.gz
sudo mv pub /usr/local/bin/
# macOS (Intel)
gh release download --repo jonandersen/public-cli --pattern '*darwin_amd64.tar.gz'
tar xzf pub_*_darwin_amd64.tar.gz
sudo mv pub /usr/local/bin/
# Linux (x86_64)
gh release download --repo jonandersen/public-cli --pattern '*linux_amd64.tar.gz'
tar xzf pub_*_linux_amd64.tar.gz
sudo mv pub /usr/local/bin/
# Linux (ARM64)
gh release download --repo jonandersen/public-cli --pattern '*linux_arm64.tar.gz'
tar xzf pub_*_linux_arm64.tar.gz
sudo mv pub /usr/local/bin/go install github.com/jonandersen/public-cli@latestgit clone https://github.com/jonandersen/public-cli.git
cd public-cli
make build- Generate a secret key at https://public.com/settings/security/api
- Configure the CLI:
pub configureYour secret key is stored securely in your system keyring (macOS Keychain, Linux Secret Service, or Windows Credential Manager).
pub quote AAPL # Single stock
pub quote AAPL GOOGL MSFT # Multiple stockspub account # List all accounts
pub account portfolio # View portfolio positions and balancespub order buy AAPL 10 # Buy 10 shares of AAPL at market price
pub order sell AAPL 5 # Sell 5 shares
pub order buy AAPL 10 --limit 150.00 # Limit order at $150
pub order list # View open orders
pub order cancel <order-id> # Cancel an orderpub options chain AAPL # View options chain
pub options buy AAPL 2025-01-17 150 call 1 # Buy 1 call contract
pub options sell AAPL 2025-01-17 150 put 1 # Sell 1 put contractpub history # View recent transactions
pub history --limit 50 # Limit number of resultspub instrument AAPL # Get details for a symbol
pub instruments --type stock # List available instrumentspub quote AAPL --json # JSON output for scripting
pub account portfolio --json # Works with any commandLaunch an interactive terminal interface with real-time portfolio monitoring:
pub uiFeatures:
- Portfolio view - See all positions with live P&L
- Watchlist - Track symbols you're interested in
- Keyboard navigation - Switch views with number keys (1-4)
Key bindings:
1-4- Switch between viewsa- Add symbol to watchlist (in watchlist view)d- Delete symbol from watchlistq- Quit
Config file: ~/.config/pub/config.yaml
account_uuid: "your-default-account"
api_base_url: "https://api.public.com"make test # Run tests
make lint # Run linter
make all # Format, lint, test, and buildMIT