CI usage
CI usage
The CLI works in non-interactive environments like GitHub Actions, GitLab CI, and other CI/CD pipelines.
Authentication
Pass your ClickUp API token via stdin using --with-token:
echo "$CLICKUP_TOKEN" | clickup auth login --with-tokenStore the token as a CI secret (e.g., GitHub Actions secret, GitLab CI variable). Do not pass it as a command-line argument.
JSON output
All list and view commands support --json for machine-readable output:
clickup task view CU-abc123 --jsonclickup sprint current --jsonclickup inbox --jsonFiltering with --jq
Use --jq to extract specific fields inline:
# Get just the task nameclickup task view CU-abc123 --json --jq '.name'
# List sprint task namesclickup sprint current --json --jq '.[].name'
# Get task IDs in a specific statusclickup sprint current --json --jq '[.[] | select(.status == "in progress") | .id]'GitHub Actions example
name: Update ClickUpon: pull_request: types: [opened, synchronize]
jobs: link-pr: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4
- name: Install clickup CLI run: | curl -sL https://github.com/triptechtravel/clickup-cli/releases/latest/download/clickup_linux_amd64.tar.gz | tar xz sudo mv clickup /usr/local/bin/
- name: Authenticate run: echo "${{ secrets.CLICKUP_TOKEN }}" | clickup auth login --with-token
- name: Link PR to ClickUp task run: clickup link pr ${{ github.event.pull_request.number }} env: GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}Exit codes
| Code | Meaning |
|---|---|
| 0 | Success |
| 1 | General error (API failure, invalid input, etc.) |
Commands that produce no output (e.g., no tasks found) still exit with code 0.