Skip to main content

StockPro CLI

AI-powered stock research from your terminal. Talks to the StockPro backend over HTTPS.

By default the CLI targets the live deployment at https://stockpro-production-11c8.up.railway.app.

Install

pip install stockpro-cli

Or, for local development from the repo root:

pip install -e stockpro-cli/

This registers the stockpro command.

Token storage

Your auth token is stored in your OS keychain (macOS Keychain, Windows Credential Locker, or freedesktop Secret Service on Linux) via the keyring library. If no keyring backend is available, the token falls back to ~/.stockpro/config.json (mode 0600) and you'll see a warning. For headless/CI use, set STOCKPRO_TOKEN=... — it overrides everything else.

First-time sign-in

stockpro auth login

Opens your browser to the StockPro Clerk sign-in page. After Google OAuth completes, the browser redirects to a short-lived local callback (timeout: 120s) and the CLI stores your token in the OS keychain.

Confirm:

stockpro auth status

Sign out (clears the stored token):

stockpro auth logout

Headless / serverless (no browser)

For agents running in a serverless environment (no browser to open), use the device-code flow. The agent prints a code; the user opens the URL on any device, signs in, and approves.

stockpro auth device-login

Output:

Open https://stockpro-production-11c8.up.railway.app/app/device?user_code=ABCD1234 on any browser,
sign in, and confirm code: ABCD1234
(expires in 10 min). Waiting...

Once approved, the token is saved to ~/.stockpro/config.json just like auth login.

Token injection via env var

If the agent already has a token (e.g. generated from the Settings -> CLI tokens page on the web app), skip the device flow entirely:

export STOCKPRO_TOKEN=sp_xxxxxxxxxxxxxxxx
stockpro portfolio list

STOCKPRO_TOKEN takes precedence over ~/.stockpro/config.json. Perfect for injecting into serverless runtimes as a secret.

Pointing at local Flask (dev)

Precedence: --api-url flag > STOCKPRO_API_URL env var > ~/.stockpro/config.json > default.

Per invocation:

stockpro --api-url http://127.0.0.1:5000 auth status

Shell session:

export STOCKPRO_API_URL=http://127.0.0.1:5000
stockpro auth status

Persist in the config file (only if you pass --api-url during auth login):

stockpro --api-url http://127.0.0.1:5000 auth login

Commands

Run stockpro --help for the full list. Common ones:

  • stockpro auth login | logout | status
  • stockpro portfolio list
  • stockpro portfolio cash show --id <pid>
  • stockpro portfolio cash enable --id <pid>
  • stockpro portfolio cash set --id <pid> --amount <X>
  • stockpro portfolio cash deposit --id <pid> --amount <X>
  • stockpro portfolio cash withdraw --id <pid> --amount <X>
  • stockpro report list
  • stockpro watchlist list

Metadata

Release files for stockpro-cli 0.3.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stockpro-cli 0.3.1
File Size Uploaded
stockpro_cli-0.3.1.tar.gz 20.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for stockpro-cli 0.3.1
File Interpreter ABI Platform
stockpro_cli-0.3.1-py3-none-any.whl Python 3 none any Details

Total release size: 45.5 kB

Release files / stockpro_cli-0.3.1.tar.gz

Download URL stockpro_cli-0.3.1.tar.gz
Size 20.7 kB
Tags Source
SHA-256 checksum
How to use checksums
fb93e0be67dc93673f27b8905e15bd86665c3e50cef9debba1d972f448ce0a08
BLAKE2b-256 checksum
How to use checksums
545d731957f769326cab64f0bebd472ce196978f554406cfb9ad9fb6909ec809
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release files / stockpro_cli-0.3.1-py3-none-any.whl

Download URL stockpro_cli-0.3.1-py3-none-any.whl
Size 24.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
805e16d37e4c3bae8c81e3c66b625409a574f5912e7a67eb62e0bba144cee579
BLAKE2b-256 checksum
How to use checksums
9fcffb1e123e9058f98625dcaf9ae06e47518b0ff26526cbafc912d8ce42bf69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.13

Release history Release notifications | RSS feed

This release

0.3.1 This release

2 release files

0.3.0

2 release files

0.2.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page