Infra CLI
Infrastructure services management CLI and TUI.
What is Infra CLI?
Infra CLI is a Python package that manages Docker Compose services. It works with service definitions stored in /opt/infra-services/.
Installation
pip install infra-cli
Or for development:
git clone https://github.com/metrotelinc/weaverbird-infra.git
cd weaverbird-infra
pip install -e .
Quick Start
# Launch the TUI
infra
# Or use CLI commands directly
infra status
infra start traefik
infra cloudflare list-tokens
Directory Structure
# Development (your machine)
weaverbird-infra/ # Git repo (Python code)
├── infra/ # Python package
├── pyproject.toml
└── README.md
# Production (servers)
/opt/infra-services/ # Docker Compose files
├── services/
│ ├── traefik/
│ ├── wireguard/
│ └── mqtt/
/etc/infra/ # Configuration & secrets
├── infra.env # Environment variables
└── cloudflare.json # API tokens
Features
- Docker Service Management: Start, stop, restart, and view logs for services
- Cloudflare DNS Integration: Manage DNS records across multiple accounts/tokens
- User Management: Manage the
infra-usersgroup for multi-admin access - System Info: View disk, memory, CPU, uptime, and load
- Terminal UI: Interactive TUI for easy management
- Dynamic Service Discovery: Automatically finds all services in
/opt/infra-services/services/
Configuration
Configuration is stored in /etc/infra/:
Environment Variables (/etc/infra/infra.env)
CLOUDFLARE_API_TOKEN=your_token_here
CLOUDFLARE_EMAIL=your@email.com
TRAEFIK_DOMAIN=example.com
WG_HOST=vpn.example.com
WG_PORT=51820
MOSQUITTO_USERNAME=admin
MOSQUITTO_PASSWORD=changeme
Cloudflare Tokens (/etc/infra/cloudflare.json)
infra cloudflare add-token personal
Managing Services
Adding a New Service
-
Create service directory:
mkdir -p /opt/infra-services/services/my-service
-
Add docker-compose.yml:
nano /opt/infra-services/services/my-service/docker-compose.yml -
Service is automatically available:
infra status # Shows "my-service" infra start my-service
Service Discovery
Infra automatically discovers services from /opt/infra-services/services/:
- Flat:
services/traefik/docker-compose.yml→traefik - Nested:
services/project/dev/docker-compose.yml→project/dev - Multiple:
services/app/docker-compose.yml+docker-compose.prod.yml
Disabling a Service
# Stop it
infra stop my-service
# Or rename the file
mv /opt/infra-services/services/my-service/docker-compose.yml \
/opt/infra-services/services/my-service/docker-compose.yml.disabled
Uninstall
infra uninstall
This will:
- Stop all managed Docker services
- Remove the
infra-usersgroup - Remove configuration from
/etc/infra/ - Uninstall the Python package
Note: Docker service files remain in /opt/infra-services/. To remove them:
sudo rm -rf /opt/infra-services
License
Apache License 2.0 - See LICENSE for details.
Metadata
Release files for infra-services 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 | |
|---|---|---|---|---|
| infra_services-0.1.0.tar.gz | 67.8 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| infra_services-0.1.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 147.5 kB
Release files / infra_services-0.1.0.tar.gz
| Download URL | infra_services-0.1.0.tar.gz |
|---|---|
| Size | 67.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ac176e130f1aa675792aa51d57ecbf9cebf911282b121c27bd8cdab6df60aec4
|
|
BLAKE2b-256 checksum How to use checksums |
9f0d628559de553b4911c72dcf25aab64df8494f8b65e56420b10bfc4ef12e1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Release files / infra_services-0.1.0-py3-none-any.whl
| Download URL | infra_services-0.1.0-py3-none-any.whl |
|---|---|
| Size | 79.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
f1bd7fab453f779a1a28071427f7d6a36fb13a60d9b4546a8ff2cecba8ee32b9
|
|
BLAKE2b-256 checksum How to use checksums |
a81478701199d366ef4bc3a30925ef65649dfb7dd3b059b3d48cfdd6d0d8c468
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
Security for infra-services 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.