repotool/fish-repotool/README.md
2025-08-22 15:20:10 +00:00

1.5 KiB

Fish Repotool Plugin

A Fish shell plugin for the repotool repository management system.

Installation

Using Fisher

fisher install path/to/fish-repotool

Manual Installation

  1. Copy the conf.d/repotool.fish file to your fish config directory:

    cp conf.d/repotool.fish ~/.config/fish/conf.d/
    
  2. Copy the functions/repotool.fish file to your fish functions directory:

    cp functions/repotool.fish ~/.config/fish/functions/
    

Configuration

Set the REPOTOOL_PATH environment variable to specify where your repositories are stored:

set -gx REPOTOOL_PATH "$HOME/my-repos"

If not set, it defaults to $HOME/repo.

Usage

The plugin provides a repo alias that sources the repotool function with the following commands:

  • repo get <url> - Clone a repository if not found
  • repo worktree list - List existing worktrees
  • repo worktree get <name> - Create or go to a worktree
  • repo worktree root - Return to the root directory
  • repo worktree remove <name> - Remove a worktree
  • repo open - Open the current repository in web browser

Hooks

The plugin supports hooks that can be placed in $REPOTOOL_PATH/.hooks/:

  • before_<hook_name>_cd.fish - Executed before changing directory
  • after_<hook_name>_cd.fish - Executed after changing directory

Hooks can also have .sh extension or no extension at all.

Requirements

  • Fish shell 4.0 or later
  • jq for JSON parsing
  • The repotool binary installed at $REPOTOOL_PATH/.bin/repotool