Add file browser, tests, and bin entrypoint

This commit is contained in:
seb
2026-09-23 01:39:39 +02:00
parent 80bd648412
commit 9f61a05e8b
7 changed files with 764 additions and 1 deletions

View File

@@ -27,6 +27,34 @@ fido /path/to/project # work on a specific directory
Set `OPENROUTER_API_KEY` (and optionally `TAVILY_API_KEY`) in `~/.fido/.env`.
### File mentions
While typing a message, press **`Ctrl+O`** to open an in-prompt file browser.
It is `.gitignore`-aware and hides dot-directories, just like `list_files`.
| Key | Action |
| ----------- | -------------------------------------------------- |
| `↑` / `↓` | Move the highlight |
| `Enter` | Descend into a directory, or open the line selector|
| `Tab` | Mention the highlighted file (whole file) |
| `Backspace` | Go to the parent directory |
| `Esc` | Cancel back to the prompt |
In the line selector, `↑`/`↓` move the cursor, `v` starts/ends a range, `g`/`G`
jump to the first/last line, and `Enter` inserts the mention.
The mention is plain text spliced in at the cursor; the model reads the file
itself via `read_file` (it is a *reference*, not embedded contents):
| Selection | Inserted text |
| ----------- | ----------------------- |
| Whole file | `@src/fido.js` |
| Line range | `@src/fido.js:120-145` |
| Single line | `@src/fido.js:120` |
Paths are relative to the workspace root with forward slashes; line numbers are
1-based (the model maps them to `read_file`'s 0-indexed `seek`).
### Layout
```