Metadata-Version: 2.4
Name: treqs-cli
Version: 0.1.0
Summary: Command-line control plane for the TReqs platform
Author: TReqs AI
Author-email: Trevor <trevor@treqs.ai>
Project-URL: Homepage, https://github.com/treqs/treqs-cli
Project-URL: Repository, https://github.com/treqs/treqs-cli
Project-URL: Issues, https://github.com/treqs/treqs-cli/issues
Keywords: cli,machine-learning,mlops,training,treqs
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Intended Audience :: Science/Research
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Requires-Python: >=3.10
Description-Content-Type: text/markdown
Requires-Dist: click>=8.1.0
Requires-Dist: httpx>=0.27.0
Requires-Dist: platformdirs>=4.0.0
Requires-Dist: pydantic>=2.6.0
Requires-Dist: tomli>=2.0.0; python_version < "3.11"
Requires-Dist: tomli-w>=1.0.0
Provides-Extra: dev
Requires-Dist: mypy>=1.10.0; extra == "dev"
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: ruff>=0.5.0; extra == "dev"

# 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+):

```bash
uv tool install treqs-cli
# or
pipx install treqs-cli
```

To install it in an existing environment instead:

```bash
uv pip install treqs-cli
# or
pip install treqs-cli
```

Verify the console script after installation:

```bash
treqs --version
treqs --help
```

## Development

```bash
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:

```bash
TREQS_CLI_E2E=1 pytest tests/e2e -q
```

Useful overrides:

```bash
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

```bash
treqs login
treqs whoami
treqs projects list
treqs project use <owner>/<project>
treqs project status
treqs tr list
treqs tr create --title "Train MNIST" --workflow-snapshot-id <snapshot-id>
treqs tr show <request-id>
treqs tr update <request-id> --title "Train Fashion MNIST"
treqs tr update <request-id> --clear-workflow-path --clear-compute-target
treqs tr open <request-id> --workflow-path ".treqs/workflows/train.yaml" --compute-target <target>
treqs tr queue <request-id>
treqs compute targets list --owner <owner>
treqs jobs list --status QUEUED
treqs jobs show <job-id>
```

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`.
