summaryrefslogtreecommitdiff
path: root/FISH_INTEGRATION.md
blob: 0a0ced24057c0633a17becfd5f217ad491c3c11e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
# Fish Shell Integration for foostore

## Installation

### Automatic Installation

```bash
cd /home/paul/git/foostore
./install-fish.sh
```

### Manual Installation

1. Copy the completion file for `foostore`:
```bash
cp completions/foostore.fish ~/.config/fish/completions/
```

2. Copy the wrapper function for `ge`:
```bash
cp completions/ge.fish ~/.config/fish/functions/
```

3. Reload fish shell:
```bash
exec fish
```

## Usage

### `foostore` command

The `foostore` command now has full tab completion:
- Tab complete all subcommands (ls, search, cat, paste, etc.)
- Tab complete file paths for `import`
- Tab complete the `force` flag for import

### `ge` wrapper

The `ge` wrapper provides shortcuts:

```bash
# Interactive mode (no arguments)
ge

# Search shortcut (if not a known command, treats as search)
ge mypassword
# Same as: foostore search mypassword

# Explicit commands still work
ge cat mypassword
ge import file.txt backup/
ge import file.txt backup/ force
```

### Dynamic Entry Completion

For better security, entry completion only works when the `PIN` environment variable is set:

```bash
# Set PIN for session (entries will autocomplete)
set -x PIN yourpin

# Use foostore with autocomplete
ge <TAB>

# Unset PIN when done
set -e PIN
```

Without `PIN` set, commands will still autocomplete, but entry names won't (to avoid prompting for PIN during tab completion).

## Features

- ✓ Dynamic command completion (fetched from `foostore commands`)
- ✓ Smart search fallback in `ge` wrapper
- ✓ Entry name completion (when PIN is set)
- ✓ File path completion for import/export
- ✓ Force flag completion
- ✓ No hardcoded command lists (stays in sync with foostore updates)