with one click
knock-cli
// Guidelines for working with the Knock CLI to manage workflows, templates, and other notification resources in a Knock project.
// Guidelines for working with the Knock CLI to manage workflows, templates, and other notification resources in a Knock project.
| name | knock-cli |
| description | Guidelines for working with the Knock CLI to manage workflows, templates, and other notification resources in a Knock project. |
This skill provides comprehensive guidelines for working with the Knock CLI to manage workflows, templates, and other notification resources.
The Knock CLI skill includes detailed rule sets covering:
When setting up a new project with Knock:
Start with installation and authentication (rules/cli-installation-authentication.md)
knock initUnderstand the directory structure (rules/knock-directory-structure.md)
When working with Knock resources:
Use the CLI commands reference (rules/cli-commands-reference.md)
Follow workflow and template guidelines (rules/workflow-templates.md)
When working with in-app guides (banners, modals, announcements):
Start with guides and message types (rules/guides-and-message-types.md)
schema_key and schema_variant_keyDiscover before creating
knock message-type list to see available message type keysknock guide list to see existing guidesWhen building reusable email components (callouts, quote blocks, comment cards):
Start with partials (rules/partials.md)
partial.json schemainput_schema for block editor fields (same format as message type variant fields)visual_block_enabled: true for partials that appear in the email visual block editorCreate and push
knock partial new -k <key> -n "Name" -t html --force to scaffoldinput_schema and edit content; validate and push with knock partial push <key>When making changes to workflows or templates:
data for trigger payload, vars for environment variablesknock workflow push <key> (or the equivalent for other resource types) for changes to take effect.rules/cli-installation-authentication.md - Installation and authentication setuprules/knock-directory-structure.md - Directory structure and configurationrules/cli-commands-reference.md - CLI commands for resource managementrules/workflow-templates.md - Workflow and template structures and best practicesrules/guides-and-message-types.md - Guides and message types for lifecycle messagingrules/partials.md - Partials and reusable template building blocks# Initialize a new project (interactive; use --knock-dir to skip prompts)
knock init --knock-dir=./knock
# Pull all resources from Knock (--force skips confirmation prompts)
knock pull --all --force
# Pull a specific workflow
knock workflow pull <workflow-key> --force
# Push all resources to Knock (push never prompts)
knock push --all
# Push a specific workflow
knock workflow push <workflow-key>
# Push a specific email layout
knock email-layout push <layout-key>
# List channels (discover valid channel_key values before creating workflows)
knock channel list
# Guide and message type commands
knock message-type list # Discover message type keys before creating guides
knock guide list # List existing guides
knock guide push <guide-key> # Push a guide after modifying
knock message-type push <key> # Push a message type after modifying
# Partial commands (email design system building blocks)
knock partial list # List existing partials
knock partial new -k <key> -n "Name" -t html --force # Create a new partial
knock partial pull <key> --force # Pull a partial from Knock
knock partial push <key> # Push a partial after modifying
knock partial validate <key> # Validate a partial locally
data (trigger payload), vars (environment variables), recipient, actor, tenant--force on commands with prompts - Many CLI commands (pull, commit, promote, activate) display interactive confirmation prompts. Always pass --force to skip them in automated/agent contexts.@ suffix: "content@": "visual_blocks/1.content.md"data. for trigger payload values, not vars.knock channel list to get valid channel_key valuesknock message-type list to get valid message type keysdata for dynamic payload, vars for environment constants