The stkd
CLI tool is designed to simplify the workflow of managing stacked pull requests. By automating common tasks such as creating, syncing, pushing, and converting branches into stacks, this tool helps developers focus on delivering high-quality code without worrying about the complexities of maintaining stack hierarchies.
stkd new
Creates a new stack branch based on the current branch.
stkd new
.stkd
metadata file stored in the repository.git checkout feature/add-login
stkd new
# Prompt: Enter the name for the new stack: feature/add-logout
# Result: Creates a new branch `feature/add-logout` stacked on `feature/add-login`.
stkd sync [--push]
Rebases all stack branches from their respective parent branches.
stkd sync
--push
: Rebases all stack branches and automatically pushes the updated branches to the remote repository..stkd
metadata file.# Rebase all stacks locally:
stkd sync
# Rebase and push all stacks:
stkd sync --push
Rebasing feature/add-logout onto feature/add-login...
Rebasing feature/add-settings onto feature/add-logout...
Sync complete!
stkd push
Pushes all stack branches to the remote repository.
stkd push
origin
).stkd push
# Output: Pushing feature/add-login, feature/add-logout, and feature/add-settings to origin.
stkd pr
Creates pull requests for all stack branches.
stkd pr
stkd pr
# Output:
# Creating PR for feature/add-login...
# Creating PR for feature/add-logout with base feature/add-login...
# Creating PR for feature/add-settings with base feature/add-logout...
# All PRs created successfully!
stkd convert
Converts the current branch into a stack managed by stkd
.
stkd convert
.stkd
metadata to include the current branch in the stack hierarchy.git checkout feature/refactor-auth
stkd convert
# Prompt: Enter the parent branch for this stack: main
# Output: feature/refactor-auth has been converted to a stack with parent main.
The stkd
tool can be configured via a .stkdconfig
file located in the root of your repository.
.stkdconfig
{
"remote": "origin",
"defaultBranch": "main",
"prTemplate": ".github/pull_request_template.md",
"stackMetadataFile": ".stkd"
}
remote
: The name of the Git remote to use (default: origin
).defaultBranch
: The default branch for the repository (e.g., main
or master
).prTemplate
: Path to a pull request template to use for creating PRs.stackMetadataFile
: Path to the file where stack metadata is stored.git checkout feature/add-login
stkd new
# Prompt: Enter the name for the new stack: feature/add-logout
# Creates branch feature/add-logout based on feature/add-login.
stkd sync
# Rebases all stack branches from their parent branches.
stkd push
# Pushes all stack branches to the remote repository.
stkd pr
# Creates a pull request for each stack branch, linking them in a hierarchical chain.
stkd sync
:
.stkd
file is not corrupted or manually edited.For verbose output, use the --verbose
flag:
stkd sync --verbose
For further assistance, please contact the development team or open an issue on our GitHub repository.