CLI commands
ak content publish
Publish a post to a channel
ak content publish
Publish a post to a channel
Synopsis
What it does: Render a post body (direct text or a Go template) and publish it to the specified channel adapter (e.g. Discord). Validates the payload before any network I/O. Use --dry-run to preview without posting.
Who it's for: Both: power devs automating content pipelines (--json --dry-run) and non-technical users posting kit-generated content to Discord or other channels.
When to use it: Publishing release notes, changelogs, or agent-generated summaries to a channel. Use --dry-run to verify body and adapter before live posting.
Examples: ak content publish --channel discord --body "Hello world" --webhook-url https://... ak content publish --channel discord --template ./post.tmpl --vars '{"version":"1.0"}' ak content publish --channel discord --body "test" --dry-run ak content publish --channel discord --body "release" --json # JSON envelope
What changes on disk: Read-only (reads --template and --vars files). No local writes; posts to the channel API.
Output modes: pretty default on TTY (colors, ASCII markers) plain auto when stdout piped or --no-interactive json --json (single-object envelope, NDJSON-safe)
Exit codes: 0 success 1 runtime error 2 invalid flags 3 user-cancel (SIGINT, prompt-cancel) 2 missing or mutually exclusive flags (--body + --template) 3 validation failed or template rendering error
ak content publish [flags]Options
--at string Schedule the post for future delivery (RFC3339, e.g. 2026-04-27T10:00:00Z); enqueues instead of posting immediately
--body string Post body text (required unless --template is set)
--channel string Channel adapter to use (e.g. "discord") [required]
--dry-run Print the intended post and exit 0 without publishing
-h, --help help for publish
--json Emit machine-readable JSON (implies --no-interactive)
--no-interactive Disable interactive prompts (CI-safe)
-q, --quiet Suppress non-error output on stderr
--template string Path to a Go text/template file for the post body
--title string Optional post title (rendered adapter-specific)
--vars string Template variables as inline JSON ('{"key":"val"}') or @filepath
-V, --verbose Extra diagnostic output on stderr (loses to --quiet)
--webhook-url string Discord webhook URL (overrides config.yaml)
-y, --yes Assume yes for all promptsSEE ALSO
- ak content - Publish content to channels