Fish shell abbreviations for jj (Jujutsu) - fast shortcuts for common operations.
fisher install HotThoughts/jj.fishRequirements: Fish 3.4+, jj 0.29+
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jjl |
jj log |
jjst |
jj st |
jjll |
jj log --limit |
jjlr |
jj log --revisions |
jjd |
jj describe |
jjdm |
jj describe -m |
jjn |
jj new |
jjnm |
jj new main |
jjnmo |
jj new main@origin |
jja |
jj abandon |
jjr |
jj rebase |
jjrmo |
jj rebase -d main@origin |
jjc |
jj commit |
jjci |
jj commit -i |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jjs |
jj show |
jjdf |
jj diff |
jjid |
jj interdiff |
jjev |
jj evolog |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jje |
jj edit |
jjsq |
jj squash |
jjsqi |
jj squash -i |
jjsp |
jj split |
jjde |
jj diffedit |
jjab |
jj absorb |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jjnx |
jj next |
jjpv |
jj prev |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jjb |
jj bookmark |
jjbl |
jj bookmark list |
jjbs |
jj bookmark set |
jjbt |
jj bookmark track |
jjbd |
jj bookmark delete |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jjop |
jj op |
jjopl |
jj op log |
jju |
jj undo |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jjrs |
jj resolve |
jjrt |
jj restore |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
jjdu |
jj duplicate |
jjrv |
jj revert |
jjpa |
jj parallelize |
| Abbr | Command | Abbr | Command |
|---|---|---|---|
ji |
jj git init --colocate . |
jp |
jj git push |
jf |
jj git fetch |
jnm |
jj new main@origin |
jd |
jj describe -m |
jr |
jj rebase -d main@origin |
jc |
jj commit |
jci |
jj commit -i |
jbt |
jj bookmark track |
jbs |
jj bookmark set |
| Function | Description |
|---|---|
jjad |
AI-generated description via jj describe |
jjac |
AI-generated commit via jj commit |
Uses AI to analyze your changes and generate conventional commit messages.
Supported AI tools (auto-detected):
- GitHub Copilot standalone (
copilot) - Cursor Agent (
cursor-agent) - Claude CLI (
claude)
Usage:
# If only one AI tool is installed, it's used automatically
jjad
# If multiple tools are available, you'll get an interactive selection:
# Multiple AI tools detected. Select one:
# 1) copilot
# 2) cursor-agent
# 3) claude
# Choice [1-3]:
# Or set a preferred tool via environment variable
set -Ux JJ_AI_TOOL copilot # Options: copilot, cursor-agent, claude| Function | Description |
|---|---|
jjpr [change-id] |
Push change and create GitHub PR (defaults to @) |
# Initialize repo and start working
ji
jjst
# Create new change, make edits, describe
jjnm
jjdm "feat: add feature"
# View history and diff
jjl
jjdf
# Push current change and create PR
jjprType abbreviation + space → expands to full command:
jjl+ space →jj logjjst+ space →jj st
# Add your own
abbr --add jjs 'jj show'
# Remove unwanted ones
abbr --erase jjnmThe plugin requires jj to be installed and in your PATH.
Install jj:
# macOS
brew install jj
# Or from source
cargo install --git https://github.com/martinvonz/jj jj-cliVerify installation:
jj --versionThe jjpr function requires the GitHub CLI to create pull requests.
Install gh:
# macOS
brew install gh
# Linux
sudo apt install ghAuthenticate:
gh auth login-
Check plugin is loaded:
abbr --show | grep jj
Should show jj abbreviations.
-
Reload Fish config:
source ~/.config/fish/config.fish
-
Reinstall plugin:
fisher remove HotThoughts/jj.fish fisher install HotThoughts/jj.fish
This occurs when jj doesn't output the expected branch name format after pushing.
Workaround:
- Push manually:
jj git push -c <change-id> - Note the branch name from output
- Create PR manually:
gh pr create --head <branch-name>
Report: If this happens consistently, please file an issue with your jj version (jj --version).
The jjpr function automatically detects your repository's default branch (main, master, develop, etc.) and creates PRs against it. No configuration needed.
Ensure you're using a valid change ID from jj log:
jjl # View change history
jjpr abc123def # Use the change ID prefix (first 7-12 chars)This project uses pre-commit to run automated checks before pushing to ensure code quality.
Setup (one-time):
# Install pre-commit (if not already installed)
brew install pre-commit # macOS
# or: pip install pre-commit
# Install the git pre-push hook
pre-commit install --hook-type pre-pushWhat gets checked:
- Fish shell syntax validation (
fish --no-execute) - Fish shell indentation (
fish_indent --check) - Trailing whitespace and end-of-file fixes
- YAML validity
- Test suite execution
Manual runs:
# Run all hooks on all files
pre-commit run --hook-stage pre-push --all-files
# Run specific hook
pre-commit run --hook-stage pre-push fish-syntax-check
# Auto-fix formatting issues
pre-commit run --hook-stage pre-push --all-filesIntegration with jj:
Since jj doesn't natively trigger git hooks (see jj issue #405), you can configure a jj alias to run pre-commit checks on jj-tracked changed files.
Setup (one-time):
Add this alias to .jj/repo/config.toml:
[aliases]
pre-commit = [
"util",
"exec",
"--",
"fish",
"-c",
"jj diff -r @ --name-only --no-pager | xargs pre-commit run --files",
]This alias runs pre-commit checks only on files changed in your current change (using jj diff -r @ --name-only), making it fast and efficient.
Usage:
jj pre-commit # Runs pre-commit checks on changed files in current changeManual runs (all files):
pre-commit run --hook-stage pre-push --all-filesManual runs (changed files only, using jj):
# Get changed files from jj and run pre-commit on them
jj diff -r @ --name-only --no-pager | xargs pre-commit run --filesMIT