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 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.2.0.tar.gz (19.0 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.2.0-py3-none-any.whl (23.9 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: stockpro_cli-0.2.0.tar.gz
  • Upload date:
  • Size: 19.0 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.2.0.tar.gz
Algorithm Hash digest
SHA256 9625e91a46db5504be3a6ccc2b400021b489a302553655481f01b4db06f1c8c1
MD5 0b5c2b6d86cc38c99adec88b8e0e370d
BLAKE2b-256 934c93316c52acab11026e35680b96c99950732ea57e16e8176e357979f86c5a

See more details on using hashes here.

File details

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

File metadata

  • Download URL: stockpro_cli-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 23.9 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.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9c98a4b071b0a8b7e4c90e6493fce3861f7438f2f04211512dc35e3bed7a6b21
MD5 5432ec93defd038d48c3795cf4f6a8ff
BLAKE2b-256 3b98aeecfe9ff07e2b83367b67e1f317c7336d158d601eb47d2fb809a9682edd

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