KosmoKrator

productivity

Caddy CLI for AI Agents

Use the Caddy CLI from KosmoKrator to call Caddy tools headlessly, return JSON, inspect schemas, and automate workflows from coding agents, scripts, and CI.

Caddy CLI Setup

Caddy can be configured headlessly with `kosmokrator integrations:configure caddy`.

Install, configure, and verify
# Install KosmoKrator first if it is not available on PATH.
curl -fsSL https://raw.githubusercontent.com/OpenCompanyApp/kosmokrator/main/install.sh | bash

# Configure and verify this integration.
kosmokrator integrations:configure caddy --set access_token="$CADDY_ACCESS_TOKEN" --enable --read allow --write ask --json
kosmokrator integrations:doctor caddy --json
kosmokrator integrations:status --json

Credentials

Authentication type: Bearer token bearer_token. Configure credentials once, then reuse the same stored profile from scripts, coding CLIs, Lua, and MCP.

KeyEnv varTypeRequiredLabel
access_token CADDY_ACCESS_TOKEN Secret secret yes API Token
url CADDY_URL URL url no API Base URL

Command Patterns

The generic command is stable across every integration. The provider shortcut is shorter for humans.

Generic CLI call
kosmo integrations:call caddy.caddy_list_sites '{"page":1,"per_page":1}' --json
Provider shortcut
kosmo integrations:caddy caddy_list_sites '{"page":1,"per_page":1}' --json

Discovery

These commands return structured output for coding agents that need to inspect capabilities before choosing a function.

Discovery commands
kosmo integrations:docs caddy --json
kosmo integrations:docs caddy.caddy_list_sites --json
kosmo integrations:schema caddy.caddy_list_sites --json
kosmo integrations:search "Caddy" --json
kosmo integrations:list --json

Automation Contexts

The same configured command surface works in these environments. The command does not change unless the host wrapper, credentials, or permissions change.

CLI Functions

Every function below can be called headlessly. Commands are highlighted, copyable, and scroll horizontally when payloads are long.

caddy.caddy_list_sites

List all Caddy sites. Returns site IDs, domain names, status, and configuration details.

Read read
Parameters
page, per_page
Generic call
kosmo integrations:call caddy.caddy_list_sites '{"page":1,"per_page":1}' --json
Shortcut
kosmo integrations:caddy caddy_list_sites '{"page":1,"per_page":1}' --json

caddy.caddy_get_site

Get detailed information about a specific Caddy site, including its configuration, domain, and status.

Read read
Parameters
site_id
Generic call
kosmo integrations:call caddy.caddy_get_site '{"site_id":"example_site_id"}' --json
Shortcut
kosmo integrations:caddy caddy_get_site '{"site_id":"example_site_id"}' --json

caddy.caddy_create_site

Create a new site in Caddy. Specify the domain name and optional configuration parameters.

Write write
Parameters
name, config
Generic call
kosmo integrations:call caddy.caddy_create_site '{"name":"example_name","config":"example_config"}' --json
Shortcut
kosmo integrations:caddy caddy_create_site '{"name":"example_name","config":"example_config"}' --json

caddy.caddy_delete_site

Delete a site from Caddy. This action is irreversible and will remove the site and its configuration.

Write write
Parameters
site_id
Generic call
kosmo integrations:call caddy.caddy_delete_site '{"site_id":"example_site_id"}' --json
Shortcut
kosmo integrations:caddy caddy_delete_site '{"site_id":"example_site_id"}' --json

caddy.caddy_list_certificates

List all TLS certificates managed by Caddy. Returns certificate IDs, domains, expiry dates, and status.

Read read
Parameters
page, per_page
Generic call
kosmo integrations:call caddy.caddy_list_certificates '{"page":1,"per_page":1}' --json
Shortcut
kosmo integrations:caddy caddy_list_certificates '{"page":1,"per_page":1}' --json

caddy.caddy_get_certificate

Get detailed information about a specific TLS certificate, including domain, issuer, validity, and SANs.

Read read
Parameters
certificate_id
Generic call
kosmo integrations:call caddy.caddy_get_certificate '{"certificate_id":"example_certificate_id"}' --json
Shortcut
kosmo integrations:caddy caddy_get_certificate '{"certificate_id":"example_certificate_id"}' --json

caddy.caddy_get_current_user

Get details of the currently authenticated Caddy user. Returns user ID, email, username, and account info.

Read read
Parameters
none
Generic call
kosmo integrations:call caddy.caddy_get_current_user '{}' --json
Shortcut
kosmo integrations:caddy caddy_get_current_user '{}' --json

Function Schemas

Use these parameter tables when building CLI payloads without calling integrations:schema first.

caddy.caddy_list_sites 2 parameters
Schema command
kosmo integrations:schema caddy.caddy_list_sites --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of sites per page (default: 20).
caddy.caddy_get_site 1 parameters
Schema command
kosmo integrations:schema caddy.caddy_get_site --json
ParameterTypeRequiredDescription
site_id string yes The site identifier.
caddy.caddy_create_site 2 parameters
Schema command
kosmo integrations:schema caddy.caddy_create_site --json
ParameterTypeRequiredDescription
name string yes The domain name for the site (e.g., "example.com").
config object no Optional site configuration (Caddy JSON config or key-value pairs).
caddy.caddy_delete_site 1 parameters
Schema command
kosmo integrations:schema caddy.caddy_delete_site --json
ParameterTypeRequiredDescription
site_id string yes The site identifier to delete.
caddy.caddy_list_certificates 2 parameters
Schema command
kosmo integrations:schema caddy.caddy_list_certificates --json
ParameterTypeRequiredDescription
page integer no Page number for pagination (default: 1).
per_page integer no Number of certificates per page (default: 20).
caddy.caddy_get_certificate 1 parameters
Schema command
kosmo integrations:schema caddy.caddy_get_certificate --json
ParameterTypeRequiredDescription
certificate_id string yes The certificate identifier.
caddy.caddy_get_current_user 0 parameters
Schema command
kosmo integrations:schema caddy.caddy_get_current_user --json
ParameterTypeRequiredDescription
No parameters.

Permissions

Headless calls still follow the integration read/write permission policy. Configure read/write defaults with integrations:configure. Add --force only for trusted automation that should bypass that policy.