Skip to content

yuirsilva/pr-to-clickup

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

PR-to-ClickUp CLI Tool

A CLI tool that pushes commits, creates GitHub PRs, and automatically updates linked ClickUp tasks.

Features

  • Git push with automatic upstream tracking
  • GitHub PR creation with auto-generated titles from branch names
  • ClickUp integration:
    • Extracts task ID from branch name
    • Posts comment with PR link and description
    • Updates task status to "REVIEW - TECH MANAGER"
  • Clipboard image support - attach screenshots directly from Windows clipboard

Installation

  1. Clone this repository
  2. Install dependencies:
    npm install
  3. Build the project:
    npm run build
  4. Link globally:
    npm link

Configuration

Create a .env file in one of these locations (checked in order):

  1. ~/.pr-to-clickup/.env (recommended - works from any directory)
  2. Current working directory .env
  3. Package installation directory

Windows: C:\Users\YourName\.pr-to-clickup\.env Mac/Linux: ~/.pr-to-clickup/.env

# Required
GITHUB_TOKEN=ghp_xxxxxxxxxxxxxxxxxxxx
CLICKUP_API_TOKEN=pk_xxxxxxxxxxxxxxxxxxxx

# Optional
CLICKUP_REVIEW_STATUS=REVIEW - TECH MANAGER
PR_TARGET_BRANCH=main

Getting Your Tokens

GitHub Token:

  1. Go to GitHub → Settings → Developer settings → Personal access tokens
  2. Generate a new token with repo scope

ClickUp Token:

  1. Go to ClickUp → Settings → Apps
  2. Click "Generate" under API Token

Usage

Basic push (no PR)

push

Create PR

push -pr

Create PR with description

push -pr "Added login functionality and fixed validation bugs"

Create PR with clipboard image

push -pr "Updated the dashboard UI" --image

Create draft PR

push -pr "WIP: New feature" --draft

Create PR to specific branch

push -pr --target develop

Manually specify task ID

push -pr --task BZP-12345

Skip ClickUp integration

push -pr --skip-clickup

Only create PR (skip git push)

push -pr --no-push

Interactive Prompts

If no ClickUp task ID is found in the branch name, you'll be prompted:

⚠ No ClickUp task ID found in branch name
Enter task ID (e.g., BZP-12345) or press Enter to skip: _

You can either:

  • Type the task ID and press Enter
  • Press Enter to skip ClickUp integration

Branch Naming Convention

The tool automatically extracts ClickUp task IDs from branch names. The task ID should have an UPPERCASE prefix (2-4 letters) followed by a hyphen and alphanumeric ID.

Supported formats (the tool finds the last matching pattern):

  • Testing-BZL-1740BZL-1740
  • Concursos-GAL-Agendamento-BZP-22655BZP-22655
  • feature/CU-86c26xjrq-descriptionCU-86c26xjrq
  • fix/ABC-123ABC-123

The prefix must be uppercase letters (e.g., BZP, CU, ABC).

What Happens When You Run push -pr

  1. Git Push - Pushes your commits to the remote
  2. Create PR - Creates a GitHub PR with:
    • Title generated from branch name (or custom if provided)
    • Body with ClickUp task link, description, and commit list
  3. ClickUp Comment - Adds a comment to the task with:
    • PR link
    • Description (if provided)
    • Screenshots (if --image flag used)
  4. Status Update - Changes task status to "REVIEW - TECH MANAGER"

Troubleshooting

"No ClickUp task ID found in branch name"

  • Make sure your branch name includes the task ID (e.g., feature/CU-abc123-description)

"Status not found"

  • The status name in your ClickUp list might be different
  • Update CLICKUP_REVIEW_STATUS in your .env file

"Clipboard image support is only available on Windows"

  • The --image flag currently only works on Windows

License

MIT

About

Push to GitHub -> create a PR -> comment on Clickup task && change task status

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors