Development
Docker CLI
Container lifecycle, images, volumes and networks via Docker SDK
✓ 12 tests passed
Install
$ pip install cli-anything-docker
About
Manage Docker containers, images, volumes and networks programmatically using the Docker Python SDK. Run containers, stream logs, exec commands and monitor stats with structured JSON output.
Requirements
Docker daemon running, docker SDK
Command Reference
| Command | Arguments | Description |
|---|---|---|
detect |
Check Docker daemon connection | |
version |
Show Docker version info | |
container list |
--all |
List containers |
container run |
IMAGE --name N --env K=V --port H:C |
Run container |
container stop |
CONTAINER |
Stop container |
container logs |
CONTAINER --tail N |
Stream container logs |
container exec |
CONTAINER COMMAND |
Execute command in container |
image list |
List images | |
image pull |
IMAGE:TAG |
Pull image from registry |
volume list |
List volumes | |
network list |
List networks | |
system df |
Show disk usage |
Usage Examples
# Install
$ pip install cli-anything-docker
# Health check
$ docker-cli detect
# Get capabilities schema (Agent-ready, no token needed)
$ docker-cli schema
# Run with JSON output (for AI Agent integration)
$ docker-cli --json detect
# Example JSON response:
{"id":"abc123","name":"my-app","status":"running","image":"nginx:latest","ports":{"80/tcp":"8080"}}
Agent Integration
# Python — call from AI Agent
import subprocess, json
result = subprocess.run(
["docker-cli", "--json", "detect"],
capture_output=True, text=True
)
data = json.loads(result.stdout)
print(data)
# Discover all commands without credentials:
schema = subprocess.run(
["docker-cli", "schema"],
capture_output=True, text=True
)
capabilities = json.loads(schema.stdout)