Skip to content
knocklabsPublic

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

6 watching

Forks

Repository files navigation

@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.0 darwin-arm64 node-v24.22.1
$ knock --help [COMMAND]
USAGE
  $ knock COMMAND
...

Commands

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 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 across all environments.

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 across all environments.


  Archives a goal across all environments. 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>]
    [--message-types-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 message types 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 message type(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.
      --message-types-dir=<value>  The target directory path to find all message types to push.
      --service-token=<value>      The service token to authenticate with.

See code: src/commands/message-type/push.ts

knock message-type validate [MESSAGETYPEKEY]

Validate one or more message types from a local file system.

USAGE
  $ knock message-type validate [MESSAGETYPEKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--message-types-dir <value> --all]

FLAGS
  --all                        Whether to validate all message types 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.
  --message-types-dir=<value>  The target directory path to find all message types to validate.
  --service-token=<value>      The service token to authenticate with.

See code: src/commands/message-type/validate.ts

knock partial get PARTIALKEY

Display a single partial from an environment.

USAGE
  $ knock partial get PARTIALKEY [--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/partial/get.ts

knock partial list

Display all partials for an environment.

USAGE
  $ knock partial 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/partial/list.ts

knock partial new

Create a new partial with a minimal configuration.

USAGE
  $ knock partial new [--service-token <value>] [-n <value>] [-k <value>] [-t html|json|markdown|text]
    [--environment <value>] [--branch <value>] [--force] [-p] [--template <value>]

FLAGS
  -k, --key=<value>            The key of the partial
  -n, --name=<value>           The name of the partial
  -p, --push                   Whether or not to push the partial to Knock after creation.
  -t, --type=<option>          The type of the partial (html, json, markdown, text). You cannot use this flag with
                               --template.
                               <options: html|json|markdown|text>
      --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 partial directory without confirmation.
      --service-token=<value>  The service token to authenticate with.
      --template=<value>       The template to use for the partial. Should be `partials/{key}`. You cannot use this flag
                               with --type.

See code: src/commands/partial/new.ts

knock partial open PARTIALKEY

Open a partial in the Knock dashboard.

USAGE
  $ knock partial open PARTIALKEY [--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/partial/open.ts

knock partial pull [PARTIALKEY]

Pull one or more partial from an environment into a local file system.

USAGE
  $ knock partial pull [PARTIALKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--partials-dir <value> --all] [--hide-uncommitted-changes] [--force]

FLAGS
  --all                       Whether to pull all partials 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.
  --partials-dir=<value>      The target directory path to pull all partials into.
  --service-token=<value>     The service token to authenticate with.

See code: src/commands/partial/pull.ts

knock partial push [PARTIALKEY]

Push one or more partials from a local file system to Knock.

USAGE
  $ knock partial push [PARTIALKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--partials-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 partials 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 partial(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.
      --partials-dir=<value>    The target directory path to find all partials to push.
      --service-token=<value>   The service token to authenticate with.

See code: src/commands/partial/push.ts

knock partial validate [PARTIALKEY]

Validate one or more partials from a local file system.

USAGE
  $ knock partial validate [PARTIALKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--partials-dir <value> --all]

FLAGS
  --all                    Whether to validate all partials 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.
  --partials-dir=<value>   The target directory path to find all partials to validate.
  --service-token=<value>  The service token to authenticate with.

See code: src/commands/partial/validate.ts

knock pull

Pull all resources from an environment into a local file system.

USAGE
  $ knock pull [--service-token <value>] [--environment <value>] [--branch <value>] [--knock-dir <value>]
    [--hide-uncommitted-changes] [--force]

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.
  --force                     Remove the confirmation prompt.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --knock-dir=<value>         The target directory path to pull all resources into.
  --service-token=<value>     The service token to authenticate with.

See code: src/commands/pull.ts

knock push

Push all resources from a local file system to Knock.

USAGE
  $ knock push [--service-token <value>] [--environment <value>] [--branch <value>] [--knock-dir <value>]
    [-m <value> --commit] [--allow-empty ] [--force]

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).
      --branch=<value>          The slug of the branch to use.
      --commit                  Push and commit the resource(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.
      --knock-dir=<value>       The target directory path to find all resources to push.
      --service-token=<value>   The service token to authenticate with.

See code: src/commands/push.ts

knock reusable-request archive REUSABLEREQUESTKEY

Archive a reusable request (affects ALL environments).

USAGE
  $ knock reusable-request archive REUSABLEREQUESTKEY --environment <value> [--json] [--service-token <value>] [--branch
    <value>] [--force]

ARGUMENTS
  REUSABLEREQUESTKEY  The key of the reusable request 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.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Archive a reusable request (affects ALL environments).


  WARNING: Archiving a reusable request affects ALL environments and cannot be undone.
  Use this command with caution.

  If a local copy exists at <knock dir>/reusable-requests/<key>, that directory
  is removed so a later push does not create the reusable request again.

See code: src/commands/reusable-request/archive.ts

knock reusable-request get REUSABLEREQUESTKEY

Display a single reusable request from an environment.

USAGE
  $ knock reusable-request get REUSABLEREQUESTKEY [--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/reusable-request/get.ts

knock reusable-request list

Display all reusable requests for an environment.

USAGE
  $ knock reusable-request 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/reusable-request/list.ts

knock reusable-request new

Create a new reusable request with a minimal configuration.

USAGE
  $ knock reusable-request new [--service-token <value>] [-n <value>] [-k <value>] [-t http_fetch] [-d <value>] [--method
    get|post|put|delete|patch] [--url <value>] [--environment <value>] [--branch <value>] [--force] [-p]

FLAGS
  -d, --description=<value>    The description of the reusable request
  -k, --key=<value>            The key of the reusable request
  -n, --name=<value>           The name of the reusable request
  -p, --push                   Whether or not to push the reusable request to Knock after creation.
  -t, --type=<option>          [default: http_fetch] The reusable request type. Only http_fetch is supported.
                               <options: http_fetch>
      --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 reusable request directory without confirmation.
      --method=<option>        [default: get] The HTTP method of the request.
                               <options: get|post|put|delete|patch>
      --service-token=<value>  The service token to authenticate with.
      --url=<value>            [default: https://example.com] The URL of the request.

See code: src/commands/reusable-request/new.ts

knock reusable-request pull [REUSABLEREQUESTKEY]

Pull one or more reusable requests from an environment into a local file system.

USAGE
  $ knock reusable-request pull [REUSABLEREQUESTKEY] [--json] [--service-token <value>] [--environment <value>] [--branch
    <value>] [--reusable-requests-dir <value> --all] [--hide-uncommitted-changes] [--force]

FLAGS
  --all                            Whether to pull all reusable requests 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.
  --reusable-requests-dir=<value>  The target directory path to pull all reusable requests into.
  --service-token=<value>          The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/reusable-request/pull.ts

knock reusable-request push [REUSABLEREQUESTKEY]

Push one or more reusable requests from a local file system to Knock.

USAGE
  $ knock reusable-request push [REUSABLEREQUESTKEY] [--json] [--service-token <value>] [--environment <value>] [--branch
    <value>] [--reusable-requests-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 reusable requests 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 reusable request(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.
      --reusable-requests-dir=<value>  The target directory path to find all reusable requests to push.
      --service-token=<value>          The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/reusable-request/push.ts

knock reusable-request validate [REUSABLEREQUESTKEY]

Validate one or more reusable requests from a local file system.

USAGE
  $ knock reusable-request validate [REUSABLEREQUESTKEY] [--json] [--service-token <value>] [--environment <value>] [--branch
    <value>] [--reusable-requests-dir <value> --all]

FLAGS
  --all                            Whether to validate all reusable requests 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.
  --reusable-requests-dir=<value>  The target directory path to find all reusable requests to validate.
  --service-token=<value>          The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/reusable-request/validate.ts

knock schema pull [ITEMTYPE]

Pull one or more item schemas from an environment into a local file system.

USAGE
  $ knock schema pull [ITEMTYPE] [--service-token <value>] [--environment <value>] [--branch <value>] [--all]
    [--collection <value>] [--schemas-dir <value>] [--force]

FLAGS
  --all                    Whether to pull all item schemas from the specified environment.
  --branch=<value>         The slug of the branch to use.
  --collection=<value>     The object collection key for object schemas.
  --environment=<value>    The environment to use. When omitted, the account's default environment is used.
  --force                  Remove the confirmation prompt.
  --schemas-dir=<value>    The target schemas directory path.
  --service-token=<value>  The service token to authenticate with.

See code: src/commands/schema/pull.ts

knock schema push [ITEMTYPE]

Push one or more local item schemas to a Knock environment.

USAGE
  $ knock schema push [ITEMTYPE] [--service-token <value>] [--environment <value>] [--branch <value>] [--all]
    [--collection <value>] [--schemas-dir <value>]

FLAGS
  --all                    Whether to push all schemas from the target schemas directory.
  --branch=<value>         The slug of the branch to use.
  --collection=<value>     The object collection key for object schemas.
  --environment=<value>    The environment to use. When omitted, the account's default environment is used.
  --schemas-dir=<value>    The target schemas directory path.
  --service-token=<value>  The service token to authenticate with.

See code: src/commands/schema/push.ts

knock source get SOURCEKEY

Display a single source from an environment.

USAGE
  $ knock source get SOURCEKEY [--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/source/get.ts

knock source list

Display all sources for an environment.

USAGE
  $ knock source 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/source/list.ts

knock translation get TRANSLATIONREF

Display a single translation from an environment.

USAGE
  $ knock translation get TRANSLATIONREF [--json] [--service-token <value>] [--environment <value>] [--branch
    <value>] [--hide-uncommitted-changes] [--format json|po]

ARGUMENTS
  TRANSLATIONREF  Translation ref is a identifier string that refers to a unique translation.
                  If a translation has no namespace, it is the same as the locale, e.g. `en`.
                  If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.

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.
  --format=<option>           [default: json] Specify the output format of the returned translations.
                              <options: json|po>
  --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/translation/get.ts

knock translation list

Display all translations for an environment.

USAGE
  $ knock translation 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/translation/list.ts

knock translation pull [TRANSLATIONREF]

Pull one or more translations from an environment into a local file system.

USAGE
  $ knock translation pull [TRANSLATIONREF] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--translations-dir <value> --all] [--hide-uncommitted-changes] [--force] [--format json|po]

ARGUMENTS
  TRANSLATIONREF  Translation ref is a identifier string that refers to a unique translation.
                  If a translation has no namespace, it is the same as the locale, e.g. `en`.
                  If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.

FLAGS
  --all                       Whether to pull all translations 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.
  --format=<option>           [default: json] Specify the output format of the returned translations.
                              <options: json|po>
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --service-token=<value>     The service token to authenticate with.
  --translations-dir=<value>  The target directory path to pull all translations into.

See code: src/commands/translation/pull.ts

knock translation push [TRANSLATIONREF]

Push one or more translations from a local file system to Knock.

USAGE
  $ knock translation push [TRANSLATIONREF] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--translations-dir <value> --all] [-m <value> --commit] [--allow-empty ] [--force]

ARGUMENTS
  TRANSLATIONREF  Translation ref is a identifier string that refers to a unique translation.
                  If a translation has no namespace, it is the same as the locale, e.g. `en`.
                  If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.

FLAGS
  -m, --commit-message=<value>    Use the given value as the commit message
      --all                       Whether to push all translations 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 translation(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.
      --translations-dir=<value>  The target directory path to find all translations to push.

See code: src/commands/translation/push.ts

knock translation validate [TRANSLATIONREF]

Validate one or more translations from a local file system.

USAGE
  $ knock translation validate [TRANSLATIONREF] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--translations-dir <value> --all]

ARGUMENTS
  TRANSLATIONREF  Translation ref is a identifier string that refers to a unique translation.
                  If a translation has no namespace, it is the same as the locale, e.g. `en`.
                  If namespaced, it is formatted as namespace.locale, e.g. `admin.en`.

FLAGS
  --all                       Whether to validate all translations 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.
  --service-token=<value>     The service token to authenticate with.
  --translations-dir=<value>  The target directory path to find all translations to validate.

See code: src/commands/translation/validate.ts

knock variable delete KEY

Delete a variable, or clear one environment override.

USAGE
  $ knock variable delete KEY [--json] [--service-token <value>] [--environment <value>] [--branch <value>] [--force]

ARGUMENTS
  KEY  The variable key.

FLAGS
  --branch=<value>         Rejected. Variables are not branch-scoped.
  --environment=<value>    Clear only this environment's override. The variable itself is not deleted.
  --force                  Skip the confirmation prompt.
  --service-token=<value>  The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/variable/delete.ts

knock variable get KEY

Display a variable and its environment overrides.

USAGE
  $ knock variable get KEY [--json] [--service-token <value>] [--environment <value>] [--branch <value>]

ARGUMENTS
  KEY  The variable key.

FLAGS
  --branch=<value>         Rejected. Variables are not branch-scoped.
  --environment=<value>    Rejected. Get always shows the default and every environment override.
  --service-token=<value>  The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/variable/get.ts

knock variable list

Display variables in the project, or the value that applies in one environment.

USAGE
  $ knock variable list [--json] [--service-token <value>] [--environment <value>] [--type public|secret] [--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>         Rejected. Variables are not branch-scoped.
  --environment=<value>    Show only the value that applies in this environment: the override when one is set, otherwise
                           the default.
  --limit=<value>          The total number of entries to fetch per page.
  --service-token=<value>  The service token to authenticate with.
  --type=<option>          Filter variables by type.
                           <options: public|secret>

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/variable/list.ts

knock variable new

Add a variable entry to variables.json.

USAGE
  $ knock variable new --key <value> --type public|secret [--service-token <value>] [--value <value>]
    [--description <value>] [--knock-dir <value>] [--force] [--push] [--branch <value>]

FLAGS
  --branch=<value>         Rejected. Variables are not branch-scoped.
  --description=<value>    Variable description.
  --force                  Skip the confirmation prompt when creating the file.
  --key=<value>            (required) Variable key.
  --knock-dir=<value>      Knock directory used to locate variables.json.
  --push                   Push the new entry after writing it.
  --service-token=<value>  The service token to authenticate with.
  --type=<option>          (required) public or secret.
                           <options: public|secret>
  --value=<value>          Default value. Public variables only.

See code: src/commands/variable/new.ts

knock variable pull [KEY]

Pull variables into variables.json.

USAGE
  $ knock variable pull [KEY] [--service-token <value>] [--environment <value>] [--branch <value>] [--knock-dir
    <value>] [--force]

ARGUMENTS
  KEY  Update only this entry. Omit to pull every variable.

FLAGS
  --branch=<value>         Rejected. Variables are not branch-scoped.
  --environment=<value>    Rejected. Pull always fetches the project catalog.
  --force                  Skip the confirmation prompt.
  --knock-dir=<value>      Knock directory used to locate variables.json.
  --service-token=<value>  The service token to authenticate with.

See code: src/commands/variable/pull.ts

knock variable push [KEY]

Push variables from variables.json to Knock.

USAGE
  $ knock variable push [KEY] [--service-token <value>] [--environment <value>] [--branch <value>] [--knock-dir
    <value>] [--force]

ARGUMENTS
  KEY  Push only this entry. Omit to push every entry.

FLAGS
  --branch=<value>         Rejected. Variables are not branch-scoped.
  --environment=<value>    Rejected. Push writes the project catalog in variables.json.
  --force                  Skip the confirmation prompt.
  --knock-dir=<value>      Knock directory used to locate variables.json.
  --service-token=<value>  The service token to authenticate with.

See code: src/commands/variable/push.ts

knock variable set KEY

Create or update a variable.

USAGE
  $ knock variable set KEY [--json] [--service-token <value>] [--type public|secret] [--value <value>]
    [--value-file <value>] [--value-stdin] [--unset-value] [--description <value>] [--unset-description]
    [--environment-value <value>...] [--environment-value-file <value>...] [--unset-environment <value>...]
    [--environment <value>] [--branch <value>]

ARGUMENTS
  KEY  The variable key.

FLAGS
  --branch=<value>                     Rejected. Variables are not branch-scoped.
  --description=<value>                Variable description.
  --environment=<value>                Rejected. Use --environment-value, --environment-value-file, or
                                       --unset-environment.
  --environment-value=<value>...       Set one environment override as <slug>=<value>. Repeatable. Public variables
                                       only.
  --environment-value-file=<value>...  Set one environment override from a file as <slug>=<path>. Repeatable.
  --service-token=<value>              The service token to authenticate with.
  --type=<option>                      public or secret. Required when creating a variable.
                                       <options: public|secret>
  --unset-description                  Clear the description.
  --unset-environment=<value>...       Clear one environment override. Repeatable.
  --unset-value                        Clear the default value.
  --value=<value>                      Default value. Public variables only.
  --value-file=<value>                 Read the default value from a file. The bytes are not trimmed.
  --value-stdin                        Read the default value from stdin until EOF. The bytes are not trimmed.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/variable/set.ts

knock whoami

Verify authentication and show the current account and user.

USAGE
  $ knock whoami [--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/whoami.ts

knock workflow activate WORKFLOWKEY

Activate or deactivate a workflow in a given environment.

USAGE
  $ knock workflow activate WORKFLOWKEY --environment <value> [--service-token <value>] [--branch <value>] [--status
    true|false] [--force]

FLAGS
  --branch=<value>         The slug of the branch to use.
  --environment=<value>    (required) The environment to use.
  --force                  Remove the confirmation prompt.
  --service-token=<value>  The service token to authenticate with.
  --status=<option>        [default: true] The workflow active status to set.
                           <options: true|false>

DESCRIPTION
  Activate or deactivate a workflow in a given environment.

  This immediately enables or disables a workflow in a given environment without
  needing to go through environment promotion.

  By default, this command activates a given workflow. Pass in the --status flag
  with `false` in order to deactivate it.

See code: src/commands/workflow/activate.ts

knock workflow generate-types

Generate types for all workflows in an environment and write them to a file.

USAGE
  $ knock workflow 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, .rb,
                           .go, .py 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 workflows in an environment and write them to a file.

See code: src/commands/workflow/generate-types.ts

knock workflow get WORKFLOWKEY

Display a single workflow from an environment.

USAGE
  $ knock workflow get WORKFLOWKEY [--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/workflow/get.ts

knock workflow list

Display all workflows for an environment.

USAGE
  $ knock workflow 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/workflow/list.ts

knock workflow new

Create a new workflow with a minimal configuration.

USAGE
  $ knock workflow new [--service-token <value>] [-n <value>] [-k <value>] [-s <value>] [--environment <value>]
    [--branch <value>] [--force] [-p] [-t <value>]

FLAGS
  -k, --key=<value>            The key of the workflow
  -n, --name=<value>           The name of the workflow
  -p, --push                   Whether or not to push the workflow to Knock after creation.
  -s, --steps=<value>          Comma-separated list of step types to include in the workflow
  -t, --template=<value>       The template repository to use for the workflow. Should be `workflows/{type}`. You cannot
                               use this flag with --steps.
      --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 workflow directory without confirmation.
      --service-token=<value>  The service token to authenticate with.

See code: src/commands/workflow/new.ts

knock workflow open WORKFLOWKEY

Open a workflow in the Knock dashboard.

USAGE
  $ knock workflow open WORKFLOWKEY [--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/workflow/open.ts

knock workflow pull [WORKFLOWKEY]

Pull one or more workflows from an environment into a local file system.

USAGE
  $ knock workflow pull [WORKFLOWKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--workflows-dir <value> --all] [--hide-uncommitted-changes] [--force]

FLAGS
  --all                       Whether to pull all workflows 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.
  --service-token=<value>     The service token to authenticate with.
  --workflows-dir=<value>     The target directory path to pull all workflows into.

See code: src/commands/workflow/pull.ts

knock workflow push [WORKFLOWKEY]

Push one or more workflows from a local file system to Knock.

USAGE
  $ knock workflow push [WORKFLOWKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--workflows-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 workflows 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 workflow(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.
      --workflows-dir=<value>   The target directory path to find all workflows to push.

See code: src/commands/workflow/push.ts

knock workflow run WORKFLOWKEY

Test run a workflow using the latest version from Knock.

USAGE
  $ knock workflow run WORKFLOWKEY --recipients <value> [--service-token <value>] [--environment <value>]
    [--branch <value>] [--actor <value>] [--tenant <value>] [--data <value>] [--sandbox-mode] [--skip-delay]

FLAGS
  --actor=<value>          An actor id, or a JSON string of an actor object reference for the workflow run.
  --branch=<value>         The slug of the branch to use.
  --data=<value>           A JSON string of the data for this workflow
  --environment=<value>    The environment to use. When omitted, the account's default environment is used.
  --recipients=<value>     (required) One or more recipient user ids separated by comma, or a JSON string containing one
                           or more recipient object references for this workflow run.
  --sandbox-mode           When enabled, channels in this workflow 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 workflow will be skipped
  --tenant=<value>         A tenant id for the workflow run.

See code: src/commands/workflow/run.ts

knock workflow validate [WORKFLOWKEY]

Validate one or more workflows from a local file system.

USAGE
  $ knock workflow validate [WORKFLOWKEY] [--service-token <value>] [--environment <value>] [--branch <value>]
    [--workflows-dir <value> --all]

FLAGS
  --all                    Whether to validate all workflows 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.
  --service-token=<value>  The service token to authenticate with.
  --workflows-dir=<value>  The target directory path to find all workflows to validate.

See code: src/commands/workflow/validate.ts

About

No description, website, or topics provided.

Resources

Stars

5 stars

Watchers

6 watching

Forks

Releases

Packages

Used by

Contributors

Languages