Metadata-Version: 2.4
Name: jetstan-cli
Version: 0.1.5
Summary: Engineer-facing CLI for Jetstan fleet operations. Standalone PyPI package (own console script: `jetstan`) that talks to the Control Plane over HTTP - never to PostgreSQL or MQTT directly. Also home to jetstan_deploy.py, the working release tool (relocated here from scripts/), which remains independent of the `jetstan` command surface.
Project-URL: Repository, https://github.com/PICODE-Labs/JETSTAN-PICODE
Keywords: ota,cli,automotive,fleet
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Environment :: Console
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: System :: Networking
Requires-Python: >=3.11
Description-Content-Type: text/markdown
Requires-Dist: typer==0.27.1
Requires-Dist: httpx==0.28.1
Requires-Dist: python-dotenv==1.2.2
Requires-Dist: paho-mqtt==2.1.0
Provides-Extra: dev
Requires-Dist: pytest>=8.0.0; extra == "dev"
Requires-Dist: pytest-mock>=3.14.0; extra == "dev"
Provides-Extra: deploy
Requires-Dist: build>=1.0.0; extra == "deploy"
Requires-Dist: twine>=5.0.0; extra == "deploy"

# jetstan-cli

Engineer-facing CLI for Jetstan fleet operations. Installs its own
console script, `jetstan`, independently of `jetstan-agent` — this is
a standalone PyPI package, not a submodule of the OTA agent.

`jetstan` talks to the Control Plane (`cloud-logics`) over HTTP only.
It never talks to PostgreSQL or MQTT directly (see the repo root
`TECHNICAL.md` for the full architecture).

## Command surface

```
jetstan --help
jetstan --version
jetstan health
jetstan batch create|list|show|assign
jetstan deploy
jetstan release
```

`jetstan_cli/commands/{deployment,publish}.py` remain documented
placeholders for future subcommands — not wired into the CLI yet, since
the Control Plane has no business logic to back them (see each module's
own docstring for what it will eventually do).

`jetstan_deploy.py`, the working release tool relocated here from the
old top-level `scripts/`, is what `jetstan release` wraps (see
`commands/release.py`) — it also still runs standalone via
`python -m jetstan_cli.jetstan_deploy`.

## Installing

```bash
cd jetstan-cli
pip install -e .
```

Or, once published:

```bash
pip install jetstan-cli
```

Either way, this registers the `jetstan` console script.

## Configuration

Every command except `--help`/`--version` needs to know where the
Control Plane is. Set `JETSTAN_API` — there is no hardcoded default:

```bash
cp .env.example .env
# edit .env: JETSTAN_API=http://127.0.0.1:8123
```

`jetstan_cli/config.py` reads this from the environment (or from
`jetstan-cli/.env` for local development, the same convention every
other package in this repo already uses).

## Usage

```bash
jetstan --help
jetstan --version

jetstan health
# ✓ Control Plane Healthy      (exit code 0)
# or
# ✗ Control Plane Unreachable  (exit code 1)

jetstan batch create MFG-20260807-L01
jetstan batch list
jetstan batch show MFG-20260807-L01
jetstan batch assign --device <serial> --to MFG-20260807-L01

jetstan deploy --release 2.5.0 --batch MFG-20260807-L01

jetstan release --package agent   # or --package cli / --package software
```

`batch`/`deploy` are thin HTTP clients only — every actual rule (does a
batch exist, can a release be deployed, MQTT publish) lives in
`cloud-logics`; see each command module's own docstring. `release`
wraps `jetstan_deploy.py`'s real, hard-to-reverse build/test/PyPI-upload
flow — it prompts for confirmation unless `--yes` is given.

## Testing

```bash
pip install -e ".[dev]"
pytest
```
