mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2026-08-07 06:08:39 +02:00
feat(pitchfork): add pitchfork plugin
This commit is contained in:
parent
887a864aba
commit
041cf673b0
2 changed files with 57 additions and 0 deletions
40
plugins/pitchfork/README.md
Normal file
40
plugins/pitchfork/README.md
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
# pitchfork
|
||||
|
||||
Adds integration with [pitchfork](https://github.com/jdx/pitchfork), a devilishly good process manager for
|
||||
developers. Pitchfork manages background daemons and services for local development environments, automatically
|
||||
starting and stopping them as you navigate between project directories.
|
||||
|
||||
## Installation
|
||||
|
||||
1. [Download & install pitchfork](https://github.com/jdx/pitchfork#installation) by running the following:
|
||||
|
||||
```bash
|
||||
mise use -g pitchfork
|
||||
```
|
||||
|
||||
Or install via Cargo:
|
||||
|
||||
```bash
|
||||
cargo install pitchfork-cli
|
||||
```
|
||||
|
||||
2. [Enable pitchfork](https://pitchfork.jdx.dev) by adding it to your `plugins` definition in `~/.zshrc`.
|
||||
|
||||
```bash
|
||||
plugins=(pitchfork)
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
See the [pitchfork docs](https://pitchfork.jdx.dev) for full information. Here are a few examples:
|
||||
|
||||
```bash
|
||||
pitchfork start --all Start all configured daemons
|
||||
pitchfork stop Stop running daemons
|
||||
pitchfork status Show status of all daemons
|
||||
pitchfork logs [name] View logs for a daemon
|
||||
pitchfork tui Open the terminal dashboard
|
||||
```
|
||||
|
||||
The plugin loads pitchfork's shell hook (`pitchfork activate zsh`), which automatically starts and stops
|
||||
daemons when you enter or leave a project directory, and sets up zsh tab-completions.
|
||||
17
plugins/pitchfork/pitchfork.plugin.zsh
Normal file
17
plugins/pitchfork/pitchfork.plugin.zsh
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
if (( ! $+commands[pitchfork] )); then
|
||||
return
|
||||
fi
|
||||
|
||||
# Load pitchfork hooks
|
||||
eval "$(pitchfork activate zsh)"
|
||||
|
||||
# If the completion file doesn't exist yet, we need to autoload it and
|
||||
# bind it to `pitchfork`. Otherwise, compinit will have already done that.
|
||||
if [[ ! -f "$ZSH_CACHE_DIR/completions/_pitchfork" ]]; then
|
||||
typeset -g -A _comps
|
||||
autoload -Uz _pitchfork
|
||||
_comps[pitchfork]=_pitchfork
|
||||
fi
|
||||
|
||||
# Generate and load pitchfork completion
|
||||
pitchfork completion zsh >| "$ZSH_CACHE_DIR/completions/_pitchfork" &|
|
||||
Loading…
Reference in a new issue