Skip to main content

CLI tool for controlling strategies deployed on the PyQQQ platform.

Project description

pyqqq-cli

Installation

You can install pyqqq-cli via pip:

pip install pyqqq-cli

Usage

After installation, the qqq command will be available:

qqq [OPTIONS] COMMAND [ARGS]...

Use qqq --help or qqq COMMAND --help for detailed usage of each command.

Commands

deploy

Deploy a strategy to the cloud.

Packages and uploads the current directory, then launches the strategy as a long-running deployment. The deployment name defaults to the entryfile basename without extension. Names are normalized to lowercase alphanumeric characters and hyphens.

qqq deploy my_strategy.py
qqq deploy my_strategy.py --name my-strategy
qqq deploy my_strategy.py --publish
Option Description
--name, -n Override the deployment name
--publish, -p Also register the strategy in the public repository

list

List deployments.

Without --published, shows all active deployments of the current user, including deployment ID, status, type, schedule (for cronjobs), and creation time. With --published, shows strategies published to the public registry.

qqq list
qqq list --published
Option Description
--published Show strategies published to the public registry

logs

Show logs of a deployed strategy.

Fetches stdout/stderr output from the running deployment. Works for regular deployments, backtests, and cronjobs.

qqq logs DEPLOYMENT_ID
qqq logs DEPLOYMENT_ID --follow
qqq logs DEPLOYMENT_ID --lines 100
Option Description
--follow, -f Stream logs in real time
--lines, -n Number of recent lines to return

pause

Pause a deployed strategy.

Suspends execution without deleting the deployment. Configuration and environment variables are preserved. Use resume to restart later.

qqq pause DEPLOYMENT_ID

resume

Resume a paused strategy.

Restarts a strategy previously suspended with pause. The deployment picks up with the same configuration and environment variables.

qqq resume DEPLOYMENT_ID

delete

Delete a deployed strategy.

Permanently removes the deployment and stops its execution. This action is irreversible. With --published, removes the strategy from the public registry instead.

qqq delete DEPLOYMENT_ID
qqq delete PUBLISH_ID --published
Option Description
--published Remove from the public registry instead of deleting a deployment

update

Update the runtime environment of a deployed strategy.

Applies the latest environment configuration to a running deployment. The strategy is restarted to pick up the changes.

qqq update DEPLOYMENT_ID

env

Show environment variables of deployed strategies.

Without a deployment ID, shows environment variables for all deployments. With an ID, shows variables for that deployment only.

qqq env
qqq env DEPLOYMENT_ID
qqq env DEPLOYMENT_ID --pretty
Option Description
--pretty, -p Format environment data as indented JSON

cronjob

Deploy a strategy as a scheduled cronjob.

Packages and uploads the strategy, then schedules it to run automatically on the specified cron schedule. Minimum allowed interval is 5 minutes.

qqq cronjob my_strategy.py --schedule "0 9 * * 1-5"
qqq cronjob my_strategy.py --name my-job --schedule "*/30 * * * *"
Option Description
--name, -n Override the cronjob name
--schedule, -s Cron schedule expression (required)

backtest

Deploy a strategy as a backtest job.

Runs the strategy as a one-time batch job in the cloud. The strategy file must define a run_batch() function. Backtest names must be 24 characters or fewer.

qqq backtest my_strategy.py
qqq backtest my_strategy.py --name my-backtest
qqq backtest my_strategy.py --skip
qqq backtest my_strategy.py --env-file .env.backtest
Option Description
--name, -n Set the backtest name (skips prompt)
--skip, -s Skip the name prompt and use the filename
--env-file, -e Path to an environment file for the backtest

run

Run a strategy locally.

Executes the strategy in the current Python environment without deploying it to the cloud. Useful for local testing and development. If requirements.txt exists, dependencies are installed automatically. The execution mode is determined by app.yaml if present.

qqq run my_strategy.py

lint

Lint a Python strategy file for errors.

Runs pylint in errors-only mode to catch syntax and import errors. If OPENAI_KEY is set in the environment, also performs an AI-assisted lint pass for deeper analysis. Unless --skip-test is provided, the file is also validated by running the hook test suite.

qqq lint my_strategy.py
qqq lint my_strategy.py --skip-test
Option Description
--skip-test Skip the hook test suite

search

Search for publicly published stock investment strategies.

Searches the public registry by keyword. Results include the strategy name, author, and star count.

qqq search momentum
qqq search --email user@example.com
qqq search rsi --email user@example.com
Option Description
--email, -e Filter results to strategies by a specific author

pull

Download a strategy from the public registry.

Fetches a published strategy and saves it to the current directory. NAME must be in the format email/strategy_name.

qqq pull user@example.com/my-strategy

publish

Publish a strategy to the public registry.

Packages and uploads the strategy so other users can discover and download it via search and pull. Names are normalized to lowercase alphanumeric characters and hyphens.

qqq publish my_strategy.py
qqq publish my_strategy.py --name my-strategy
Option Description
--name, -n Override the published strategy name

version

Show the installed version number and quit.

qqq version

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

pyqqq_cli-0.4.25.tar.gz (18.5 kB view details)

Uploaded Source

Built Distribution

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

pyqqq_cli-0.4.25-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file pyqqq_cli-0.4.25.tar.gz.

File metadata

  • Download URL: pyqqq_cli-0.4.25.tar.gz
  • Upload date:
  • Size: 18.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.11.7 Linux/5.10.0-32-cloud-amd64

File hashes

Hashes for pyqqq_cli-0.4.25.tar.gz
Algorithm Hash digest
SHA256 16bd213dcb6cc9b10a20a83afcc32fd9d7e7ed2e38262abfd705d8c3fd9b72e7
MD5 7800c7d2e67f6db5665b84117665e93d
BLAKE2b-256 a99653d55c2c90a629b39e5f8ca65c46fd3208d99214b84e78cec75fac29e82a

See more details on using hashes here.

File details

Details for the file pyqqq_cli-0.4.25-py3-none-any.whl.

File metadata

  • Download URL: pyqqq_cli-0.4.25-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.3.4 CPython/3.11.7 Linux/5.10.0-32-cloud-amd64

File hashes

Hashes for pyqqq_cli-0.4.25-py3-none-any.whl
Algorithm Hash digest
SHA256 c67f2a66fb7dc8ff5255bb0c9e2d12cffaad1a3fd3cdb64b94d1cb2181a2ddec
MD5 34d9f128f82d8b1a354eb761451d839c
BLAKE2b-256 51f1cf8a27983a9cd17ba54c8faf7048439e3876bc19e8892de803f486551d64

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