DocsCLI Reference

CLI Reference

Complete command reference for the tp-ops CLI.

Installation

Terminal
$ pip install tp-ops

Requires Python 3.10+. Works on macOS, Linux, and Windows (WSL).

Getting Started

tp-ops init

First-time setup wizard. Configures authentication and downloads the AI model.

Example
$ tp-ops init

Welcome to TernaryPhysics Ops!

Downloading TernaryPhysics-7B model...
████████████████████████████████ 100% (4.2GB)

Setup complete. Run 'tp-ops drop' on a resource to get started.

tp-ops login

Authenticate with your TernaryPhysics account.

Example
$ tp-ops login --token tp_live_xxxxxxxxxxxxx

Authenticated as: your@email.com
Organization: Acme Corp

Agent Management

tp-ops drop

Drop an agent onto the current resource. Auto-detects the resource type.

tp-ops drop [--type <type>] [--name <name>]
Example
# SSH to your resource first
$ ssh my-server

# Drop an agent (auto-detects type)
$ tp-ops drop

Detecting resource type...
✓ Detected: PostgreSQL 15.2
✓ Agent type: postgres-agent

Agent dropped successfully!
Name: payments-db
Type: postgres-agent
Status: active

# Override detection if needed
$ tp-ops drop --type redis-agent
$ tp-ops drop --name custom-name

tp-ops list

List all deployed agents and their status.

Example
$ tp-ops list

AGENT            TYPE            STATUS   GB PROCESSED  COST
prod-cluster     k8s-agent       active   12.4          $6.20
payments-db      postgres-agent  active   3.2           $1.60
api-server       vm-agent        active   1.1           $0.55
cache-primary    redis-agent     active   0.8           $0.40

Total: 4 agents, 17.5 GB processed, $8.75 this period

# Output as JSON
$ tp-ops list --json

tp-ops remove

Remove a deployed agent.

Example
$ tp-ops remove payments-db

Remove agent 'payments-db'? [y/N] y

Agent 'payments-db' removed.

# Force remove without confirmation
$ tp-ops remove payments-db --force

Investigation

tp-ops ask

Start an interactive conversation with an agent.

Interactive session
$ tp-ops ask prod-cluster

prod-cluster > Why are pods crashing?

Investigating...

Found 3 pods in CrashLoopBackOff:
├─ payment-api-7d9f8: OOMKilled (exceeded 256Mi limit)
├─ worker-batch-3k2j: ImagePullBackOff (registry auth failed)
└─ cache-warm-x92m: Missing configmap 'redis-config'

Recommendation: Increase memory limit for payment-api.
Show fix command? [yes/no]

prod-cluster > yes

kubectl set resources deployment/payment-api -c payment-api --limits=memory=512Mi

Apply this fix? [yes/no]

tp-ops run

Run a one-shot investigation (non-interactive).

Example
$ tp-ops run prod-cluster "why is API latency high?"

Investigating across mesh...

Root cause: Database connection pool exhausted.
payments-db agent reports 147/150 connections in use.

Recommendation: Increase pool size or optimize queries.

# Auto-approve fixes (use with caution)
$ tp-ops run prod-cluster "fix OOM issues" --auto-approve

tp-ops scan

Proactively scan for issues before they cause problems.

Example
$ tp-ops scan prod-cluster

[1/4] Checking resource utilization... OK
[2/4] Checking for orphaned resources... 2 found
[3/4] Checking security posture... 1 warning
[4/4] Checking pending updates... OK

Summary:
  2 orphaned PVCs (12GB reclaimable)
  1 pod running as root (security warning)

View details? [yes/no]

# Deep scan (more thorough)
$ tp-ops scan prod-cluster --deep

tp-ops audit

Run a security audit against compliance frameworks.

Example
$ tp-ops audit prod-cluster --compliance cis

CIS Kubernetes Benchmark v1.8.0
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

[PASS] 1.1.1 API server --anonymous-auth is disabled
[PASS] 1.1.2 API server --basic-auth-file is not set
[FAIL] 1.2.1 Audit logging is not enabled
[WARN] 1.3.1 Controller manager --profiling is enabled

Score: 87/100 (14 passed, 1 failed, 1 warning)

# Other frameworks
$ tp-ops audit prod-cluster --compliance soc2
$ tp-ops audit prod-cluster --compliance hipaa

History & Usage

tp-ops history

View investigation history for an agent.

Example
$ tp-ops history prod-cluster --limit 5

ID    TIME              ISSUE                    STATUS
001   2h ago            OOM in payment-api       fixed
002   1d ago            High CPU usage           resolved
003   2d ago            Network timeout          investigating
004   3d ago            Pod crashloop            fixed
005   5d ago            Disk pressure warning    resolved

tp-ops usage

View billing and usage breakdown.

Example
$ tp-ops usage --days 30

Usage Summary (Last 30 days)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Total GB Processed: 52.3 GB
Cost: $26.15

By Resource:
  prod-cluster     28.1 GB    $14.05
  payments-db      12.8 GB    $6.40
  api-server       8.2 GB     $4.10
  cache-primary    3.2 GB     $1.60

Rate: $0.50 / GB processed

Quick Reference

tp-ops drop

Drop agent on resource

tp-ops list

List all agents

tp-ops ask <name>

Interactive session

tp-ops run <name> "..."

One-shot investigation

tp-ops scan <name>

Proactive scan

tp-ops audit <name>

Security audit

tp-ops remove <name>

Remove agent

tp-ops --help

Show help