Skip to main content

CLI for Allium blockchain data APIs

Project description

Allium CLI

Command-line interface for querying blockchain data across 80+ chains via the Allium platform. Supports realtime token prices, wallet balances, transaction history, and SQL queries against Allium's data warehouse.

Installation

curl -sSL https://raw.githubusercontent.com/Allium-Science/allium-cli/main/install.sh | sh

Or install directly with your preferred package manager:

uv tool install allium-cli   # recommended
pipx install allium-cli
pip install allium-cli

This installs the allium command. Run allium auth setup to configure authentication.

Authentication

The CLI supports four authentication methods. Run the interactive wizard, or pass arguments directly for scripted/CI setups:

# Interactive wizard (arrow-key selection)
allium auth setup

# Non-interactive one-liners
allium auth setup --method api_key --api-key sk-...
allium auth setup --method x402_key --private-key 0x... --network eip155:8453
allium auth setup --method x402_privy \
    --privy-app-id ... --privy-app-secret ... \
    --privy-wallet-id ... --network eip155:8453
allium auth setup --method tempo --private-key 0x... --chain-id 4217
Method Description
API Key Standard key from app.allium.so/settings/api-keys
x402 Private Key Pay-per-call with USDC on Base -- no API key needed
x402 Privy x402 via Privy server wallets -- no private key handling
Tempo MPP Tempo micropayment protocol

Optional flags: --name <profile-name> (defaults to the method name), --no-active (skip setting as active profile).

Credentials are stored in ~/.config/allium/credentials.toml (file permissions restricted to owner).

Profile management

allium auth list          # Show all profiles
allium auth use <name>    # Switch active profile
allium auth remove <name> # Delete a profile

Global Options

--profile TEXT             Override the active auth profile for this command
--format [json|table|csv]  Output format (default: json)
-v, --verbose              Show progress details (run IDs, spinners, status)
--help                     Show help and exit

Commands

allium realtime -- Realtime Blockchain Data

Query realtime blockchain data with 3-5s freshness across 20+ chains.

Prices

Token prices derived from on-chain DEX trades with VWAP calculation and outlier detection.

# Latest minute-level price and OHLC values
allium realtime prices latest \
  --chain solana --token-address So11111111111111111111111111111111111111112

# Price at a specific timestamp
allium realtime prices at-timestamp \
  --chain ethereum --token-address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --timestamp 2026-01-15T12:00:00Z --time-granularity 1h

# Historical price series
allium realtime prices history \
  --chain ethereum --token-address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48 \
  --start-timestamp 2026-01-01T00:00:00Z --end-timestamp 2026-01-07T00:00:00Z \
  --time-granularity 1d

# Historical price series with cursor
allium realtime prices history \
  --chain solana --token-address So11111111111111111111111111111111111111112 \
  --start-timestamp 2024-08-17T13:00:00Z --end-timestamp 2025-08-17T20:00:00Z \
  --time-granularity 5m --cursor eyJzb2xhbmEiOiAiZXlKc1lYTjBYM1JwYldWemRHRnRjQ0k2SUNJeU1ESTBMVEV5TFRJeUlEQTJPalF3T2pBd0luMD0ifQ==

# 24h/1h price stats (high, low, volume, trade count, percent change)
allium realtime prices stats \
  --chain solana --token-address So11111111111111111111111111111111111111112

Options: --chain, --token-address (repeatable, paired in order), --body (JSON override), --timestamp, --start-timestamp, --end-timestamp, --time-granularity [15s|1m|5m|1h|1d]

Tokens

# List top tokens by volume
allium realtime tokens list --chain ethereum --sort volume --limit 10

# Fuzzy search by name or symbol
allium realtime tokens search -q "USDC"

# Exact lookup by chain + contract address
allium realtime tokens chain-address \
  --chain ethereum --token-address 0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48

Options: --chain, --token-address (repeatable), --sort [volume|trade_count|fully_diluted_valuation|address|name], --order [asc|desc], --limit, -q/--query

Balances

# Current token balances for a wallet
allium realtime balances latest \
  --chain ethereum --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045

# Historical balance snapshots
allium realtime balances history \
  --chain ethereum --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
  --start-timestamp 2026-01-01T00:00:00Z --limit 100

Options: --chain, --address (repeatable, paired), --start-timestamp, --end-timestamp, --limit, --body

Holdings

# Historical Wallet holdings
allium realtime holdings history \
  --chain ethereum \
  --address 0x3c96937a5bce135c47133702d54b652498e5e375 \
  --start-timestamp 2024-03-01T00:00:00Z \
  --end-timestamp 2026-03-21T00:00:00Z \
  --granularity 1d

Options: --chain, --address (repeatable), --granularity, --body

Transactions

# Wallet transaction activity with decoded activities and labels
allium realtime transactions \
  --chain ethereum --address 0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045 \
  --activity-type dex_trade --lookback-days 7 --limit 50

Options: --chain, --address (repeatable), --activity-type, --lookback-days, --limit, --body

Positions

allium realtime positions list \
  --chain solana --address 125Z6k4ZAxsgdG7JxrKZpwbcS1rxqpAeqM9GSCKd66Wp \
  --limit 1

PnL

Latest PnL
# Latest Wallet profit and loss
allium realtime pnl latest \
  --chain ethereum \
  --address 0x3c96937a5bce135c47133702d54b652498e5e375 \
  --min-liquidity 1000

Options: --chain, --address (repeatable), --min-liquidity, --with-historical-breakdown, --body

# Latest Wallet profit and loss by token
allium realtime pnl-by-token latest \
  --chain ethereum \
  --address 0x3c96937a5bce135c47133702d54b652498e5e375 \
  --token-address 0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e
