Skip to content

Commit

Permalink
updated readme
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasticrabbit committed Nov 12, 2021
1 parent 284cd13 commit 01e4b70
Showing 1 changed file with 23 additions and 12 deletions.
35 changes: 23 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,37 @@
## Configuration

1. In the [ClickUp web app](https://app.clickup.com), create a new application in the Clickup Menu > Settings > Integrations > Clickup API.
1. Define `http://localhost:<port#>` as the callback URL.
1. Define `http://localhost:<port#>` as the callback URL. The CLI defaults to 4321, but you may use any valid port and configure the CLI.
1. Copy the app client id and secret, and redirect port number from the Clickup UI and set as environment variables in your local environment:

```
export CLICKUP_CLIENT_ID=xxx
export CLICKUP_CLIENT_SECRET=xxx
export CLICKUP_REDIRECT_PORT=9999 (optional, CLI will default to port 4321, just make sure it matches the Clickup custom app definition as described above.)
export CLICKUP_PORT=9999
```

## SET command

1. You can optionally set the local host port with the set command:
```
clickup set --port=1234
```
1. If your space is using custom Task ID's, you will need to set the Team ID. Grab this code from your Clickup web app URL, the first parameter after "https://app.clickup.com/1234567/...".
```
clickup set --team=1234567
```
1. Both parameters can be set in the same command, or provided as environment variables with the "CLICKUP_" prefix.

## Usage

### Authentication
1. The first time the app is used, it will open a browser and ask the user to log in to ClickUp to give the client app permission to exchange data with the corresponding workspace. The client may only be used with one workspace at a time.
1. The first time the app connects to the Clickup API, it will open a browser and prompt the user to give the client app permission to exchange data with a workspace. The client may only be used with one workspace at a time.

1. ClickupCLI will save your authentication token in $HOME/.clickup/config.yaml. To delete the token issue the logout subcommand:
```
clickup logout
```
1. This will clear the token, requiring the user to re-authenticate the next time the client app is executed.

### Get Task

Expand All @@ -25,20 +43,13 @@ export CLICKUP_REDIRECT_PORT=9999 (optional, CLI will default to port 4321, jus
```

1. Task details will be output in JSON to StdOut.
1. If Clickup space is using custom task IDs, set the `CLICKUP_TEAM_ID` env variable to your organization team ID, and pass the -c flag:
1. If Clickup space is using custom task IDs, be sure to set the Team ID with either the set command or env variable, and pass the -c flag:
```
clickup get task CUSTOM-1234 -c <short>
clickup get task CUSTOM-1234 --custom <long/explicit>
```
1. To include sub-tasks in the JSON output, add the -s flag:
1. To include sub-tasks in the JSON output, add the -s/--subtasks flag:
```
clickup get task 123456 -s
clickup get task 123456 --subtasks
```

### Logout
1. ClickupCLI will save your authentication token in $HOME/.clickup/config.yaml. To delete the token issue the logout subcommand:
```
clickup logout
```
1. This will clear the token, requiring the user to re-authenticate the next time the client app is executed.

0 comments on commit 01e4b70

Please sign in to comment.