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.

7 functions 5 read 2 write Bearer token auth

Caddy CLI Setup

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

# 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 use the same stored profile from scripts, coding CLIs, Lua code mode, and the MCP gateway.

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

Call Caddy Headlessly

Use the generic call form when another coding CLI or script needs a stable universal interface.

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

Use the provider shortcut form for shorter human-facing commands.

kosmo integrations:caddy caddy_list_sites '{
  "page": 1,
  "per_page": 1
}' --json

Agent Discovery Commands

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

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

All CLI Functions

Every function below can be called headlessly. The generic form is stable across all integrations; the provider shortcut is shorter but specific to Caddy.

caddy.caddy_list_sites

Read read

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

Parameters
page, per_page

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

caddy.caddy_get_site

Read read

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

Parameters
site_id

Generic CLI call

kosmo integrations:call caddy.caddy_get_site '{"site_id":"example_site_id"}' --json

Provider shortcut

kosmo integrations:caddy caddy_get_site '{"site_id":"example_site_id"}' --json

caddy.caddy_create_site

Write write

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

Parameters
name, config

Generic CLI call

kosmo integrations:call caddy.caddy_create_site '{"name":"example_name","config":"example_config"}' --json

Provider shortcut

kosmo integrations:caddy caddy_create_site '{"name":"example_name","config":"example_config"}' --json

caddy.caddy_delete_site

Write write

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

Parameters
site_id

Generic CLI call

kosmo integrations:call caddy.caddy_delete_site '{"site_id":"example_site_id"}' --json

Provider shortcut

kosmo integrations:caddy caddy_delete_site '{"site_id":"example_site_id"}' --json

caddy.caddy_list_certificates

Read read

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

Parameters
page, per_page

Generic CLI call

kosmo integrations:call caddy.caddy_list_certificates '{"page":1,"per_page":1}' --json

Provider shortcut

kosmo integrations:caddy caddy_list_certificates '{"page":1,"per_page":1}' --json

caddy.caddy_get_certificate

Read read

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

Parameters
certificate_id

Generic CLI call

kosmo integrations:call caddy.caddy_get_certificate '{"certificate_id":"example_certificate_id"}' --json

Provider shortcut

kosmo integrations:caddy caddy_get_certificate '{"certificate_id":"example_certificate_id"}' --json

caddy.caddy_get_current_user

Read read

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

Parameters
none

Generic CLI call

kosmo integrations:call caddy.caddy_get_current_user '{}' --json

Provider 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

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

Operation
Read read
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

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

Operation
Read read
Schema command
kosmo integrations:schema caddy.caddy_get_site --json
ParameterTypeRequiredDescription
site_id string yes The site identifier.

caddy.caddy_create_site

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

Operation
Write write
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

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

Operation
Write write
Schema command
kosmo integrations:schema caddy.caddy_delete_site --json
ParameterTypeRequiredDescription
site_id string yes The site identifier to delete.

caddy.caddy_list_certificates

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

Operation
Read read
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

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

Operation
Read read
Schema command
kosmo integrations:schema caddy.caddy_get_certificate --json
ParameterTypeRequiredDescription
certificate_id string yes The certificate identifier.

caddy.caddy_get_current_user

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

Operation
Read read
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.