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
Metadata
Release files for sanjiu-k8s-cli 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| sanjiu_k8s_cli-0.1.0.tar.gz | 9.9 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| sanjiu_k8s_cli-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.2 kB
Release files / sanjiu_k8s_cli-0.1.0.tar.gz
| Download URL | sanjiu_k8s_cli-0.1.0.tar.gz |
|---|---|
| Size | 9.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
490318efc6ed49b75971bcee52bff1b5d95e96ea010a9c7e5431ab13b25c5058
|
|
BLAKE2b-256 checksum How to use checksums |
d5ade1a92e78b010ce951effa13174eac739a14efe5eeeb289e763f4e5e3734e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|
Release files / sanjiu_k8s_cli-0.1.0-py3-none-any.whl
| Download URL | sanjiu_k8s_cli-0.1.0-py3-none-any.whl |
|---|---|
| Size | 9.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
75038795aa17cf3e0df8ca6ce39912b25fc626843a19f2cb0760dfe1c7863675
|
|
BLAKE2b-256 checksum How to use checksums |
3f7b4b0b30d48011584d03461f8abac8ddd93f95ba867a0089de4eafbe4c8da8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.11.3
|
Security for sanjiu-k8s-cli 0.1.0
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.