Skip to main content

KubeAstra CLI

PyPI version Python 3.11+ License: Apache 2.0

AI-powered Kubernetes troubleshooting from your terminal. A thin HTTP + SSE client for the KubeAstra backend.

$ kubeastra investigate --pod api-gateway --ns production

$ kubeastra investigate
  thinking · The user wants a scoped investigation of api-gateway in production …
 kubectl  get_pods returned 1 result (48ms)
 kubectl  describe_pod api-gateway (162ms)
 logs     get_pod_logs — last 200 lines (89ms)
 events   correlated 3 recent events (54ms)
 analyze  investigate_pod complete (912ms)

─ answer ─
Root cause: OOMKilled. Container RSS 142Mi exceeded limit 128Mi.
Trigger: Memory leak introduced in v2.3.1 (deployed 47 min ago).

╭─ KubeAstra ─────────────────────────────────────────────────────────╮
│                                                                     │
│  Root cause                                                         │
│                                                                     │
│  The api-gateway container was OOMKilled 3 times in the last 30     │
│  minutes. Its resident memory (142Mi) exceeded the configured limit │
│  (128Mi) shortly after each restart. The pattern started at         │
│  14:23 UTC, coinciding with the v2.3.1 rollout at 14:22 UTC.        │
│                                                                     │
│  Recommended: Rollback to v2.3.0 · blast radius: 2 services         │
│                                                                     │
╰─ tool: investigate_pod · cost: $0.0021 · tokens: 640 ─────────────────╯

Install

pip / pipx (recommended for standalone use):

pipx install kubeastra

From the monorepo (for contributors):

git clone https://github.com/astraverse-io/KubeAstra.git
cd KubeAstra/cli
pip install -e .

Python 3.11 or newer is required.

Prerequisites

The CLI talks to a KubeAstra backend over HTTP + Server-Sent Events. Start one before running commands:

# Local backend via docker-compose (from the monorepo root):
cd ui && docker compose up -d --build
# Backend listens on http://localhost:8000 by default.

Or point the CLI at an existing Helm-deployed backend:

kubeastra config set backend-url https://kubeastra.mycompany.internal

Commands

kubeastra open

Run the whole product locally as an app — no Docker, no cluster install, no backend to start first. This is the exception to the prerequisite above: it is the backend.

kubeastra open                # starts the app and opens your browser
kubeastra open --no-browser   # start it, print the URL, open it yourself

It binds a loopback-only port, serves the built UI from that same origin, and uses the kubeconfig already on this machine. Nothing is installed into any cluster, and nothing listens on an external interface.

Requires the UI to have been built once from a source checkout:

npm run build:desktop --prefix ui/frontend

kubeastra ask "..."

Natural-language investigation. Streams the ReAct loop step-by-step.

kubeastra ask "why is checkout-service crashlooping in production?"
kubeastra ask "what pods are in the payments namespace?"

kubeastra investigate

Scoped investigation shortcut — same underlying flow as ask, with a canned question.

kubeastra investigate --pod api-gateway --ns production
kubeastra investigate --deployment redis --ns default
kubeastra investigate --node k8s-worker-01

kubeastra connect

Pick a kubeconfig context. Without arguments, lists what's available.

kubeastra connect                            # list contexts
kubeastra connect --context prod-us-east-1   # connect to a specific context
kubeastra connect --context dev --kubeconfig ~/.kube/other-config

kubeastra config set / get

Persist backend URL, API token (if the backend enforces auth), and session id.

kubeastra config set backend-url https://kubeastra.example.com
kubeastra config set api-token ka_prod_abcdef1234567890
kubeastra config get                         # print all values (token masked)
kubeastra config get backend-url             # print a specific value
kubeastra config path                        # print the config file path

Config lives at ~/.config/kubeastra/config.toml on Linux/macOS ($XDG_CONFIG_HOME/kubeastra/config.toml when set) and %APPDATA%\kubeastra\config.toml on Windows.

kubeastra doctor

Health-check the CLI + backend + kubeconfig detection.

kubeastra doctor

kubeastra --version

Print the CLI version.

Exit codes

Code Meaning
0 Success
1 Generic CLI error (bad flags, unexpected exception)
2 Authentication failure — set an API token
3 Connection failure — backend unreachable
4 Backend returned a non-2xx status
5 Backend answered but the investigation itself errored

Design notes

  • The CLI is a client, not an engine. The ReAct loop, tool dispatch, and RAG live in the backend. This is by design — one implementation of the agent, three surfaces (web UI, MCP server, this CLI).
  • No offline mode. Air-gapped deployments should run the backend Helm chart on-cluster and point the CLI at the internal service.
  • No secrets in the config file beyond what you put there. The api_token field is intentionally the only persisted credential.
  • No telemetry. The CLI does not phone home. Only the backend URL you configure is contacted.

License

Apache 2.0 — see LICENSE.

Metadata

Release files for kubeastra 0.2.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for kubeastra 0.2.3
File Size Uploaded
kubeastra-0.2.3.tar.gz 41.6 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for kubeastra 0.2.3
File Interpreter ABI Platform
kubeastra-0.2.3-py3-none-any.whl Python 3 none any Details

Total release size: 83.2 kB

Release files / kubeastra-0.2.3.tar.gz

Download URL kubeastra-0.2.3.tar.gz
Size 41.6 kB
Tags Source
SHA-256 checksum
How to use checksums
1eb1e485bbe44ee1661a912fe6204cf5a65eca8b3430658a6ebe716fa7307d76
BLAKE2b-256 checksum
How to use checksums
61db31b623b7051a1f61efd679930ffac52f103ddf3fceedca3a0d567a60e2ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release files / kubeastra-0.2.3-py3-none-any.whl

Download URL kubeastra-0.2.3-py3-none-any.whl
Size 41.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7cb4a6e1e2961716a6e481aa4b79712ead66239b5d5f0f1e17b5584eaf9f54dc
BLAKE2b-256 checksum
How to use checksums
f36229e125dd91a03d72d3704de18cfc3db61e318d290b8af47f0e1bb906f9f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 14, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.3 This release

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page