Metadata-Version: 2.4
Name: kelvin-sdk
Version: 9.7.4b1
Summary: CLI tool to interact with Kelvin platform
Author-email: Kelvin Inc <engineering@kelvininc.com>
Project-URL: Homepage, https://kelvin.ai/
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Requires-Python: <3.14,>=3.9
Description-Content-Type: text/markdown
License-File: LICENSE.txt
Requires-Dist: rich-click<2,>=1.9
Requires-Dist: rich<15,>=14
Requires-Dist: pydantic[email]==2.11.*
Requires-Dist: docker<8,>=7
Requires-Dist: python-on-whales<1,>=0.80
Requires-Dist: PyYAML<7,>=6
Requires-Dist: ruamel.yaml<1,>=0.19
Requires-Dist: typing-extensions<5,>=4
Requires-Dist: structlog<25,>=23
Requires-Dist: jsonschema<5,>=4
Requires-Dist: typeguard<5,>=4
Requires-Dist: jinja2<4,>=3
Requires-Dist: setuptools>=80
Requires-Dist: packaging>=24
Requires-Dist: platformdirs<5,>=4
Requires-Dist: keyring<26,>=25
Requires-Dist: keyrings.alt<6,>=5
Requires-Dist: questionary<3,>=2
Requires-Dist: kelvin-python-sdk[ai,publisher]<0.5,>=0.4.4b1
Requires-Dist: kelvin-python-api-client<2.0,>=1.1.3b1
Provides-Extra: mlflow
Requires-Dist: mlflow<4,>=3; extra == "mlflow"
Dynamic: license-file

# Kelvin CLI

Command-line tool to interact with the Kelvin Platform.

## Installation

```bash
pip install kelvin-sdk
```

## Quick Start

### Authentication

Log in to a Kelvin platform:

```bash
kelvin auth login demo.kelvin.ai
```

This opens your browser for SSO authentication. Alternative authentication methods:

```bash
# Client credentials (for automation)
kelvin auth login demo.kelvin.ai --client-id <id> --client-secret <secret>

# Username/password
kelvin auth login demo.kelvin.ai -u <username> -p <password>

# With 2FA
kelvin auth login demo.kelvin.ai -u <username> -p <password> --totp <code>
```

### Explore Commands

Use `--tree` to see all available commands:

```bash
kelvin --tree
```

Get help for any command:

```bash
kelvin --help
kelvin auth --help
kelvin workload deploy --help
```

## Global Flags

These flags are available on all commands:

| Flag | Description |
|------|-------------|
| `--json` | Output as JSON (for scripting) |
| `-y`, `--yes` | Skip confirmation prompts |
| `-v`, `--verbose` | Enable debug logging |


### JSON Mode

Use `--json` for machine-readable output:

```bash
kelvin workload list --json
kelvin apps list --json | jq '.apps[] | .name'
```

### Scripting

Combine `--json` and `--yes` for non-interactive scripts:

```bash
kelvin workload undeploy my-workload --json --yes
```

## Command Groups

### `auth` - Authentication

```bash
kelvin auth login <url>      # Log in to platform
kelvin auth logout           # Log out from platform
kelvin auth token            # Get current access token
kelvin auth reset            # Clear all auth state
```

### `apps` - Application Registry

```bash
kelvin apps list             # List applications
kelvin apps search <query>   # Search applications
kelvin apps show <name>      # Show application details
kelvin apps upload <path>    # Upload application
kelvin apps download <name>  # Download application
kelvin apps delete <name>    # Delete application
```

### `app` - Local Application Development

```bash
kelvin app create            # Create new application
kelvin app build             # Build application image
kelvin app upload            # Build and upload to registry
kelvin app samples           # Open code samples repo
```

#### App Images

```bash
kelvin app images list       # List local images
kelvin app images remove     # Remove local image
kelvin app images unpack     # Extract image contents
```

#### App Testing

```bash
kelvin app test simulator    # Generate random test data
kelvin app test csv          # Publish data from CSV
kelvin app test generator    # Use custom data generator
```

#### MLflow Integration

```bash
kelvin app mlflow create     # Create app from MLflow model
kelvin app mlflow import     # Import MLflow model into app
kelvin app mlflow list       # List MLflow models
```

### `workload` - Workload Management

```bash
kelvin workload list                    # List workloads
kelvin workload search <query>          # Search workloads
kelvin workload show <id>               # Show workload details
kelvin workload deploy <app> [options]  # Deploy workload
kelvin workload update <id> [options]   # Update workload
kelvin workload start <id>              # Start workload
kelvin workload stop <id>               # Stop workload
kelvin workload logs <id>               # View workload logs
kelvin workload undeploy <id>           # Delete workload
```

### `secret` - Secret Management

```bash
kelvin secret list           # List secrets
kelvin secret create         # Create secret
kelvin secret update         # Update secret
kelvin secret delete         # Delete secret
```

### `configuration` - CLI Configuration

```bash
kelvin configuration list    # List configurations
kelvin configuration set     # Set configuration
kelvin configuration unset   # Unset configuration
```

### `info` - System Information

```bash
kelvin info                  # Show system and platform info
```

### `reset` - Factory Reset

```bash
kelvin reset                 # Reset all CLI state
```

## Configuration

Configuration is stored in `~/.config/kelvin/` (Linux/macOS) or `%APPDATA%\kelvin\` (Windows).

Set persistent defaults:

```bash
kelvin configuration set json_output true    # Always output JSON
kelvin configuration set no_prompt true      # Never prompt for confirmation
kelvin configuration set verbose true        # Always verbose output
```

## Exit Codes

| Code | Meaning |
|------|---------|
| 0 | Success |
| 1 | General error |
| 2 | Invalid usage / bad arguments |
| 130 | Interrupted (Ctrl+C) |

## Output Conventions

- **stdout**: Command results (data for piping/scripting)
- **stderr**: Progress, status, warnings, errors, debug logs

This ensures CLI output can be safely piped:

```bash
kelvin apps list --json | jq -r '.apps[0].name' | xargs kelvin apps show
```

## Requirements

- Python 3.9 - 3.13
- Docker (for `app build` commands)


