Skip to content

Commit

Permalink
Edit help text
Browse files Browse the repository at this point in the history
  • Loading branch information
eliangcs committed Oct 3, 2024
1 parent bd2e2f9 commit 10911ce
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions packages/cli/src/oclif/commands/invoke.js
Original file line number Diff line number Diff line change
Expand Up @@ -1062,7 +1062,9 @@ InvokeCommand.args = [

InvokeCommand.examples = [
'zapier invoke',
'zapier invoke auth start',
'zapier invoke auth test',
'zapier invoke auth label',
'zapier invoke trigger new_recipe',
`zapier invoke create add_recipe --inputData '{"title": "Pancakes"}'`,
'zapier invoke search find_recipe -i @file.json',
Expand All @@ -1072,11 +1074,21 @@ InvokeCommand.description = `Invoke an auth operation, a trigger, or a create/se
This command emulates how Zapier production environment would invoke your integration. It runs code locally, so you can use this command to quickly test your integration without deploying it to Zapier. This is especially useful for debugging and development.
This command loads \`authData\` from the \`.env\` file in the current directory. Create a \`.env\` file with the necessary auth data before running this command. Each line in \`.env\` should be in the format \`authData_FIELD_KEY=VALUE\`. For example, an OAuth2 integration might have a \`.env\` file like this:
This command loads environment variables and \`authData\` from the \`.env\` file in the current directory. If you don't have an \`.env\` file yet, you can use the \`zapier invoke auth start\` command to help you initialize it, or you can manually create it.
Each line in the \`.env\` file should follow one of these formats:
* \`VAR_NAME=VALUE\` for environment variables
* \`authData_FIELD_KEY=VALUE\` for auth data fields
For example, a \`.env\` file for an OAuth2 integration might look like this:
\`\`\`
authData_access_token=1234567890
authData_other_auth_field=abcdef
CLIENT_ID='your_client_id'
CLIENT_SECRET='your_client_secret'
authData_access_token='1234567890'
authData_refresh_token='abcdefg'
authData_account_name='zapier'
\`\`\`
To test if the auth data is correct, run either one of these:
Expand All @@ -1086,17 +1098,20 @@ zapier invoke auth test # invokes authentication.test method
zapier invoke auth label # invokes authentication.test and renders connection label
\`\`\`
Then you can test an trigger, a search, or a create action. For example, this is how you invoke a trigger with key \`new_recipe\`:
Once you have the correct auth data, you can test an trigger, a search, or a create action. For example, here's how you invoke a trigger with the key \`new_recipe\`:
\`\`\`
zapier invoke trigger new_recipe
\`\`\`
To add input data, use the \`--inputData\` flag. The input data can come from the command directly, a file, or stdin. See **EXAMPLES** below.
When you miss any command arguments, such as ACTIONTYPE or ACTIONKEY, the command will prompt you interactively. If you don't want to get interactive prompts, use the \`--non-interactive\` flag.
The \`--debug\` flag will show you the HTTP request logs and any console logs you have in your code.
The following is a non-exhaustive list of current limitations and may be supported in the future:
- \`zapier invoke auth start\` to help you initialize the auth data in \`.env\`
- \`zapier invoke auth refresh\` to refresh the auth data in \`.env\`
- Hook triggers, including REST hook subscribe/unsubscribe
- Line items
Expand Down

0 comments on commit 10911ce

Please sign in to comment.