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 | statusstockpro portfolio liststockpro 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 liststockpro watchlist list
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stockpro_cli-0.3.1.tar.gz.
File metadata
- Download URL: stockpro_cli-0.3.1.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fb93e0be67dc93673f27b8905e15bd86665c3e50cef9debba1d972f448ce0a08
|
|
| MD5 |
0fbac282624086e65e0f4354dce555ed
|
|
| BLAKE2b-256 |
545d731957f769326cab64f0bebd472ce196978f554406cfb9ad9fb6909ec809
|
File details
Details for the file stockpro_cli-0.3.1-py3-none-any.whl.
File metadata
- Download URL: stockpro_cli-0.3.1-py3-none-any.whl
- Upload date:
- Size: 24.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
805e16d37e4c3bae8c81e3c66b625409a574f5912e7a67eb62e0bba144cee579
|
|
| MD5 |
9173d8979fbe8f33ae6ce050c854a817
|
|
| BLAKE2b-256 |
9fcffb1e123e9058f98625dcaf9ae06e47518b0ff26526cbafc912d8ce42bf69
|