Historical PnL
# Historical Wallet profit and loss
allium realtime pnl history \
  --chain ethereum \
  --address 0x3c96937a5bce135c47133702d54b652498e5e375 \
  --start-timestamp 2024-03-01T00:00:00Z \
  --end-timestamp 2026-03-21T00:00:00Z \
  --min-liquidity 1000 \
  --granularity 1d

Options: --chain, --address (repeatable), --granularity, --min-liquidity, --body

# Historical Wallet profit and loss by token
allium realtime pnl-by-token history \
  --chain ethereum \
  --address 0x3c96937a5bce135c47133702d54b652498e5e375 \
  --token-address 0x0bc529c00c6401aef6d220be8c6ea1667f6ad93e \
  --start-timestamp 2024-04-01T00:00:00Z \
  --end-timestamp 2024-04-10T00:00:00Z \
  --granularity 1d

Options: --chain, --address, token_address (repeatable), --granularity, --body


allium explorer -- SQL Query Execution

Run SQL queries on Allium's data warehouse. By default, the CLI polls silently and prints results. Use -v for progress details.

# Execute ad-hoc SQL (requires x402 or Tempo auth)
allium explorer run-sql "SELECT chain, COUNT(*) FROM crosschain.dex.trades GROUP BY chain LIMIT 10"

# Execute SQL from a file
allium explorer run-sql query.sql --limit 1000

# Run a saved query by ID with parameters
allium explorer run abc123 --param start_date=2026-01-01 --param chain=ethereum

# Just get the run ID without waiting
allium explorer run-sql "SELECT 1" --no-wait

# Check status of a query run
allium explorer status <run_id>

# Fetch results of a completed run
allium explorer results <run_id>

# Pipe CSV output directly
allium --format csv explorer run-sql "SELECT 1" > output.csv
Command Description
run-sql <SQL_OR_FILE> Execute ad-hoc SQL (x402/Tempo auth required)
run <QUERY_ID> Execute a saved Explorer query by ID
status <RUN_ID> Check query run status (created, running, success, failed, canceled)
results <RUN_ID> Download results of a completed run

Options: --limit, --no-wait, --param key=value (repeatable), --compute-profile


allium mp -- Machine Payment Tracking

Track costs for x402 and Tempo micropayment API calls. Payments are logged automatically to ~/.config/allium/cost_log.csv.

# Total spend summary grouped by method and network
allium mp cost

# Full itemized payment history
allium mp cost list

# Export as CSV
allium --format csv mp cost list

# Clear the cost log
allium mp cost clear
Command Description
mp cost Total spend summary (grouped by method/network with call counts)
mp cost list Full itemized history with per-row details
mp cost clear Delete the cost log (with confirmation prompt)

allium auth -- Authentication Management

# Interactive setup wizard (arrow-key selection)
allium auth setup

# Non-interactive setup (for scripts/CI)
allium auth setup --method api_key --api-key sk-...
allium auth setup --method tempo --private-key 0x... --chain-id 4217

# List all configured profiles
allium auth list

# Switch active profile
allium auth use <name>

# Delete a profile
allium auth remove <name>

JSON Body Override

All realtime commands support a --body flag that accepts either inline JSON or a path to a .json file. When provided, it overrides all other options:

# Inline JSON
allium realtime prices latest --body '[{"chain":"solana","token_address":"So111..."}]'

# From file
allium realtime prices latest --body tokens.json

Shell Completions

Tab-completion is available for all commands, subcommands, and options. Add one of the following to your shell config:

# Bash — add to ~/.bashrc
eval "$(_ALLIUM_COMPLETE=bash_source allium)"

# Zsh — add to ~/.zshrc
eval "$(_ALLIUM_COMPLETE=zsh_source allium)"

# Fish — add to ~/.config/fish/config.fish
_ALLIUM_COMPLETE=fish_source allium | source

Reload your shell to activate completions.

Documentation

Full API documentation: docs.allium.so

Contributing

See CONTRIBUTING.md for development setup and release instructions.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

allium_cli-0.3.2.tar.gz (166.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

allium_cli-0.3.2-py3-none-any.whl (42.3 kB view details)

Uploaded Python 3

File details

Details for the file allium_cli-0.3.2.tar.gz.

File metadata

  • Download URL: allium_cli-0.3.2.tar.gz
  • Upload date:
  • Size: 166.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for allium_cli-0.3.2.tar.gz
Algorithm Hash digest
SHA256 4037a0e51cc3a8dac27d222d2a7bd5f3746ff0cad94de366459ac542a89e93e9
MD5 f4c819b5d0100615035fd5f88b486fc5
BLAKE2b-256 d6d41417660e24a5b155d9bcd3c8667c96b4814ef23df8d1cf4c64e94da49f7e

See more details on using hashes here.

Provenance

The following attestation bundles were made for allium_cli-0.3.2.tar.gz:

Publisher: release.yml on Allium-Science/allium-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file allium_cli-0.3.2-py3-none-any.whl.

File metadata

  • Download URL: allium_cli-0.3.2-py3-none-any.whl
  • Upload date:
  • Size: 42.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for allium_cli-0.3.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0978b14e85cdd5bbd3bc1a5372989ab369eb7f2357a134d77492a7fd47384a74
MD5 af81ba5fa9abee52e0951be67e10ff7b
BLAKE2b-256 eb2a3007ecb95d4fa770f6fb47f2ad3a9032a2392ccd46273bd004eb2440a719

See more details on using hashes here.

Provenance

The following attestation bundles were made for allium_cli-0.3.2-py3-none-any.whl:

Publisher: release.yml on Allium-Science/allium-cli

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page