QuantQuack CLI Guide
Use the quantquack command-line tool to manage datasets, run DuckScript, integrate data providers, and run backtests.
π Overview
The QuantQuack CLI (quantquack) lets you authenticate, upload and list datasets, create and edit scripts from local .dq files, validate and run DuckScript, configure data providers (FMP, Polygon, Databento), and run backtestsβall from the terminal.
Most commands require you to be logged in. Install the CLI from the app or the monorepo; then run quantquack auth login to get started.
π Authentication
Log in with your QuantQuack account to use dataset, DSL, and backtest commands.
# Interactive login quantquack auth login # Login with credentials quantquack auth login --email user@example.com --password mypassword # Check status quantquack auth status # Logout quantquack auth logout
Most CLI operations require being logged in. Use quantquack auth status to verify.
π Dataset management
Upload CSV or Parquet files, list datasets, get details, or delete them.
# Upload a file (optional -d "Description") quantquack dataset upload data.csv -n "My Historical Data" -d "OHLCV data" # List all datasets quantquack dataset list # Get dataset details quantquack dataset info <dataset-id> # Delete (prompts for confirmation; use --force to skip) quantquack dataset delete <dataset-id> quantquack dataset delete <dataset-id> --force
π DSL (DuckScript) operations
Validate syntax, compile to SQL, or run a script against a dataset. Use --save to save the script to the server after run (name defaults to the file name without .dq). Use --replace to overwrite an existing script with the same name without prompting.
# Validate script syntax quantquack dsl validate my_script.dq # Compile to SQL (optional --output file.sql) quantquack dsl compile my_script.dq quantquack dsl compile my_script.dq -o output.sql # Run script against a dataset quantquack dsl run my_script.dq <dataset-id> # Run and save script to server (name defaults to "my_script") quantquack dsl run my_script.dq <dataset-id> --save quantquack dsl run my_script.dq <dataset-id> --save -n "My Analysis" quantquack dsl run my_script.dq <dataset-id> --save --replace # With metadata and output options quantquack dsl run my_script.dq <dataset-id> --metadata metadata.json quantquack dsl run my_script.dq <dataset-id> --format csv --output results.csv
See the DSL Guide and API Reference for DuckScript syntax and functions.
π Script management
Create, update, list, and inspect scripts on the server from local .dq files. Script name defaults to the file name (without .dq). If a script with that name already exists, you are prompted to replace it unless you pass --replace.
# List your scripts quantquack scripts list # Create a script from a file (name defaults to file name) quantquack scripts create my_script.dq quantquack scripts create my_script.dq -n "My Script" -d "Description" # Replace existing script with same name (no prompt) quantquack scripts create my_script.dq --replace # Update an existing script by ID quantquack scripts update <script-id> my_script.dq quantquack scripts update <script-id> my_script.dq -n "New Name" # Show script metadata (use --code to include full DSL) quantquack scripts get <script-id> quantquack scripts get <script-id> --code
π Data providers
Configure API keys for FMP, Polygon, or Databento and pull data into datasets.
# Configure Financial Modeling Prep (one key) quantquack providers configure fmp --api-key "your_fmp_key" # Configure Polygon (separate keys per product) quantquack providers configure polygon stocks --api-key "polygon_stocks_key" quantquack providers configure polygon crypto --api-key "polygon_crypto_key" # List configured providers quantquack providers list
Then use provider-specific commands to discover stocks or pull historical data:
# FMP: discover and create dataset quantquack dataset fmp fundamentals discover-stocks --min-market-cap 500000000 --sectors "Technology" --limit 20 --timeframe 1day --dataset-name "Tech-MidCaps" # FMP: pull historical data quantquack dataset fmp historical pull -s AAPL -f 2020-01-01 -o 2024-12-31 -i 1day --confirm-upload # Polygon: pull stock or crypto data quantquack dataset polygon stocks pull -s AAPL -f 2024-01-01 -o 2024-12-31 -i 5min --confirm-upload quantquack dataset polygon crypto pull -s BTCUSD -f 2023-01-01 -o 2024-12-31 -i 1hour --confirm-upload
π Backtesting
Run backtests using a script (with backtest config) and a dataset. Optionally override capital, timeframes, and position size.
# List scripts with backtest configuration quantquack backtest list # Run backtest (use script and dataset IDs from the app or dataset list) quantquack backtest run --script-id <script-uuid> --dataset-id <dataset-uuid> # With custom parameters quantquack backtest run --script-id <id> --dataset-id <id> --capital 50000 --signal-timeframe 15min --execution-timeframe 1min --position-size 2 # Wait for completion and save results quantquack backtest run --script-id <id> --dataset-id <id> --wait --output results.json --format json