zapier-platform/packages/cli/docs/cli.md at main · zapier/zapier-platform · GitHub
Skip to content You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session. You switched accounts on another tab or window. Reload to refresh your session. Dismiss alert Expand file tree / cli.md Copy path More file actions More file actions Latest commit History History History 991 lines (618 loc) · 48.1 KB / cli.md Copy path File metadata and controls 991 lines (618 loc) · 48.1 KB Raw Copy raw file Download raw file Outline Edit and raw actions Zapier CLI Command Reference These are the generated docs for all Zapier platform CLI commands.
You can install the CLI with npm install -g zapier-platform-cli . $ npm install -g zapier-platform-cli Commands analytics Show the status of the analytics that are collected. Also used to change what is collected. Usage : zapier-platform analytics Flags -m, --mode | Choose how much information to share. Anonymous mode drops the OS type and Zapier user id, but keeps command info. Identifying information is used only for debugging purposes.
One of [enabled | anonymous | disabled] . -d, --debug | Show extra debugging output. Examples zapier-platform analytics --mode enabled build Build a pushable zip from the current directory. Usage : zapier-platform build This command does the following: Creates a temporary folder Copies all code into the temporary folder Adds an entry point: zapierwrapper.js Generates and validates app definition. Detects dependencies via esbuild (optional, on by default) Zips up all needed .js files.
If you want to include more files, add a "includeInBuild" property (array with strings of regexp paths) to your .zapierapprc . Moves the zip to build/build.zip and build/source.zip and deletes the temp folder This command is typically followed by zapier-platform upload . Flags --disable-dependency-detection | Disable "smart" file inclusion. By default, Zapier only includes files that are required by your entry point ( index.js by default).
If you (or your dependencies) require files dynamically (such as with require(someVar) ), then you may see "Cannot find module" errors. Disabling this may make your build.zip too large. If that's the case, try using the includeInBuild option in your .zapierapprc . See the docs about includeInBuild for more info. --skip-dep-install | [alias: --skip-npm-install] Skips installing a fresh copy of dependencies for shorter build time.
Helpful for using yarn, pnpm, or local copies of dependencies. -d, --debug | Show extra debugging output. canary:create Create a new canary deployment, diverting a specified percentage of traffic from one version to another for a specified duration. Usage : zapier-platform canary:create VERSIONFROM VERSIONTO Only one canary can be active at the same time. You can run zapier-platform canary:list to check. If you would like to create a new canary with different parameters, you can wait for the canary to finish, or delete it using zapier-platform canary:delete a.b.c x.y.z .
To canary traffic for a specific user, use the --user flag. To canary traffic for an entire account, use the --account-id. Note: this scenario is only permitted for Zapier staff. To canary traffic for a specific user within a specific account, use both --user and --account-id flags. Note: this is similar to zapier-platform migrate but different in that this is temporary and will "revert" the changes once the specified duration is expired.
Only use this command to canary traffic between non-breaking versions! Arguments (required) versionFrom | Version to route traffic from (required) versionTo | Version to canary traffic to Flags (required) -p, --percent | Percent of traffic to route to new version (required) -d, --duration | Duration of the canary in seconds -u, --user | Canary this user (email) across all accounts, unless account-id is specified. -a, --account-id | The account ID to target.
If user is specified, only canary the user within this account. If user is not specified, then this argument is only permitted for Zapier staff. -f, --force-include-all | Overrides any default filters the canary system imposes. This argument is only permitted for Zapier staff. -d, --debug | Show extra debugging output. Examples zapier-platform canary:create 1.0.0 1.1.0 -p 10 -d 3600 zapier-platform canary:create 2.0.0 2.1.0 --percent 25 --duration 1800 --user user@example.com zapier-platform canary:create 2.0.0 2.1.0 -p 15 -d 7200 -a 12345 -u user@example.com zapier-platform canary:create 2.0.0 2.1.0 -p 15 -d 7200 -a 12345 canary:delete Delete an active canary deployment Usage : zapier-platform canary:delete VERSIONFROM VERSIONTO Arguments (required) versionFrom | Version to route traffic from (required) versionTo | Version canary traffic is routed to Examples zapier-platform canary:delete 1.0.0 1.1.0 canary:list List all active canary deployments Usage : zapier-platform canary:list Flags -d, --debug | Show extra debugging output. -f, --format | Change the way structured data is presented.
If "json" or "raw", you can pipe the output of the command into other tools, such as jq. One of [plain | json | raw | row | table] . Defaults to table . Examples zapier-platform canary:list convert Convert a Visual Builder integration to a CLI integration. Usage : zapier-platform convert PATH The resulting CLI integration will be identical to its Visual Builder version and ready to push and use immediately! If you re-run this command on an existing directory it will leave existing files alone and not clobber them.
You'll need to do a zapier-platform push before the new version is visible in the editor, but otherwise you're good to go. Arguments (required) path | Relative to your current path - IE: . for current directory. Flags -i, --integrationId | To get the integration/app ID, go to " https://developer.zapier.com ", click on an integration, and copy the number directly after "/app/" in the URL. -v, --version | Convert a specific version.
Required when converting a Visual Builder integration. -j, --json | The JSON definition to use, as alternative for reading from a Visual Builder integration. Must be a JSON-encoded object. The data can be passed from the command directly like '{"key": "value"}', read from a file like @file.json, or read from stdin like @-. -t, --title | The integration title, which will be snake-cased for the package.json name. -d, --description | The integration description, which will be used for the package.json description. -d, --debug | Show extra debugging output. delete:integration Delete your integration (including all versions).
Usage : zapier-platform delete:integration This only works if there are no active users or Zaps on any version. If you only want to delete certain versions, use the zapier-platform delete:version command instead. It's unlikely that you'll be able to run this on an app that you've pushed publicly, since there are usually still users. Flags -d, --debug | Show extra debugging output. Aliases delete:app delete:version Delete a specific version of your integration.
Usage : zapier-platform delete:version VERSION This only works if there are no users or Zaps on that version. You will probably need to have run zapier-platform migrate and zapier-platform deprecate before this command will work. Arguments (required) version | Specify the version to delete. It must have no users or Zaps. Flags -d, --debug | Show extra debugging output. deprecate Mark a non-production version of your integration as deprecated, with removal by a certain date.
Usage : zapier-platform deprecate VERSION DATE Use this when an integration version will not be supported or start breaking at a known date. When deprecating a version, you must provide a reason for the deprecation. You can either specify the reason using the --reason flag or you will be prompted to select from the following options: API endpoint deprecated Security vulnerability Critical bug Legal requirement Other The deprecation d
The rest of this page is on the live site.