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

59 lines
1.5 KiB
Markdown

# Fish Repotool Plugin
A Fish shell plugin for the repotool repository management system.
## Installation
### Using Fisher
```fish
fisher install path/to/fish-repotool
```
### Manual Installation
1. Copy the `conf.d/repotool.fish` file to your fish config directory:
```fish
cp conf.d/repotool.fish ~/.config/fish/conf.d/
```
2. Copy the `functions/repotool.fish` file to your fish functions directory:
```fish
cp functions/repotool.fish ~/.config/fish/functions/
```
## Configuration
Set the `REPOTOOL_PATH` environment variable to specify where your repositories are stored:
```fish
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`