#bindings #api-bindings #command-line-tool #cli #env-var #api-token #zenkit

app zenkit-cli

Command-line tool for interacting with Zenkit workspaces

7 releases

0.4.5 Apr 14, 2021
0.4.4 Feb 16, 2021
0.4.3 Jan 27, 2021
0.3.1 Dec 8, 2020

#28 in #api-token

26 downloads per month

MIT/Apache

30KB
550 lines

Use Zenkit from the command-line and scripts. Read and update workspaces, lists, items, fields, and webhooks; and perform backups to json.

Installation

Install with cargo install zenkit-cli. The program name is zk (usually installed to $HOME/.cargo/bin). Instructions for installing cargo are here

Set the environment variable ZENKIT_API_TOKEN to your api token, which you can obtain (even for the free-tier plan) from your Zenkit account.

Optional: To avoid re-typing -w WORKSPACE for every command for the most-used workspace, set the environment variable ZENKIT_WORKSPACE to the workspace name. The -w WORKSPACE option always overrides ZENKIT_WORKSPACE.

zk Usage

Use zk -h for help.

For the commands below, the parameter values for workspace, list, or field may be an object's id (int), uuid, or display name. Values containing spaces or symbols should be quoted.

All commands except workspaces require a -w workspace parameter or require the environment variable ZENKIT_WORKSPACE to contain a workspace name. The -w option is omitted below for brevity.

  • Show help
    zk -h/--help

  • Workspace commands

    • Show all workspaces and lists (accessible by your user)
      zk workspaces
      Output columns (tab-separated):

      • W/L: workspace or list
      • id: object id (positive int)
      • uuid: object uuid
      • name: object name
    • Show users in workspace
      zk users
      Output columns (tab-separated):

      • id
      • uuid
      • name
    • Show lists in workspace
      zk lists
      Output columns (tab-separated):

      • id
      • uuid
      • name
  • List commands

    • Show items in a list
      zk items -l list
      Output columns (tab-separated):
      • id
      • uuid
      • name
  • List field/schema commands

    • Show fields for a list
      zk fields -l list
      Output columns (tab-separated):

      • id
      • uuid
      • name
    • Show choice values for a field
      zk choices -l list -f field
      Output columns (tab-separated):

      • id
      • name
    • Describe field
      zk field -l list -f field
      Output format: Text object dump

  • Item commands

    • Show item detail
      zk item -l list -i item_num
      Output format: object dump (text)

    • Set field value
      zk set -l list -i item_num -f field [-t text] [-v value | -F file]

      The value can be specified on the command-line (-v) or from a file (-F).

      For a field of type person, the value may be either the person's uuid or their display name (case-insensitive). For a field of type choice (category), the value may be the choice id, uuid, or display name(case-sensitive). For a field of type reference, the value must be the uuid of the related object.

    • Create item
      zk create -l list -F field=value -F field=value ...jj

      Values may be of the format described above for "Set field value". Field names may be id, uuid, or display name (case-sensitive).

    • Add comment to an item
      zk comment -l list -i item -c comment

  • Webhooks

    • Add a webhook
      zk webhook --type triggger-type --url url [ OPTIONS ]

    • Delete webhook
      zk delete-webhook --webhook webhook

    • List webhooks
      zk list-webhooks

  • Backup

    • Backup lists and field definitions to json files
      zk backup -o output_dir [ -l list ]
      If no list is specified, all lists in the workspace are backed up.

Dependencies

~11–26MB
~374K SLoC