HostKit CLI
Python CLI for managing projects, services, and infrastructure on a HostKit VPS. Runs on the server and is called by the MCP server over SSH (or directly by operators).
Installation
Via bootstrap script (recommended)
The bootstrap script installs the CLI as part of full VPS setup:
curl -fsSL https://raw.githubusercontent.com/hostkit/hostkit/main/install/bootstrap.sh | bash
Via pip
pip install hostkit
From source
cd packages/cli
pip install -e .
Requirements
- Python 3.11+
- Ubuntu 22.04+ (server-side)
- PostgreSQL, Redis, nginx (installed by bootstrap)
Usage
# System overview
hostkit status
hostkit status --json
# Project lifecycle
hostkit project create myapp --python --with-db --with-auth
hostkit deploy myapp --install
hostkit rollback myapp
hostkit health myapp
# Services
hostkit auth enable myapp
hostkit payments enable myapp
hostkit sms enable myapp
hostkit chatbot enable myapp
hostkit minio enable myapp --public
# Database
hostkit db create myapp
hostkit db migrate myapp
hostkit backup create myapp --r2
# Operations
hostkit service logs myapp
hostkit env set myapp KEY=value
hostkit diagnose myapp
hostkit validate myapp
Every command supports --json for machine-readable output.
Command Reference
| Command | Description |
|---|---|
status |
System overview (projects, health, resources) |
project create |
Create a new project (Linux user, systemd service, port, nginx) |
project list |
List all projects |
deploy |
Deploy a project (install deps, swap symlink, restart) |
rollback |
Roll back to previous release |
health |
Health check a project |
diagnose |
Deep diagnostics (service, ports, logs, config) |
validate |
Pre-flight validation (entrypoint, deps, env, db) |
service |
Start, stop, restart, logs for project services |
env |
Get/set environment variables |
db |
Create, migrate, backup, restore databases |
backup |
Create and manage backups (local or R2) |
nginx |
Add domains, manage reverse proxy rules |
ssl |
Manage Let's Encrypt certificates |
auth |
Enable/configure OAuth + magic link auth service |
payments |
Enable/configure Stripe payments service |
sms |
Enable/configure Twilio SMS service |
chatbot |
Enable/configure AI chatbot service |
voice |
Enable/configure voice service |
booking |
Enable/configure booking service |
minio |
Enable/configure MinIO object storage |
r2 |
Manage Cloudflare R2 backups |
vector |
Enable/configure vector/RAG service |
mail |
Configure email services |
ratelimit |
Enable/disable deploy rate limiting |
capabilities |
List all available commands and services |
Configuration
The CLI reads configuration from /etc/hostkit/config.yaml:
domain: hostkit.dev
data_dir: /var/lib/hostkit
log_dir: /var/log/hostkit
backup_dir: /backups
Project layout on disk
Each project maps to:
/home/{project}/
├── releases/ # Timestamped deploys
├── app -> releases/x/ # Current release (symlink)
├── shared/ # Persistent data across deploys
├── .env # Environment variables
├── .auth/ # Auth service (if enabled)
├── .payments/ # Payments service (if enabled)
└── venv/ or node_modules/
Runtimes
| Flag | Entry point |
|---|---|
--python |
venv/bin/python -m app |
--node |
node app/index.js |
--nextjs |
npm start |
--static |
nginx serves directly |
Service port allocation
Each project gets a base port (starting at 8001). Services use offsets:
| Service | Offset | Example (base 8001) |
|---|---|---|
| Main app | +0 | 8001 |
| Auth | +1000 | 9001 |
| Payments | +2000 | 10001 |
| SMS | +3000 | 11001 |
| Booking | +4000 | 12001 |
| Chatbot | +5000 | 13001 |
Development
cd packages/cli
python3 -m venv venv
source venv/bin/activate
pip install -e ".[dev]"
# Lint
ruff check src/
# Type check
mypy src/hostkit/
# Test
pytest
To deploy changes to a live VPS:
VPS_HOST=root@YOUR_VPS_IP ./scripts/deploy.sh
Metadata
Release files for hostkit 0.2.33
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 | |
|---|---|---|---|---|
| hostkit-0.2.33.tar.gz | 431.7 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| hostkit-0.2.33-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 919.2 kB
Release files / hostkit-0.2.33.tar.gz
| Download URL | hostkit-0.2.33.tar.gz |
|---|---|
| Size | 431.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1aca4dc6052f046a60cb426d3600123270986a611b194a240ab146b286206dc5
|
|
BLAKE2b-256 checksum How to use checksums |
11572fc7f9dce4a020373513b73a7ed7998c1ac8301edb75fe20cad3ebf0e8a9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Release files / hostkit-0.2.33-py3-none-any.whl
| Download URL | hostkit-0.2.33-py3-none-any.whl |
|---|---|
| Size | 487.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
b241a65ce03e491e435c838e70132360406335695b459638d1447f3343f91d07
|
|
BLAKE2b-256 checksum How to use checksums |
5d5fda89d7610c99e2b61a5ddcf370cc803009518ab73cda644c0865c3108ddc
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.14.2
|
Security for hostkit 0.2.33
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.