Managing resources

Commands for managing all Knock resources at once.

#

These commands enable you to manage all Knock resources (workflows, partials, email layouts, translations, guides, and message-types) at once.

knock init [flags]

#

Initializes a new Knock project by creating a knock.json file in the current working directory.

Flags

--knock-dirdirectory

Optional target directory path to point the Knock CLI to. When not provided, the CLI will prompt you for a directory path.

knock pull [flags]

#

Pulls the contents of all Knock resources (workflows, partials, email layouts, translations, guides, and message-types) from Knock into your local file system.

Resources will be grouped by resource type within subdirectories of the target directory path set either by your knock.json file or by the --knock-dir flag. See the Directory structure section for details on the directory structure used by push and pull commands.

Flags

--environmentstring

The environment to use. Defaults to development.

--branchstring

The branch to use. Defaults to empty (the main branch).

--knock-dirdirectory

The target directory path to pull all resources into.

--hide-uncommitted-changesboolean

Should any uncommitted changes be hidden? Defaults to false.

--forceboolean

Removes the confirmation prompt. Defaults to false.

knock push [flags]

#

Pushes all local resource files (workflows, partials, email layouts, and translations) back to Knock and upserts them.

Resources will be pushed to the target directory path set either by your knock.json file or by the --knock-dir flag. See the Directory structure section for details on the directory structure used by push and pull commands.

Flags

--knock-dirdirectory

The target directory path to push all resources from.

--commitboolean

Push and commit at the same time. Defaults to false.

-m, --commit-messagestring

The commit message to pass when using the --commit flag.

New chat