@knocklabs/cli
v1.6.3
Published
Knock CLI
Readme
@knocklabs/cli
A command-line interface for interacting with Knock.
Requires Node.js >= 24.
Usage
$ npm install -g @knocklabs/cli
$ knock COMMAND
running command...
$ knock (--version)
@knocklabs/cli/1.6.3 linux-x64 node-v26.13.0
$ knock --help [COMMAND]
USAGE
$ knock COMMAND
...Commands
knock agent [PROMPT]knock asset archive ASSETIDknock asset upload FILEknock audience archive AUDIENCEKEYknock audience get AUDIENCEKEYknock audience listknock audience newknock audience open AUDIENCEKEYknock audience pull [AUDIENCEKEY]knock audience push [AUDIENCEKEY]knock audience validate [AUDIENCEKEY]knock branch create [SLUG]knock branch delete SLUGknock branch exitknock branch listknock branch merge SLUGknock branch rebase SLUGknock branch switch SLUGknock broadcast get BROADCASTKEYknock broadcast listknock broadcast newknock broadcast open BROADCASTKEYknock broadcast pull [BROADCASTKEY]knock broadcast push [BROADCASTKEY]knock broadcast run BROADCASTKEYknock broadcast send BROADCASTKEYknock broadcast validate [BROADCASTKEY]knock channel listknock commitknock commit get IDknock commit listknock commit promoteknock environment listknock goal archive GOALKEYknock goal clone GOALKEY NEWGOALKEYknock goal get GOALKEYknock goal listknock goal new GOALKEYknock goal open GOALKEYknock goal pull [GOALKEY]knock goal push [GOALKEY]knock goal validate [GOALKEY]knock guide activate GUIDEKEYknock guide generate-typesknock guide get GUIDEKEYknock guide listknock guide newknock guide open GUIDEKEYknock guide pull [GUIDEKEY]knock guide push [GUIDEKEY]knock guide validate [GUIDEKEY]knock help [COMMAND]knock initknock layout get EMAILLAYOUTKEYknock layout listknock layout newknock layout open LAYOUTKEYknock layout pull [EMAILLAYOUTKEY]knock layout push [EMAILLAYOUTKEY]knock layout validate [EMAILLAYOUTKEY]knock loginknock logoutknock message-type get MESSAGETYPEKEYknock message-type listknock message-type newknock message-type open MESSAGETYPEKEYknock message-type pull [MESSAGETYPEKEY]knock message-type push [MESSAGETYPEKEY]knock message-type validate [MESSAGETYPEKEY]knock partial get PARTIALKEYknock partial listknock partial newknock partial open PARTIALKEYknock partial pull [PARTIALKEY]knock partial push [PARTIALKEY]knock partial validate [PARTIALKEY]knock pullknock pushknock reusable-request archive REUSABLEREQUESTKEYknock reusable-request get REUSABLEREQUESTKEYknock reusable-request listknock reusable-request newknock reusable-request pull [REUSABLEREQUESTKEY]knock reusable-request push [REUSABLEREQUESTKEY]knock reusable-request validate [REUSABLEREQUESTKEY]knock schema pull [ITEMTYPE]knock schema push [ITEMTYPE]knock source get SOURCEKEYknock source listknock translation get TRANSLATIONREFknock translation listknock translation pull [TRANSLATIONREF]knock translation push [TRANSLATIONREF]knock translation validate [TRANSLATIONREF]knock variable delete KEYknock variable get KEYknock variable listknock variable newknock variable pull [KEY]knock variable push [KEY]knock variable set KEYknock warehouse-sync get WAREHOUSESYNCKEYknock warehouse-sync listknock warehouse-sync open WAREHOUSESYNCKEYknock warehouse-sync pull [WAREHOUSESYNCKEY]knock warehouse-sync push [WAREHOUSESYNCKEY]knock warehouse-sync run WAREHOUSESYNCKEYknock warehouse-sync runs WAREHOUSESYNCKEYknock warehouse-sync validate [WAREHOUSESYNCKEY]knock warehouse get WAREHOUSEKEYknock warehouse listknock whoamiknock workflow activate WORKFLOWKEYknock workflow generate-typesknock workflow get WORKFLOWKEYknock workflow listknock workflow newknock workflow open WORKFLOWKEYknock workflow pull [WORKFLOWKEY]knock workflow push [WORKFLOWKEY]knock workflow run WORKFLOWKEYknock workflow validate [WORKFLOWKEY]
knock agent [PROMPT]
Run a prompt with the Knock agent in your account.
USAGE
$ knock agent [PROMPT] [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
[--session <value>] [--response-only] [--timeout <value>]
ARGUMENTS
PROMPT The prompt to run, or - to read it from stdin. Leave it out in a terminal to chat with the agent.
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--response-only Print only the agent's response, once it finishes, instead of its activity as it happens.
--service-token=<value> The service token to authenticate with.
--session=<value> The ID of an agent session to follow up in, or its dashboard URL. Stays in the session's
environment or branch unless --environment or --branch is passed.
--timeout=<value> [default: 1800] Seconds to wait for the agent to finish. The agent keeps running after this.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Run a prompt with the Knock agent in your account.
Starts a new agent session and shows what the agent is doing as it happens. The agent can read and change resources in
your account.
Run it in a terminal without a prompt to chat with the agent: it waits for your next prompt each time it finishes.
Press Esc or Ctrl-C to stop the agent mid-run, and Ctrl-D or /exit to quit.
Pass --session with the ID of an earlier session to follow up in it. The agent keeps what it knows from that session,
and works in the same environment or branch unless you pass --environment or --branch.
Pass - as the prompt to read it from stdin. Put -- first if the prompt itself starts with a dash. Pass --response-only
to print only the agent's response, once it finishes.
EXAMPLES
$ knock agent "Add an email step to the welcome workflow"
$ knock agent
cat prompt.txt | knock agent -
$ knock agent "Add a new-user guide" --response-only --branch my-feature
$ knock agent --session 3f2a6c1e-8b4d-4f7a-9c2e-5d1b0a7e6f43 "Now shorten the subject line"
$ knock agent --session 3f2a6c1e-8b4d-4f7a-9c2e-5d1b0a7e6f43
$ knock agent -- "- Add an email step"See code: src/commands/agent.ts
knock asset archive ASSETID
Archive an asset.
USAGE
$ knock asset archive ASSETID [--json] [--service-token <value>] [--force]
ARGUMENTS
ASSETID The id of the asset to archive.
FLAGS
--force Skip confirmation prompt.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Archive an asset.
Archives an asset for the account.
Assets are account-wide. This command does not take an environment or branch.See code: src/commands/asset/archive.ts
knock asset upload FILE
Upload a file into the account as an asset.
USAGE
$ knock asset upload FILE [--json] [--service-token <value>] [--filename <value>] [--mime-type
image/jpeg|image/png|image/gif]
ARGUMENTS
FILE Path to the file to upload, or - to read stdin.
FLAGS
--filename=<value> Display name for the asset. Defaults to the file's basename. Required when reading stdin.
--mime-type=<option> MIME type override. One of image/jpeg, image/png, or image/gif.
<options: image/jpeg|image/png|image/gif>
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Upload a file into the account as an asset.
Reads a file, uploads the bytes, and records the asset.
Pass - to read the file from stdin. Stdin requires --filename.
Assets are account-wide. This command does not take an environment or branch.See code: src/commands/asset/upload.ts
knock audience archive AUDIENCEKEY
Archive an audience (affects ALL environments).
USAGE
$ knock audience archive AUDIENCEKEY --environment <value> [--service-token <value>] [--branch <value>] [--force]
ARGUMENTS
AUDIENCEKEY The key of the audience to archive.
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> (required) The environment to use.
--force Skip confirmation prompt.
--service-token=<value> The service token to authenticate with.
DESCRIPTION
Archive an audience (affects ALL environments).
WARNING: Archiving an audience affects ALL environments and cannot be undone.
Use this command with caution.See code: src/commands/audience/archive.ts
knock audience get AUDIENCEKEY
Display a single audience from an environment.
USAGE
$ knock audience get AUDIENCEKEY [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
[--hide-uncommitted-changes]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/audience/get.ts
knock audience list
Display all audiences for an environment.
USAGE
$ knock audience list [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
[--hide-uncommitted-changes] [--after <value>] [--before <value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--limit=<value> The total number of entries to fetch per page.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/audience/list.ts
knock audience new
Create a new audience with a minimal configuration.
USAGE
$ knock audience new [--service-token <value>] [-n <value>] [-k <value>] [-t static|dynamic] [-d <value>]
[--environment <value>] [--branch <value>] [--force] [-p]
FLAGS
-d, --description=<value> The description of the audience
-k, --key=<value> The key of the audience
-n, --name=<value> The name of the audience
-p, --push Whether or not to push the audience to Knock after creation.
-t, --type=<option> The type of the audience (static, dynamic).
<options: static|dynamic>
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Force the creation of the audience directory without confirmation.
--service-token=<value> The service token to authenticate with.See code: src/commands/audience/new.ts
knock audience open AUDIENCEKEY
Open an audience in the Knock dashboard.
USAGE
$ knock audience open AUDIENCEKEY [--service-token <value>] [--environment <value>] [--branch <value>]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/audience/open.ts
knock audience pull [AUDIENCEKEY]
Pull one or more audiences from an environment into a local file system.
USAGE
$ knock audience pull [AUDIENCEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--audiences-dir <value> --all] [--hide-uncommitted-changes] [--force]
FLAGS
--all Whether to pull all audiences from the specified environment.
--audiences-dir=<value> The target directory path to pull all audiences into.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--hide-uncommitted-changes Hide any uncommitted changes.
--service-token=<value> The service token to authenticate with.See code: src/commands/audience/pull.ts
knock audience push [AUDIENCEKEY]
Push one or more audiences from a local file system to Knock.
USAGE
$ knock audience push [AUDIENCEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--audiences-dir <value> --all] [-m <value> --commit] [--force]
FLAGS
-m, --commit-message=<value> Use the given value as the commit message
--all Whether to push all audiences from the target directory.
--audiences-dir=<value> The target directory path to find all audiences to push.
--branch=<value> The slug of the branch to use.
--commit Push and commit the audience(s) at the same time
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Force pushes the resource or resources to Knock, overwriting whatever is currently
stored. If you're using this on a non-development environment, you should also ensure
you `commit` the changes.
--service-token=<value> The service token to authenticate with.See code: src/commands/audience/push.ts
knock audience validate [AUDIENCEKEY]
Validate one or more audiences from a local file system.
USAGE
$ knock audience validate [AUDIENCEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--audiences-dir <value> --all]
FLAGS
--all Whether to validate all audiences from the target directory.
--audiences-dir=<value> The target directory path to find all audiences to validate.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/audience/validate.ts
knock branch create [SLUG]
Creates a new branch off of the development environment.
USAGE
$ knock branch create [SLUG] [--json] [--service-token <value>]
ARGUMENTS
SLUG The slug for the new branch
FLAGS
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/branch/create.ts
knock branch delete SLUG
Deletes an existing branch with the given slug.
USAGE
$ knock branch delete SLUG [--service-token <value>] [--force]
ARGUMENTS
SLUG The slug of the branch to delete
FLAGS
--force Remove the confirmation prompt.
--service-token=<value> The service token to authenticate with.See code: src/commands/branch/delete.ts
knock branch exit
Exits the current branch.
USAGE
$ knock branch exit [--service-token <value>]
FLAGS
--service-token=<value> The service token to authenticate with.See code: src/commands/branch/exit.ts
knock branch list
Display all existing branches off of the development environment.
USAGE
$ knock branch list [--json] [--service-token <value>] [--after <value>] [--before <value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--limit=<value> The total number of entries to fetch per page.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/branch/list.ts
knock branch merge SLUG
Merges a branch into the development environment.
USAGE
$ knock branch merge SLUG [--service-token <value>] [--force] [--delete]
ARGUMENTS
SLUG The slug of the branch to merge
FLAGS
--[no-]delete Delete the branch after merging.
--force Remove the confirmation prompt.
--service-token=<value> The service token to authenticate with.See code: src/commands/branch/merge.ts
knock branch rebase SLUG
Rebases a branch onto the development environment, bringing in changes from main while preserving branch commits.
USAGE
$ knock branch rebase SLUG [--json] [--service-token <value>] [--force]
ARGUMENTS
SLUG The slug of the branch to rebase
FLAGS
--force Remove the confirmation prompt.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/branch/rebase.ts
knock branch switch SLUG
Switches to an existing branch with the given slug.
USAGE
$ knock branch switch SLUG [--service-token <value>] [--create] [--force]
ARGUMENTS
SLUG The slug of the branch to switch to
FLAGS
--create Create the branch if it doesn't yet exist.
--force Remove the confirmation prompt.
--service-token=<value> The service token to authenticate with.See code: src/commands/branch/switch.ts
knock broadcast get BROADCASTKEY
Display a single broadcast from an environment.
USAGE
$ knock broadcast get BROADCASTKEY [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/broadcast/get.ts
knock broadcast list
Display all broadcasts for an environment.
USAGE
$ knock broadcast list [--json] [--service-token <value>] [--environment <value>] [--branch <value>] [--after
<value>] [--before <value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--limit=<value> The total number of entries to fetch per page.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/broadcast/list.ts
knock broadcast new
Create a new broadcast with a minimal configuration.
USAGE
$ knock broadcast new [--service-token <value>] [-n <value>] [-k <value>] [-s <value>] [--force]
FLAGS
-k, --key=<value> The key of the broadcast
-n, --name=<value> The name of the broadcast
-s, --steps=<value> Comma-separated list of channel step types to include in the broadcast (e.g.
email,in_app_feed). Broadcasts need at least one channel step.
--force Force the creation of the broadcast directory without confirmation.
--service-token=<value> The service token to authenticate with.See code: src/commands/broadcast/new.ts
knock broadcast open BROADCASTKEY
Open a broadcast in the Knock dashboard.
USAGE
$ knock broadcast open BROADCASTKEY [--service-token <value>] [--environment <value>] [--branch <value>]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/broadcast/open.ts
knock broadcast pull [BROADCASTKEY]
Pull one or more broadcasts from an environment into a local file system.
USAGE
$ knock broadcast pull [BROADCASTKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--broadcasts-dir <value> --all] [--force]
FLAGS
--all Whether to pull all broadcasts from the specified environment.
--branch=<value> The slug of the branch to use.
--broadcasts-dir=<value> The target directory path to pull all broadcasts into.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--service-token=<value> The service token to authenticate with.See code: src/commands/broadcast/pull.ts
knock broadcast push [BROADCASTKEY]
Push one or more broadcasts from a local file system to Knock.
USAGE
$ knock broadcast push [BROADCASTKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--broadcasts-dir <value> --all]
FLAGS
--all Whether to push all broadcasts from the target directory.
--branch=<value> The slug of the branch to use.
--broadcasts-dir=<value> The target directory path to find all broadcasts to push.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/broadcast/push.ts
knock broadcast run BROADCASTKEY
Test run a broadcast for one recipient without publishing it.
USAGE
$ knock broadcast run BROADCASTKEY --recipient <value> [--json] [--service-token <value>] [--environment <value>]
[--branch <value>] [--tenant <value>] [--sandbox-mode] [--skip-delay]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--recipient=<value> (required) The user id to run this broadcast for.
--sandbox-mode When enabled, channels generate messages but don't send them to the downstream provider.
--service-token=<value> The service token to authenticate with.
--skip-delay When enabled, delay steps in this broadcast will be skipped.
--tenant=<value> A tenant id for the broadcast run.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Test run a broadcast for one recipient without publishing it.
Runs the current version of a broadcast for a single recipient. This does not
publish the broadcast or message its target audience. Use --sandbox-mode to
generate messages without sending them to downstream providers.See code: src/commands/broadcast/run.ts
knock broadcast send BROADCASTKEY
Send or schedule a broadcast in a given environment.
USAGE
$ knock broadcast send BROADCASTKEY --environment <value> [--json] [--service-token <value>] [--branch <value>]
[--send-at <value>] [--force]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> (required) The environment to use.
--force Remove the confirmation prompt.
--send-at=<value> ISO 8601 datetime to schedule the broadcast. Omit to send immediately.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
Send or schedule a broadcast in a given environment.
Sends a broadcast immediately or schedules it for a future time. Use the
--send-at flag to schedule the broadcast for a specific time.See code: src/commands/broadcast/send.ts
knock broadcast validate [BROADCASTKEY]
Validate one or more broadcasts from a local file system.
USAGE
$ knock broadcast validate [BROADCASTKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--broadcasts-dir <value> --all]
FLAGS
--all Whether to validate all broadcasts from the target directory.
--branch=<value> The slug of the branch to use.
--broadcasts-dir=<value> The target directory path to find all broadcasts to validate.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/broadcast/validate.ts
knock channel list
Display all channels configured for the account.
USAGE
$ knock channel list [--json] [--service-token <value>]
FLAGS
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/channel/list.ts
knock commit
Commit all changes in an environment, or only changes for a specific resource type.
USAGE
$ knock commit [--service-token <value>] [--environment <value>] [--branch <value>] [-m <value>] [--force]
[--allow-empty] [--resource-type
audience|partial|email_layout|reusable_request|workflow|message_type|guide|translation] [--resource-id <value>]
FLAGS
-m, --commit-message=<value> Use the given value as the commit message.
--allow-empty Create an empty commit for an already-published resource (analogous to git commit
--allow-empty). Requires --resource-type and --resource-id.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--resource-id=<value> Commit only changes for the given resource identifier. Must be used together with
--resource-type.
--resource-type=<option> Commit only changes for the given resource type. Can be used alone or together with
--resource-id.
<options:
audience|partial|email_layout|reusable_request|workflow|message_type|guide|translation>
--service-token=<value> The service token to authenticate with.See code: src/commands/commit/index.ts
knock commit get ID
Display a single commit
USAGE
$ knock commit get ID [--json] [--service-token <value>]
FLAGS
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/commit/get.ts
knock commit list
Display all commits in an environment
USAGE
$ knock commit list [--json] [--service-token <value>] [--environment <value>] [--branch <value>] [--promoted]
[--resource-type audience|partial|email_layout|reusable_request|workflow|message_type|guide|translation...]
[--resource-id <value>] [--promote-group-id <value>] [--promoted-from-environment <value>] [--since <value>]
[--until <value>] [--after <value>] [--before <value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--limit=<value> The total number of entries to fetch per page.
--promote-group-id=<value> Filter commits to those created by a single promote. A promote's commits live in
the environment they were promoted to, so use together with --environment when
that isn't the default environment.
--[no-]promoted Show only promoted or unpromoted changes between the given environment and the
subsequent environment.
--promoted-from-environment=<value> Filter promoted commits by the slug of the environment or branch they were
promoted from.
--resource-id=<value> Filter commits by resource identifier. Must be used together with resource-type.
For most resources, this will be the resource key. In the case of translations,
this will be the locale code and namespace, separated by a /. For example,
en/courses or en.
--resource-type=<option>... Filter commits by resource type. Can be used alone or together with resource-id.
Use multiple --resource-type flags for multiple values.
<options: audience|partial|email_layout|reusable_request|workflow|message_type|gu
ide|translation>
--service-token=<value> The service token to authenticate with.
--since=<value> Only show commits created at or after this RFC 3339 timestamp. For example,
2026-01-31T09:00:00Z.
--until=<value> Only show commits created at or before this RFC 3339 timestamp. For example,
2026-01-31T09:00:00Z.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/commit/list.ts
knock commit promote
Promote one or all commits to the subsequent environment.
USAGE
$ knock commit promote [--service-token <value>] [--to <value>] [--force] [--only <value>]
FLAGS
--force Remove the confirmation prompt.
--only=<value> The target commit id to promote to the subsequent environment
--service-token=<value> The service token to authenticate with.
--to=<value> The destination environment to promote all changes from the preceding environment.See code: src/commands/commit/promote.ts
knock environment list
Display all environments configured for the account.
USAGE
$ knock environment list [--json] [--service-token <value>]
FLAGS
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/environment/list.ts
knock goal archive GOALKEY
Archive a goal in the current environment.
USAGE
$ knock goal archive GOALKEY [--service-token <value>] [--environment <value>] [--force]
ARGUMENTS
GOALKEY The key of the goal to archive.
FLAGS
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--service-token=<value> The service token to authenticate with.
DESCRIPTION
Archive a goal in the current environment.
Archives a goal in the current environment. The API refuses the archive if any
workflow, guide, or broadcast is still attached to the goal.See code: src/commands/goal/archive.ts
knock goal clone GOALKEY NEWGOALKEY
Clone a goal to a new goal key.
USAGE
$ knock goal clone GOALKEY NEWGOALKEY [--service-token <value>] [--environment <value>] [--dest-environment
<value>] [--name <value>] [--force]
ARGUMENTS
GOALKEY The key of the goal to clone.
NEWGOALKEY The key for the new cloned goal.
FLAGS
--dest-environment=<value> The destination environment for the clone. Defaults to --environment.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--name=<value> The name for the cloned goal. Defaults to the new goal key.
--service-token=<value> The service token to authenticate with.See code: src/commands/goal/clone.ts
knock goal get GOALKEY
Display a single goal from an environment.
USAGE
$ knock goal get GOALKEY [--json] [--service-token <value>] [--environment <value>]
FLAGS
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/goal/get.ts
knock goal list
Display all goals for an environment.
USAGE
$ knock goal list [--json] [--service-token <value>] [--environment <value>] [--after <value>] [--before
<value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--limit=<value> The total number of entries to fetch per page.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/goal/list.ts
knock goal new GOALKEY
Scaffold a new goal in the local file system.
USAGE
$ knock goal new GOALKEY [--service-token <value>]
ARGUMENTS
GOALKEY The key for the new goal.
FLAGS
--service-token=<value> The service token to authenticate with.See code: src/commands/goal/new.ts
knock goal open GOALKEY
Open a goal in the Knock dashboard.
USAGE
$ knock goal open GOALKEY [--service-token <value>] [--environment <value>]
FLAGS
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/goal/open.ts
knock goal pull [GOALKEY]
Pull one or more goals from an environment into a local file system.
USAGE
$ knock goal pull [GOALKEY] [--service-token <value>] [--environment <value>] [--goals-dir <value> --all]
[--force]
FLAGS
--all Whether to pull all goals from the specified environment.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--goals-dir=<value> The target directory path to pull all goals into.
--service-token=<value> The service token to authenticate with.See code: src/commands/goal/pull.ts
knock goal push [GOALKEY]
Push one or more goals from a local file system to Knock.
USAGE
$ knock goal push [GOALKEY] [--service-token <value>] [--environment <value>] [--goals-dir <value> --all]
FLAGS
--all Whether to push all goals from the target directory.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--goals-dir=<value> The target directory path to find all goals to push.
--service-token=<value> The service token to authenticate with.See code: src/commands/goal/push.ts
knock goal validate [GOALKEY]
Validate one or more goals from a local file system.
USAGE
$ knock goal validate [GOALKEY] [--service-token <value>] [--environment <value>] [--goals-dir <value> --all]
FLAGS
--all Whether to validate all goals in the target directory.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--goals-dir=<value> The target directory path to find all goals to validate.
--service-token=<value> The service token to authenticate with.See code: src/commands/goal/validate.ts
knock guide activate GUIDEKEY
Activate or deactivate a guide in a given environment.
USAGE
$ knock guide activate GUIDEKEY --environment <value> [--service-token <value>] [--branch <value>] [--status
true|false | --from <value> | --until <value>] [--force]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> (required) The environment to use.
--force Remove the confirmation prompt.
--from=<value> Activate the guide from this ISO8601 UTC datetime (e.g., '2024-01-15T10:30:00Z').
--service-token=<value> The service token to authenticate with.
--status=<option> The guide active status to set. Cannot be used with --from/--until.
<options: true|false>
--until=<value> Deactivate the guide at this ISO8601 UTC datetime (e.g., '2024-01-15T18:30:00Z').
DESCRIPTION
Activate or deactivate a guide in a given environment.
This enables or disables a guide in a given environment without
needing to go through environment promotion.
You can activate or deactivate a guide immediately or schedule it to be activated
or deactivated at a later time using the --from and --until flags.See code: src/commands/guide/activate.ts
knock guide generate-types
Generate types for all guides in an environment and write them to a file.
USAGE
$ knock guide generate-types --output-file <value> [--service-token <value>] [--environment <value>] [--branch
<value>]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--output-file=<value> (required) The output file to write the generated types to. We currently support .ts, .py,
.go, .rb files only. Your file extension will determine the target language for the generated
types.
--service-token=<value> The service token to authenticate with.
DESCRIPTION
Generate types for all guides in an environment and write them to a file.See code: src/commands/guide/generate-types.ts
knock guide get GUIDEKEY
Display a single guide from an environment.
USAGE
$ knock guide get GUIDEKEY [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
[--hide-uncommitted-changes]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/guide/get.ts
knock guide list
Display all guides for an environment.
USAGE
$ knock guide list [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
[--hide-uncommitted-changes] [--after <value>] [--before <value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--limit=<value> The total number of entries to fetch per page.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/guide/list.ts
knock guide new
Create a new guide with a minimal configuration.
USAGE
$ knock guide new [--service-token <value>] [-n <value>] [-k <value>] [-m <value>] [--environment <value>]
[--branch <value>] [--force] [-p] [-t <value>]
FLAGS
-k, --key=<value> The key of the guide
-m, --message-type=<value> The message type key to use for the guide. You cannot use this flag with --template.
-n, --name=<value> The name of the guide
-p, --push Whether or not to push the guide to Knock after creation.
-t, --template=<value> The template to use for the guide. Should be `guides/{key}`. You cannot use this flag
with --message-type.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Force the creation of the guide directory without confirmation.
--service-token=<value> The service token to authenticate with.See code: src/commands/guide/new.ts
knock guide open GUIDEKEY
Open a guide in the Knock dashboard.
USAGE
$ knock guide open GUIDEKEY [--service-token <value>] [--environment <value>] [--branch <value>]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/guide/open.ts
knock guide pull [GUIDEKEY]
Pull one or more guides from an environment into a local file system.
USAGE
$ knock guide pull [GUIDEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--guides-dir <value> --all] [--hide-uncommitted-changes] [--force]
FLAGS
--all Whether to pull all guides from the specified environment.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--guides-dir=<value> The target directory path to pull all guides into.
--hide-uncommitted-changes Hide any uncommitted changes.
--service-token=<value> The service token to authenticate with.See code: src/commands/guide/pull.ts
knock guide push [GUIDEKEY]
Push one or more guides from a local file system to Knock.
USAGE
$ knock guide push [GUIDEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--guides-dir <value> --all] [-m <value> --commit] [--allow-empty ] [--force]
FLAGS
-m, --commit-message=<value> Use the given value as the commit message
--all Whether to push all guides from the target directory.
--allow-empty Create an empty commit for an already-published resource (analogous to git commit
--allow-empty).
--branch=<value> The slug of the branch to use.
--commit Push and commit the guide(s) at the same time
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Force pushes the resource or resources to Knock, overwriting whatever is currently
stored. If you're using this on a non-development environment, you should also ensure
you `commit` the changes.
--guides-dir=<value> The target directory path to find all guides to push.
--service-token=<value> The service token to authenticate with.See code: src/commands/guide/push.ts
knock guide validate [GUIDEKEY]
Validate one or more guides from a local file system.
USAGE
$ knock guide validate [GUIDEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--guides-dir <value> --all]
FLAGS
--all Whether to validate all guides from the target directory.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--guides-dir=<value> The target directory path to find all guides to validate.
--service-token=<value> The service token to authenticate with.See code: src/commands/guide/validate.ts
knock help [COMMAND]
Display help for knock.
USAGE
$ knock help [COMMAND...] [-n]
ARGUMENTS
COMMAND... Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for knock.See code: @oclif/plugin-help
knock init
Initialize a new Knock project with a knock.json configuration file.
USAGE
$ knock init [--service-token <value>]
FLAGS
--service-token=<value> The service token to authenticate with.
DESCRIPTION
Initialize a new Knock project with a knock.json configuration file.
Creates a knock.json configuration file in the current directory to store project-level settings like the knock
resources directory.See code: src/commands/init.ts
knock layout get EMAILLAYOUTKEY
Display a single email layout from an environment.
USAGE
$ knock layout get EMAILLAYOUTKEY [--json] [--service-token <value>] [--environment <value>] [--branch
<value>] [--hide-uncommitted-changes]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/layout/get.ts
knock layout list
Display all email layouts for an environment.
USAGE
$ knock layout list [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
[--hide-uncommitted-changes] [--after <value>] [--before <value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--limit=<value> The total number of entries to fetch per page.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/layout/list.ts
knock layout new
Create a new email layout with a minimal configuration.
USAGE
$ knock layout new [--service-token <value>] [-n <value>] [-k <value>] [--environment <value>] [--branch
<value>] [--force] [-p] [--template <value>]
FLAGS
-k, --key=<value> The key of the email layout
-n, --name=<value> The name of the email layout
-p, --push Whether or not to push the email layout to Knock after creation.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Force the creation of the email layout directory without confirmation.
--service-token=<value> The service token to authenticate with.
--template=<value> The template to use for the email layout. Should be `email-layouts/{key}`.See code: src/commands/layout/new.ts
knock layout open LAYOUTKEY
Open a layout in the Knock dashboard.
USAGE
$ knock layout open LAYOUTKEY [--service-token <value>] [--environment <value>] [--branch <value>]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/layout/open.ts
knock layout pull [EMAILLAYOUTKEY]
Pull one or more email layouts from an environment into a local file system.
USAGE
$ knock layout pull [EMAILLAYOUTKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--layouts-dir <value> --all] [--hide-uncommitted-changes] [--force]
FLAGS
--all Whether to pull all email layouts from the specified environment.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--hide-uncommitted-changes Hide any uncommitted changes.
--layouts-dir=<value> The target directory path to pull all email layouts into.
--service-token=<value> The service token to authenticate with.See code: src/commands/layout/pull.ts
knock layout push [EMAILLAYOUTKEY]
Push one or more email layouts from a local file system to Knock.
USAGE
$ knock layout push [EMAILLAYOUTKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--layouts-dir <value> --all] [-m <value> --commit] [--allow-empty ] [--force]
FLAGS
-m, --commit-message=<value> Use the given value as the commit message
--all Whether to push all layouts from the target directory.
--allow-empty Create an empty commit for an already-published resource (analogous to git commit
--allow-empty).
--branch=<value> The slug of the branch to use.
--commit Push and commit the layout(s) at the same time
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Force pushes the resource or resources to Knock, overwriting whatever is currently
stored. If you're using this on a non-development environment, you should also ensure
you `commit` the changes.
--layouts-dir=<value> The target directory path to find all layouts to push.
--service-token=<value> The service token to authenticate with.See code: src/commands/layout/push.ts
knock layout validate [EMAILLAYOUTKEY]
Validate one or more layouts from a local file system.
USAGE
$ knock layout validate [EMAILLAYOUTKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--layouts-dir <value> --all]
FLAGS
--all Whether to validate all layouts from the target directory.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--layouts-dir=<value> The target directory path to find all layouts to validate.
--service-token=<value> The service token to authenticate with.See code: src/commands/layout/validate.ts
knock login
Log in with a Knock user account.
USAGE
$ knock login [--service-token <value>]
FLAGS
--service-token=<value> The service token to authenticate with.See code: src/commands/login.ts
knock logout
Log out of a Knock user account.
USAGE
$ knock logout [--service-token <value>]
FLAGS
--service-token=<value> The service token to authenticate with.See code: src/commands/logout.ts
knock message-type get MESSAGETYPEKEY
Display a single in-app message type.
USAGE
$ knock message-type get MESSAGETYPEKEY [--json] [--service-token <value>] [--environment <value>] [--branch
<value>] [--hide-uncommitted-changes]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/message-type/get.ts
knock message-type list
Display all in-app message types.
USAGE
$ knock message-type list [--json] [--service-token <value>] [--environment <value>] [--branch <value>]
[--hide-uncommitted-changes] [--after <value>] [--before <value>] [--limit <value>]
FLAGS
--after=<value> The cursor after which to fetch the next page.
--before=<value> The cursor before which to fetch the previous page.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--hide-uncommitted-changes Hide any uncommitted changes.
--limit=<value> The total number of entries to fetch per page.
--service-token=<value> The service token to authenticate with.
GLOBAL FLAGS
--json Format output as json.See code: src/commands/message-type/list.ts
knock message-type new
Create a new message type with a minimal configuration.
USAGE
$ knock message-type new [--service-token <value>] [-n <value>] [-k <value>] [--environment <value>] [--branch
<value>] [--force] [-p] [--template <value>]
FLAGS
-k, --key=<value> The key of the message type
-n, --name=<value> The name of the message type
-p, --push Whether or not to push the message type to Knock after creation.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Force the creation of the message type directory without confirmation.
--service-token=<value> The service token to authenticate with.
--template=<value> The template to use for the message type. Should be `message-types/{key}`.See code: src/commands/message-type/new.ts
knock message-type open MESSAGETYPEKEY
Open a message type in the Knock dashboard.
USAGE
$ knock message-type open MESSAGETYPEKEY [--service-token <value>] [--environment <value>] [--branch <value>]
FLAGS
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--service-token=<value> The service token to authenticate with.See code: src/commands/message-type/open.ts
knock message-type pull [MESSAGETYPEKEY]
Pull one or more in-app message types into a local file system.
USAGE
$ knock message-type pull [MESSAGETYPEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--message-types-dir <value> --all] [--hide-uncommitted-changes] [--force]
FLAGS
--all Whether to pull all in-app message types.
--branch=<value> The slug of the branch to use.
--environment=<value> The environment to use. When omitted, the account's default environment is used.
--force Remove the confirmation prompt.
--hide-uncommitted-changes Hide any uncommitted changes.
--message-types-dir=<value> The target directory path to pull all in-app message types into.
--service-token=<value> The service token to authenticate with.See code: src/commands/message-type/pull.ts
knock message-type push [MESSAGETYPEKEY]
Push one or more message types from a local file system to Knock.
USAGE
$ knock message-type push [MESSAGETYPEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
[--messag