Skip to content

Commit 030d0c0

Browse files
authored
Add instructions for installing shell completions (#167)
1 parent ed6e3f5 commit 030d0c0

1 file changed

Lines changed: 45 additions & 0 deletions

File tree

src/content/docs/cli/installation.mdx

Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,51 @@ sprite use my-project-sprite
8282

8383
This creates a `.sprite` file that the CLI reads automatically. Add `.sprite` to your `.gitignore` as it's user-specific.
8484

85+
## Optional: Install Shell Completions
86+
87+
The CLI provides completion scripts for various shells. Run `sprite help completion` for more information.
88+
89+
### bash
90+
91+
Install the bash completion script by adding it to your `.bashrc`:
92+
93+
```bash
94+
echo 'eval "$(sprite completion bash)"' >> ~/.bashrc
95+
```
96+
97+
### zsh
98+
99+
If you haven't enabled completions in your `.zshrc` yet:
100+
101+
```bash
102+
echo "autoload -U compinit; compinit -i" >> ~/.zshrc
103+
```
104+
105+
Install the zsh completion script by adding it to your local functions:
106+
107+
```bash
108+
sprite completion zsh > ~/.local/share/zsh/site-functions/_sprite
109+
110+
# If the local functions directory isn't in your fpath
111+
echo "fpath=(\"$HOME/.local/share/zsh/site-functions\" \$fpath)" >> ~/.zshrc
112+
```
113+
114+
### fish
115+
116+
Install the fish completion script:
117+
118+
```bash
119+
sprite completion fish > ~/.config/fish/completions/sprite.fish
120+
```
121+
122+
### PowerShell
123+
124+
Install the PowerShell completion script by appending it to your profile:
125+
126+
```powershell
127+
Add-Content $PROFILE "`nsprite completion powershell | Out-String | Invoke-Expression"
128+
```
129+
85130
## Troubleshooting
86131

87132
### Permission Denied

0 commit comments

Comments
 (0)