A KubeSphere K8s CLI tool for viewing pods, logs, and deployment status
Project description
sj-k8s
A CLI tool for managing K8s clusters via KubeSphere API. Designed for environments where you only have KubeSphere web console access (no kubectl/SSH).
Features
- Auto login with KubeSphere's encrypted authentication (LDAP supported)
- Token caching — only re-authenticates when token expires
- Multi-cluster support with auto-discovery
- View pods, deployments, logs without kubectl access
Install
pip install sanjiu-k8s-cli
Configuration
Create ~/.k8s-cli:
KS_URL=https://your-kubesphere.example.com
KS_USER=your-username
KS_PASSWORD=your-password
Or use environment variables: KS_URL, KS_USER, KS_PASSWORD.
Usage
# Verify authentication
sj-k8s auth
# List clusters
sj-k8s clusters
# List pods (specify cluster with -c)
sj-k8s -c dev-local pods my-namespace
# Deployment status
sj-k8s -c dev-local status my-namespace my-deployment
# View logs
sj-k8s -c dev-local logs my-namespace my-pod -n 50
# Stream logs
sj-k8s -c dev-local logs my-namespace my-pod -f
# List deployments
sj-k8s -c dev-local deploys my-namespace
# Pod details
sj-k8s -c dev-local describe my-namespace my-pod
Claude Code Integration
This CLI is designed to be used with Claude Code as an AI-powered K8s operations assistant. A skill file is included in skill/SKILL.md — copy it to ~/.claude/skills/sj-k8s/SKILL.md to enable natural language K8s operations.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file sanjiu_k8s_cli-0.1.0.tar.gz.
File metadata
- Download URL: sanjiu_k8s_cli-0.1.0.tar.gz
- Upload date:
- Size: 9.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
490318efc6ed49b75971bcee52bff1b5d95e96ea010a9c7e5431ab13b25c5058
|
|
| MD5 |
8c3c89099381c33d535d136d9cc1cf9f
|
|
| BLAKE2b-256 |
d5ade1a92e78b010ce951effa13174eac739a14efe5eeeb289e763f4e5e3734e
|
File details
Details for the file sanjiu_k8s_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: sanjiu_k8s_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 9.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
75038795aa17cf3e0df8ca6ce39912b25fc626843a19f2cb0760dfe1c7863675
|
|
| MD5 |
b909fd7a72df87ec8a3b2939c6a56659
|
|
| BLAKE2b-256 |
3f7b4b0b30d48011584d03461f8abac8ddd93f95ba867a0089de4eafbe4c8da8
|