Metadata-Version: 2.4
Name: eridani-cli
Version: 0.1.0
Summary: CLI for managing robot training jobs on the Eridani GPU cluster.
Author-email: GPU Solutions <help@gpusolutions.ai>
License-Expression: MIT
License-File: LICENSE
Classifier: Development Status :: 4 - Beta
Classifier: Environment :: Console
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Requires-Python: >=3.10
Requires-Dist: httpx<1,>=0.28
Requires-Dist: keyring<26,>=25
Requires-Dist: keyrings-alt<6,>=5
Requires-Dist: python-dotenv<2,>=1
Requires-Dist: questionary<3,>=2.1
Requires-Dist: rich<15,>=14
Requires-Dist: typer<1,>=0.24
Provides-Extra: dev
Requires-Dist: pytest; extra == 'dev'
Requires-Dist: pytest-httpx; extra == 'dev'
Description-Content-Type: text/markdown

# Eridani CLI

Command-line interface for managing robot training jobs on the Eridani GPU cluster. Built with [Typer](https://typer.tiangolo.com/) and [Rich](https://rich.readthedocs.io/).

---

## Installation

> Requires Python 3.10+

```bash
pip install eridani
```

This installs the `eridani` command globally in your environment.

---

## Commands

| Command              | Description                                      |
| -------------------- | ------------------------------------------------ |
| `eridani init`       | Initialize an Eridani project in the current directory |

| `eridani tasks`      | List all tracked tasks                           |
| `eridani info`       | Show project overview                            |
| `eridani update`     | Re-scan project directory for new tasks          |
| `eridani train`      | Submit a training job to the Eridani cluster     |
| `eridani status`     | Show training job status                         |
| `eridani cancel`     | Cancel a running training job                    |
| `eridani logs`       | View training job logs                           |
| `eridani pull`       | Download training weights from a completed job   |
| `eridani delete`     | Delete a training job                            |
| `eridani revoke`     | Revoke the API key and remove the project        |

### Global Options

| Flag              | Description              |
| ----------------- | ------------------------ |
| `--version`, `-v` | Show version and exit    |
| `--help`          | Show help and exit       |

### Typical Workflow

```bash
# 1. Initialize a project (authenticates and creates .eridani)
eridani init

# 2. Submit a training job
eridani train --task MyTask-v0 --library skrl

# 3. Check job status
eridani status

# 4. Stream logs from a running job
eridani logs <job_code> --follow

# 5. Cancel a running job
eridani cancel <job_code>

# 6. Download weights from the last completed job
eridani pull

# Or pull a specific job's weights to a custom directory
eridani pull trn_ab2e9a14 --output ./results
```

---

## Project Structure

```
eridani/
├── main.py                  # Entry point, registers all commands
├── core/
│   ├── config.py            # API URL, timeouts, keyring settings
│   └── exceptions.py        # Base errors and @handle_errors decorator
├── shared/
│   ├── credentials.py       # Keyring operations and login
│   ├── discovery.py         # Task and script auto-discovery
│   ├── http.py              # HTTP client (api_get, api_post, ApiError)
│   ├── jobs.py              # Shared job-fetching logic
│   ├── project.py           # .eridani project file I/O
│   └── ui.py                # Shared console, spinners, error display
└── commands/
    ├── init/                # Project initialization and auth
    ├── revoke/              # API key revocation

    ├── update/              # Re-scan for tasks
    ├── tasks/               # List tracked tasks
    ├── info/                # Project overview
    ├── train/               # Training job submission
    ├── status/              # Training job status
    ├── cancel/              # Cancel a running job
    ├── delete/              # Delete a training job
    ├── logs/                # View training job logs
    └── pull/                # Download training weights
```

Each command follows the same internal structure:

- **service.py** — Command definition and orchestration
- **client.py** — API calls and file operations (complex commands only)
- **ui.py** — Rich console output and formatting (interactive commands only)

---

## Dependencies

- [typer](https://pypi.org/project/typer/) — CLI framework
- [rich](https://pypi.org/project/rich/) — Terminal formatting and tables
- [httpx](https://pypi.org/project/httpx/) — HTTP client for API communication
- [keyring](https://pypi.org/project/keyring/) — Secure API key storage
- [questionary](https://pypi.org/project/questionary/) — Interactive prompts

---

## Development

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

### Running Tests

```bash
python -m pytest tests/ -v
```

Tests use [pytest-httpx](https://pypi.org/project/pytest-httpx/) for HTTP mocking and an in-memory keyring backend to isolate from the OS keyring.

### Pre-commit Hooks

```bash
pre-commit install
pre-commit run --all-files
```

Hooks include linting (ruff) and running the full test suite.

---

## Shell Completion

```bash
eridani --install-completion
```

Supports Bash, Zsh, Fish, and PowerShell.

---

## License

MIT License
