@knocklabs/cli
TypeScript icon, indicating that this package has built-in type declarations

0.1.15 • Public • Published

@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.15 linux-x64 node-v18.20.2
$ 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 plugins

List installed plugins.

USAGE
  $ knock plugins [--json] [--core]

FLAGS
  --core  Show core plugins.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  List installed plugins.

EXAMPLES
  $ knock plugins

See code: @oclif/plugin-plugins

knock plugins:install PLUGIN...

Installs a plugin into the CLI.

USAGE
  $ knock plugins add plugins:install PLUGIN...

ARGUMENTS
  PLUGIN...  Plugin to install.

FLAGS
  -f, --force    Run yarn install with force flag.
  -h, --help     Show CLI help.
  -s, --silent   Silences yarn output.
  -v, --verbose  Show verbose yarn output.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Installs a plugin into the CLI.
  Can be installed from npm or a git url.

  Installation of a user-installed plugin will override a core plugin.

  e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
  will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
  the CLI without the need to patch and update the whole CLI.


ALIASES
  $ knock plugins add

EXAMPLES
  $ knock plugins add myplugin 

  $ knock plugins add https://github.com/someuser/someplugin

  $ knock plugins add someuser/someplugin

knock plugins:inspect PLUGIN...

Displays installation properties of a plugin.

USAGE
  $ knock plugins inspect PLUGIN...

ARGUMENTS
  PLUGIN...  [default: .] Plugin to inspect.

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Displays installation properties of a plugin.

EXAMPLES
  $ knock plugins inspect myplugin

See code: @oclif/plugin-plugins

knock plugins:install PLUGIN...

Installs a plugin into the CLI.

USAGE
  $ knock plugins install PLUGIN...

ARGUMENTS
  PLUGIN...  Plugin to install.

FLAGS
  -f, --force    Run yarn install with force flag.
  -h, --help     Show CLI help.
  -s, --silent   Silences yarn output.
  -v, --verbose  Show verbose yarn output.

GLOBAL FLAGS
  --json  Format output as json.

DESCRIPTION
  Installs a plugin into the CLI.
  Can be installed from npm or a git url.

  Installation of a user-installed plugin will override a core plugin.

  e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
  will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
  the CLI without the need to patch and update the whole CLI.


ALIASES
  $ knock plugins add

EXAMPLES
  $ knock plugins install myplugin 

  $ knock plugins install https://github.com/someuser/someplugin

  $ knock plugins install someuser/someplugin

See code: @oclif/plugin-plugins

knock plugins:link PLUGIN

Links a plugin into the CLI for development.

USAGE
  $ knock plugins link PLUGIN

ARGUMENTS
  PATH  [default: .] path to plugin

FLAGS
  -h, --help          Show CLI help.
  -v, --verbose
      --[no-]install  Install dependencies after linking the plugin.

DESCRIPTION
  Links a plugin into the CLI for development.
  Installation of a linked plugin will override a user-installed or core plugin.

  e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
  command will override the user-installed or core plugin implementation. This is useful for development work.


EXAMPLES
  $ knock plugins link myplugin

See code: @oclif/plugin-plugins

knock plugins:uninstall PLUGIN...

Removes a plugin from the CLI.

USAGE
  $ knock plugins remove plugins:uninstall PLUGIN...

ARGUMENTS
  PLUGIN...  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ knock plugins unlink
  $ knock plugins remove

EXAMPLES
  $ knock plugins remove myplugin

knock plugins reset

Remove all user-installed and linked plugins.

USAGE
  $ knock plugins reset [--hard] [--reinstall]

FLAGS
  --hard       Delete node_modules and package manager related files in addition to uninstalling plugins.
  --reinstall  Reinstall all plugins after uninstalling.

See code: @oclif/plugin-plugins

knock plugins:uninstall PLUGIN...

Removes a plugin from the CLI.

USAGE
  $ knock plugins uninstall PLUGIN...

ARGUMENTS
  PLUGIN...  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ knock plugins unlink
  $ knock plugins remove

EXAMPLES
  $ knock plugins uninstall myplugin

See code: @oclif/plugin-plugins

knock plugins:uninstall PLUGIN...

Removes a plugin from the CLI.

USAGE
  $ knock plugins unlink plugins:uninstall PLUGIN...

ARGUMENTS
  PLUGIN...  plugin to uninstall

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Removes a plugin from the CLI.

ALIASES
  $ knock plugins unlink
  $ knock plugins remove

EXAMPLES
  $ knock plugins unlink myplugin

knock plugins update

Update installed plugins.

USAGE
  $ knock plugins update [-h] [-v]

FLAGS
  -h, --help     Show CLI help.
  -v, --verbose

DESCRIPTION
  Update installed plugins.

See code: @oclif/plugin-plugins

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

Readme

Keywords

Package Sidebar

Install

npm i @knocklabs/cli

Weekly Downloads

1,749

Version

0.1.15

License

MIT

Unpacked Size

365 kB

Total Files

101

Last publish

Collaborators

  • cjbell