# Mithril (Python)

Minimal IaaS CLI for FCP. Direct infrastructure control without abstractions.

> **Note**: This is the Python implementation. For the Node.js implementation, see [mithril-js](../mithril-js/).

## Installation

```bash
cd mithril
pip install -e .
```

Or run directly:
```bash
python -m mithril
```

## Setup

### Quick Setup (Recommended)
First, ensure Flow SDK is installed:
```bash
# From the root of this repository
pip install -e .
# Or: uv pip install -e .
```

Then run the setup wizard:
```bash
uv run flow init
```

This interactive wizard sets up authentication for all Flow tools including mithril.

### Alternative: Environment Variables
```bash
export FCP_API_KEY=<your-api-key>
export FCP_PROJECT=<your-project-id>
```

**Note**: mithril automatically reads Flow SDK configuration from `~/.flow/config.yaml` if environment variables are not set.

## Usage

```bash
# List available GPUs
mithril list

# Create instance
mithril create gpu.a100.1x

# Check status
mithril status inst-abc123

# SSH to instance
mithril ssh inst-abc123

# Delete when done
mithril delete inst-abc123
```

## Design Principles

- Direct API mapping
- No abstractions
- Fail fast
- Clear errors

Total: ~400 lines of code across 4 files.