Skip to main content

CLI for StockPro -- AI-powered stock research from your terminal

Project description

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

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

stockpro_cli-0.3.0.tar.gz (20.4 kB view details)

Uploaded Source

Built Distribution

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

stockpro_cli-0.3.0-py3-none-any.whl (24.7 kB view details)

Uploaded Python 3

File details

Details for the file stockpro_cli-0.3.0.tar.gz.

File metadata

  • Download URL: stockpro_cli-0.3.0.tar.gz
  • Upload date:
  • Size: 20.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for stockpro_cli-0.3.0.tar.gz
Algorithm Hash digest
SHA256 3accc599ae0ffcd024f0c6173847142a2a2b1ea18ffffa5ccf38cc3b3772943d
MD5 48d7fa7a40376b95a5479f6d4e721cf1
BLAKE2b-256 3e693c303c8f31ac58362ca6abfaa25700e9296bb236b2e855f86091aeaec2ba

See more details on using hashes here.

File details

Details for the file stockpro_cli-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: stockpro_cli-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 24.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for stockpro_cli-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c924430f1aef7aa5246fe64eed492971ce8c2e967db2f849af65e83ffbbe1727
MD5 66a384fbdbaf67b01a2da77f709fe6fa
BLAKE2b-256 433c61a2a8c1bb271c1456af138925a27da506db6ff67fcc775f90bc6229ee33

See more details on using hashes here.

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