AgentKit
ReferenceCLI commands
BetaYou are reading docs for the beta channel (2.4.1-beta.1) — updated automatically on every beta release.Switch to stable →

CLI commands

ak content publish

Publish a post to a channel

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.

What changes on disk: Read-only (reads --template and --vars files). No local writes; posts to the channel API.

Usage

ak content publish [flags]

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

Flags

FlagDescription
--at stringSchedule the post for future delivery (RFC3339, e.g. 2026-04-27T10:00:00Z); enqueues instead of posting immediately
--body stringPost body text (required unless --template is set)
--channel stringChannel adapter to use (e.g. "discord") [required]
--dry-runPrint the intended post and exit 0 without publishing
-h, --helphelp for publish
--jsonEmit machine-readable JSON (implies --no-interactive)
--no-interactiveDisable interactive prompts (CI-safe)
-q, --quietSuppress non-error output on stderr
--template stringPath to a Go text/template file for the post body
--title stringOptional post title (rendered adapter-specific)
--vars stringTemplate variables as inline JSON ('{"key":"val"}') or @filepath
-V, --verboseExtra diagnostic output on stderr (loses to --quiet)
--webhook-url stringDiscord webhook URL (overrides config.yaml)
-y, --yesAssume yes for all prompts

Output modes

ModeBehavior
prettydefault on TTY (colors, ASCII markers)
plainauto when stdout piped or --no-interactive
json--json (single-object envelope, NDJSON-safe)

Exit codes

CodeMeaning
0success
1runtime error
2invalid flags
3user-cancel (SIGINT, prompt-cancel)
2missing or mutually exclusive flags (--body + --template)
3validation failed or template rendering error

On this page