Traefik CLI is a lightweight command-line interface for interacting with a running Traefik instance over its HTTP API.
It supports listing routers, services, middlewares, and more, with output available in JSON or human-readable table formats.
Designed for self-hosters, DevOps engineers, and anyone who manages Traefik deployments.
- Clone this repository:
git clone https://github.com/scandora/traefik-cli.git
cd traefik-cli
- Create a virtual environment and activate it:
python3 -m venv .venv
source .venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
pip install -e .
Make sure you have your Traefik API accessible (usually on port 8080 or 8081 depending on configuration).
You can pass the Traefik API URL at runtime:
traefik-cli --url http://localhost:8081 http list-routers
Or set the environment variable:
export TRAEFIK_API_URL=http://localhost:8081
traefik-cli http list-routers
You can choose between:
- JSON (
--output json
) - Table (
--output table
)
Example:
traefik-cli --url http://localhost:8081 http list-routers --output table
MIT License