npm install -g @techlove/gitclick
Add the following environment variables to ./.env
:
GITCLICK_CLICKUP_PERSONAL_TOKEN="your_clickup_token"
GITCLICK_GITHUB_PERSONAL_TOKEN="your_github_token"
GITCLICK_GITHUB_BASE_BRANCH="your_base_branch" # (optional) default: "main"
Or export them from your shell rc file, (~/.bashrc
or ~/.zshrc
etc):
export GITCLICK_CLICKUP_PERSONAL_TOKEN="your_clickup_token"
export GITCLICK_GITHUB_PERSONAL_TOKEN="your_github_token"
export GITCLICK_GITHUB_BASE_BRANCH="your_base_branch" # (optional) default: "main"
glick
gitclick sync --undraft
gitclick sync SOME-1337
Task Tags will be used to try to set a branchType
prefix.
If the Task with Task Custom ID SOME-1337
has the Task Tag bug
, the Branch Name will be bugfix/some-1337
.
If the Task with Task Custom ID SOME-1337
has the Task Tag Feature
, the Branch Name will be feature/some-1337
.
gitclick sync SOME-1337 --undraft
-
A Pull Request will be created, if it doesn't already exist
-
The Pull Request Title will be set to the current Task Name
-
The Pull Request Body will be set to include a link to the Task
-
The Pull Request Body will be set to include the current Markdown Description of the Task
-
A Task Comment will be created in the Task, containing the Pull Request URL, if such a Task Comment doesn't already exist in the Task
If not provided, the current Branch will be used. The current Branch must include a Task Custom ID of an existing Task.
If provided, a new Branch will be created with GITCLICK_GITHUB_BASE_BRANCH
as its Base Branch. At least subargument taskId
must be included.
A string to use as prefix of the new Branch Name. Commonly feature
, bugfix
, refactor
or docs
etc (See GitClick.branchTypes). If not provided, current Task Tags will be used to try to set a branchType
.
A character separating branchType
and taskId
. Commonly /
or -
. Must be /
if using an uncommon branchType
string.
The Task Custom ID of an existing Task.
A Branch Name suffix. May include spaces, as it will be normalized.
If provided, the Pull Request will be set to Ready for review
.
Note: If you want to set a Ready for review
Pull Request back to Draft
, you currently need to do it manually in GitHub due to GitHub API limitations.
If provided, will override GITCLICK_GITHUB_BASE_BRANCH
.
gitclick sync SOME-1337-important-changes
gitclick sync SOME-1337 lots of stuff
gitclick sync bug/SOME-1337 important changes
gitclick sync what/SOME-1337 are you sure
gitclick
is an alias for gitclick sync
.
glick
is an alias for gitclick
.
The following commands are all valid aliased gitclick sync
commands:
glick
gitclick
glick SOME-1337
gitclick SOME-1337
glick feature/SOME-1337
gitclick feature/SOME-1337
glick SOME-1337-important-changes
gitclick SOME-1337-important-changes
glick bug/SOME-1337-important-changes
gitclick bug/SOME-1337-important-changes
glick feature/SOME-1337 important changes
gitclick feature/SOME-1337 important changes
The same commands, but non-aliased:
gitclick sync
gitclick sync SOME-1337
gitclick sync feature/SOME-1337
gitclick sync SOME-1337-important-changes
gitclick sync bug/SOME-1337-important-changes
gitclick sync feature/SOME-1337 important changes
Slightly opinionated.
Currently the only command is gitclick sync
, additional commands may be added later.
Assumes the format of your Task Custom ID matches /^([a-zA-Z]+\-[\d]+)$/g
.
Because everything that can be automated should be automated.
I got tired of manually copy pasting names and descriptions, maybe you are too.
If I'm automating something for my own use, I might as well share it, because others may want to do the same thing, however specific the application.
If you're reading this in the future there may be a way of doing this using native Clickup Automations.
If you're using Clickup you might find this tool useful, if not, you've wasted a lot of time reading all the way to this point of the README and should probably go do something else.
@techlove/gitclick is open source software licensed as MIT.