Skip to content

knocklabs/knock-cli

Repository files navigation

@knocklabs/cli

A command-line interface for interacting with Knock.

Usage

$ npm install -g @knocklabs/cli
$ knock COMMAND
running command...
$ knock (--version)
@knocklabs/cli/0.1.19 darwin-arm64 node-v20.10.0
$ knock --help [COMMAND]
USAGE
  $ knock COMMAND
...

Commands

knock commit

Commit all changes in development environment.

USAGE
  $ knock commit --service-token <value> [--environment development] [-m <value>] [--force]

FLAGS
  -m, --commit-message=<value>  Use the given value as the commit message.
      --environment=<option>    [default: development] Committing changes applies to the development environment only,
                                use `commit promote` to promote changes to a subsequent environment.
                                <options: development>
      --force                   Remove the confirmation prompt.
      --service-token=<value>   (required) 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 --service-token <value> [--json]

FLAGS
  --service-token=<value>  (required) 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 --service-token <value> [--json] [--environment <value>] [--promoted] [--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>    [default: development] The environment to use.
  --limit=<value>          The total number of entries to fetch per page.
  --[no-]promoted          Show only promoted or unpromoted changes between the given environment and the subsequent
                           environment.
  --service-token=<value>  (required) The service token to authenticate with.

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>  (required) 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 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 layout get EMAILLAYOUTKEY

Display a single email layout from an environment.

USAGE
  $ knock layout get EMAILLAYOUTKEY --service-token <value> [--json] [--environment <value>]
    [--hide-uncommitted-changes]

FLAGS
  --environment=<value>       [default: development] The environment to use.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --service-token=<value>     (required) 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 --service-token <value> [--json] [--environment <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.
  --environment=<value>       [default: development] The environment to use.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --limit=<value>             The total number of entries to fetch per page.
  --service-token=<value>     (required) The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/layout/list.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>] [--layouts-dir <value>
    --all] [--hide-uncommitted-changes] [--force]

FLAGS
  --all                       Whether to pull all email layouts from the specified environment.
  --environment=<value>       [default: development] The environment to use.
  --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>     (required) 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 development] [--layouts-dir <value>
    --all] [-m <value> --commit]

FLAGS
  -m, --commit-message=<value>  Use the given value as the commit message
      --all                     Whether to push all layouts from the target directory.
      --commit                  Push and commit the layout(s) at the same time
      --environment=<option>    [default: development] Pushing an email layout is only allowed in the development
                                environment
                                <options: development>
      --layouts-dir=<value>     The target directory path to find all layouts to push.
      --service-token=<value>   (required) 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 development] [--layouts-dir <value>
    --all]

FLAGS
  --all                    Whether to validate all layouts from the target directory.
  --environment=<option>   [default: development] Validating a layout is only done in the development environment
                           <options: development>
  --layouts-dir=<value>    The target directory path to find all layouts to validate.
  --service-token=<value>  (required) The service token to authenticate with.

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

knock partial get PARTIALKEY

Display a single partial from an environment.

USAGE
  $ knock partial get PARTIALKEY --service-token <value> [--json] [--environment <value>]
    [--hide-uncommitted-changes]

FLAGS
  --environment=<value>       [default: development] The environment to use.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --service-token=<value>     (required) 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 --service-token <value> [--json] [--environment <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.
  --environment=<value>       [default: development] The environment to use.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --limit=<value>             The total number of entries to fetch per page.
  --service-token=<value>     (required) The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/partial/list.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>] [--partials-dir <value> --all]
    [--hide-uncommitted-changes] [--force]

FLAGS
  --all                       Whether to pull all partials from the specified environment.
  --environment=<value>       [default: development] The environment to use.
  --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>     (required) 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 development] [--partials-dir <value>
    --all] [-m <value> --commit]

FLAGS
  -m, --commit-message=<value>  Use the given value as the commit message
      --all                     Whether to push all partials from the target directory.
      --commit                  Push and commit the partial(s) at the same time
      --environment=<option>    [default: development] Pushing a partial is only allowed in the development environment
                                <options: development>
      --partials-dir=<value>    The target directory path to find all partials to push.
      --service-token=<value>   (required) 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 development] [--partials-dir <value>
    --all]

FLAGS
  --all                    Whether to validate all partials from the target directory.
  --environment=<option>   [default: development] Validating a partial is only done in the development environment
                           <options: development>
  --partials-dir=<value>   The target directory path to find all partials to validate.
  --service-token=<value>  (required) The service token to authenticate with.

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

knock translation get TRANSLATIONREF

Display a single translation from an environment.

USAGE
  $ knock translation get TRANSLATIONREF --service-token <value> [--json] [--environment <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
  --environment=<value>       [default: development] The environment to use.
  --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>     (required) 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 --service-token <value> [--json] [--environment <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.
  --environment=<value>       [default: development] The environment to use.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --limit=<value>             The total number of entries to fetch per page.
  --service-token=<value>     (required) 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>] [--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.
  --environment=<value>       [default: development] The environment to use.
  --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>     (required) 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 development] [--translations-dir
    <value> --all] [-m <value> --commit]

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.
      --commit                    Push and commit the translation(s) at the same time
      --environment=<option>      [default: development] Pushing a translation is only allowed in the development
                                  environment
                                  <options: development>
      --service-token=<value>     (required) 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 development] [--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.
  --environment=<option>      [default: development] Validating a translation is only done in the development
                              environment
                              <options: development>
  --service-token=<value>     (required) 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 whoami

Verify the provided service token.

USAGE
  $ knock whoami --service-token <value> [--json]

FLAGS
  --service-token=<value>  (required) 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 --service-token <value> --environment <value> [--status true|false] [--force]

FLAGS
  --environment=<value>    (required) The environment to use.
  --force                  Remove the confirmation prompt.
  --service-token=<value>  (required) 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 get WORKFLOWKEY

Display a single workflow from an environment.

USAGE
  $ knock workflow get WORKFLOWKEY --service-token <value> [--json] [--environment <value>]
    [--hide-uncommitted-changes]

FLAGS
  --environment=<value>       [default: development] The environment to use.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --service-token=<value>     (required) 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 --service-token <value> [--json] [--environment <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.
  --environment=<value>       [default: development] The environment to use.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --limit=<value>             The total number of entries to fetch per page.
  --service-token=<value>     (required) The service token to authenticate with.

GLOBAL FLAGS
  --json  Format output as json.

See code: src/commands/workflow/list.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>] [--workflows-dir <value>
    --all] [--hide-uncommitted-changes] [--force]

FLAGS
  --all                       Whether to pull all workflows from the specified environment.
  --environment=<value>       [default: development] The environment to use.
  --force                     Remove the confirmation prompt.
  --hide-uncommitted-changes  Hide any uncommitted changes.
  --service-token=<value>     (required) 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 development] [--workflows-dir <value>
    --all] [-m <value> --commit]

FLAGS
  -m, --commit-message=<value>  Use the given value as the commit message
      --all                     Whether to push all workflows from the target directory.
      --commit                  Push and commit the workflow(s) at the same time
      --environment=<option>    [default: development] Pushing a workflow is only allowed in the development environment
                                <options: development>
      --service-token=<value>   (required) 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 --service-token <value> --recipients <value> [--environment <value>] [--actor
    <value>] [--tenant <value>] [--data <value>]

FLAGS
  --actor=<value>          An actor id, or a JSON string of an actor object reference for the workflow run.
  --data=<value>           A JSON string of the data for this workflow
  --environment=<value>    [default: development] The environment in which to run the workflow
  --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.
  --service-token=<value>  (required) The service token to authenticate with.
  --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 development] [--workflows-dir <value>
    --all]

FLAGS
  --all                    Whether to validate all workflows from the target directory.
  --environment=<option>   [default: development] Validating a workflow is only done in the development environment
                           <options: development>
  --service-token=<value>  (required) 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