Metadata-Version: 2.4
Name: inedge
Version: 0.13.0
Summary: InEdge Cloud CLI
Requires-Python: >=3.10
Requires-Dist: httpx>=0.28.0
Requires-Dist: keyring>=25.5.0
Requires-Dist: minio>=7.2.0
Requires-Dist: rich>=13.9.0
Requires-Dist: tomli-w>=1.1.0
Requires-Dist: tomli>=2.0.0
Requires-Dist: typer[all]>=0.13.0
Provides-Extra: dev
Requires-Dist: mypy>=1.13.0; extra == 'dev'
Requires-Dist: pre-commit>=4.0.0; extra == 'dev'
Requires-Dist: pytest-cov>=6.0.0; extra == 'dev'
Requires-Dist: pytest>=8.3.0; extra == 'dev'
Requires-Dist: ruff>=0.8.0; extra == 'dev'
Provides-Extra: mcp
Requires-Dist: inedge-mcp>=0.1.0; extra == 'mcp'
Description-Content-Type: text/markdown

# inedge-cli

Command-line interface for InEdge Cloud. Deploy, manage, and monitor your services from the terminal.

## Install

```bash
pip install inedge
```

## Quick Start

```bash
inedge login                                          # Authenticate via browser
inedge login --token <api-key>                        # CI/CD (non-interactive)
inedge orgs list                                      # List your organizations
inedge orgs switch fastassert                         # Set active org
inedge projects create --name production              # Create a project
inedge projects switch production                     # Set active project
inedge context                                        # Show current org + project
```

## Commands

```
inedge login [--token <key>]          Log in (browser OAuth or API key)
inedge logout                         Clear stored credentials
inedge auth status                    Show auth state + org + project

inedge orgs list                      List organizations
inedge orgs switch <org>              Switch active org

inedge projects list                  List projects in current org
inedge projects create --name <name>  Create project
inedge projects switch <project>      Switch active project

inedge context                        Show current org + project
inedge context set --org --project    Set context directly

inedge config list                    Show all config values
inedge config set <key> <value>       Set a config value

inedge services list                  List services in current project
inedge services get <id>              Get service details
inedge services create --name <n> --image <img>  Create service
inedge services delete <id> [--yes]   Delete service
inedge services deploy <id> --image <img>  Deploy new image
inedge services scale <id> --replicas <n>  Scale replicas

inedge deployments list <service-id>  List deployment history
inedge deployments rollback <service-id> [--to <dep-id>]  Rollback

inedge registry repos                 List image repositories
inedge registry artifacts <repo>      List artifacts/tags
inedge registry credentials [--github-actions]  Get push credentials

inedge db list                        List databases in current project
inedge db get <id>                    Get database details
inedge db create --name <n> ...       Create managed PostgreSQL database
inedge db delete <id> [--yes]         Delete database
inedge db credentials <id>            Show connection credentials
inedge db connect <id> [--copy]       Get psql connection string
inedge db link <id> --service <svc>   Link database to a service
inedge db unlink <id> --service <svc> Unlink database from a service
inedge db backups <id>                List backups (requires PITR)
inedge db backup <id>                 Create on-demand backup
inedge db restore <id> [--backup|--target-time] [--yes]  Restore database
inedge db metrics <id>                Show database metrics

inedge secrets list                   List secrets in current project
inedge secrets get <key>              Get secret details
inedge secrets set <key> --value <v>  Create or update a secret
inedge secrets delete <key> [--yes]   Delete a secret
inedge secrets import --file <path>   Import secrets from .env file
inedge secrets link <key> --service <svc>    Link secret to service
inedge secrets unlink <key> --service <svc>  Unlink secret from service

inedge env list <service-id>          List env vars for a service
inedge env set <svc> KEY=VALUE ...    Set environment variables
inedge env delete <svc> <key>         Delete an environment variable
inedge env import <svc> --file <path> Import env vars from .env file
```

All commands support `--format json|table` for output formatting.

## Current Status

| Milestone | Status | Details |
|-----------|--------|---------|
| M0 — Foundation | ✅ Complete | Auth, context, orgs, projects commands |
| M1 — Web Services + Registry | ✅ Complete | Services CRUD + deploy, deployments, registry commands |
| M2 — Databases + Secrets | ✅ Complete | Database CRUD, backups, restore, metrics, secrets, env vars |

## Configuration

Config is stored at `~/.inedge/config.toml`. Auth tokens are stored in the OS keychain via `keyring`.

```bash
inedge config set api-url https://api.inedge.ai/api/v1
inedge config set default-org mycompany
inedge config set default-project production
```

## Development

```bash
python3 -m venv .venv
source .venv/bin/activate
pip install -e ".[dev]"
inedge --help
```

## Structure

```
inedge-cli/
├── src/inedge_cli/
│   ├── __init__.py
│   ├── main.py              # Typer app entry point
│   ├── config.py            # Config management (~/.inedge/config.toml)
│   ├── api_client.py        # HTTP client (httpx) for Cloud API
│   ├── auth.py              # Token management via keyring
│   ├── commands/
│   │   ├── auth.py          # login, logout, auth status
│   │   ├── context.py       # context show, context set
│   │   ├── orgs.py          # orgs list, switch
│   │   ├── projects.py      # projects list, create, switch
│   │   ├── services.py      # services CRUD + deploy (M1)
│   │   ├── deployments.py   # deployments list, rollback (M1)
│   │   ├── registry.py      # registry login, list, tags (M1)
│   │   ├── databases.py     # database CRUD, backups, restore, metrics (M2)
│   │   ├── secrets.py       # secrets CRUD, import, link/unlink (M2)
│   │   └── env.py           # env vars list, set, delete, import (M2)
│   └── utils/
│       ├── output.py        # Rich table / JSON formatting
│       └── errors.py        # User-friendly error handling
├── tests/
├── pyproject.toml
└── README.md
```
