treqs-cli
treqs-cli is the command-line control plane for TReqs. The current slice covers
authentication, identity, project discovery, repo-local project context, training
request lifecycle commands, compute target discovery, and project job inspection.
Installation
Install treqs-cli in an isolated tool environment (Python 3.10+):
uv tool install treqs-cli
# or
pipx install treqs-cli
To install it in an existing environment instead:
uv pip install treqs-cli
# or
pip install treqs-cli
Verify the console script after installation:
treqs --version
treqs --help
Development
python -m venv .venv
. .venv/bin/activate
pip install -e ".[dev]"
pytest
ruff check .
mypy src/treqs_cli
Local E2E
tests/e2e/ is a local-only harness and is intentionally ignored by git. It
targets the PM2-managed local treqs-api e2e service and database.
Run it explicitly:
TREQS_CLI_E2E=1 pytest tests/e2e -q
Useful overrides:
TREQS_E2E_API_URL=http://127.0.0.1:3202
TREQS_E2E_DEV_EMAIL=jon+test1@treqs.ai
TREQS_E2E_PROJECT_PREFIX=treqs-cli-e2e
Default pytest remains fast and deterministic; local e2e tests are skipped
unless TREQS_CLI_E2E=1 is set.
Commands
Every command documents its options, arguments, and examples in --help; the
full generated reference lives in docs/CLI.md (regenerate with
uv run python -m treqs_cli.reference_docs).
treqs login / treqs logout
Authenticate via browser/device login or a dashboard-generated API token;
logout clears local auth state and revokes the session when possible.
treqs login
treqs login --token treqs_pat_...
treqs logout
treqs whoami
Show the authenticated user and every owner (yourself plus organizations) you can act as, with your role and project count per owner.
treqs whoami
treqs orgs list
List organizations you belong to. Every name shown is a valid --owner value
for owner-scoped commands and for <owner>/<project> selections.
treqs orgs list
treqs projects
List projects available to you, or create a new one for an owner.
treqs projects list
treqs projects create "MNIST Digits" --visibility public
treqs projects create "Team Model" --owner acme
treqs project
Manage the repo-local project binding, written to .treqs/config.toml. This
binding drives tr and jobs commands and sets the default owner scope for
owner-scoped commands.
treqs project use <owner>/<project>
treqs project status
treqs project clear
treqs tr
Manage training requests for the repo-bound project: create a draft, open it against a compute target, then queue it as a job.
treqs tr create --title "Train MNIST" --workflow-path .treqs/workflows/train.yaml
treqs tr list --status open
treqs tr open <request-id> --compute-target <target>
treqs tr queue <request-id>
treqs compute
Inspect and create compute targets, set their secrets, and issue agent registration codes.
treqs compute targets list --owner <owner>
treqs compute targets create --name gpu-box
treqs compute secrets set --target gpu-box WANDB_API_KEY=abc123
treqs compute targets registration-code create --target gpu-box
treqs jobs
Inspect jobs, which are created by treqs tr queue.
treqs jobs list --status QUEUED
treqs jobs show <job-id>
treqs jobs watch <job-id>
treqs jobs logs <job-id> --follow
treqs jobs republish-lineage <job-id>
jobs watch follows compute provisioning, agent acquisition, execution, and
terminal status while also streaming workload logs. Lifecycle status is sent
to stderr and workload output remains on stdout. Ctrl-C detaches without
cancelling the job; use treqs jobs cancel <job-id> to cancel explicitly.
API tokens
Besides the browser/device flow, the CLI accepts personal API tokens generated
in the TReqs dashboard (treqs_pat_...):
treqs login --token treqs_pat_...validates the token against the API and stores it like a normal login. Use--token -to read the token from stdin (e.g.echo $TOKEN | treqs login --token -) so it never hits shell history.TREQS_API_TOKEN=treqs_pat_...authenticates API requests directly from the environment without touching stored auth state. When set, it takes precedence over any stored login;treqs logoutstill clears stored state but the environment token stays active until unset.
Owner scope
Owner-scoped commands (projects create, compute ...) accept
--owner <org> and default to the repo's bound project owner, then your
personal owner. Repo-bound commands (project, tr, jobs) always use the
binding in .treqs/config.toml. Discover organizations with treqs orgs list.
The CLI stores global auth state under the platform config directory, or
TREQS_CONFIG_HOME when set. Repo context is written to .treqs/config.toml.
Shell completion
Click provides tab completion for commands and options:
# bash (~/.bashrc)
eval "$(_TREQS_COMPLETE=bash_source treqs)"
# zsh (~/.zshrc)
eval "$(_TREQS_COMPLETE=zsh_source treqs)"
# fish (~/.config/fish/completions/treqs.fish)
_TREQS_COMPLETE=fish_source treqs | source
Metadata
Release files for treqs-cli 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| treqs_cli-0.2.0.tar.gz | 90.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| treqs_cli-0.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 160.0 kB
Release files / treqs_cli-0.2.0.tar.gz
| Download URL | treqs_cli-0.2.0.tar.gz |
|---|---|
| Size | 90.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
719bf7dcdc1e21bf0f05ca15f613aaac9d547e82731de7262ecdd9b02955757c
|
|
BLAKE2b-256 checksum How to use checksums |
a960c5f96014a06d44c9f42f94e6e3a4339dda5f3280fe8ca00a9efd51f4412c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|
Release files / treqs_cli-0.2.0-py3-none-any.whl
| Download URL | treqs_cli-0.2.0-py3-none-any.whl |
|---|---|
| Size | 69.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3bd76a920c57e38b787800fe068cf4c6be7617b41b4d0c11febd06daa3ba2653
|
|
BLAKE2b-256 checksum How to use checksums |
b878ebe7b41bd5d861ea17a21a384c1af3e38a587f04910162167ae97cda50cf
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.12.13
|