Commit Graph
202 Commits
Author SHA1 Message Date
VERSE b5734b4e85 docs: theme config and list of theme templates (#116)
- Added theme configuration guide in README
- Added some theme templates
- Added list of theme templates in `themes/`
2026-08-04 15:15:21 +07:00
b14b26e663 feat(config): add theme customization (#81)
Added theme customization via config.toml
#17
```
[theme]
border = "#665C54"
accent = "#FABD2F"
muted = "#928374"
text = "#EBDBB2"
text_sel = "#FBF1C7"
match = "#FE8019"
desc = "#A89984"
desc_sel = "#EBDBB2"
sel_bg = "#504945"
scroll_info = "#83A598"
ghost_text = "#7C6F64"
hist= "#fe8019"
hist_sel = "#d65d0e"
sys = "#fb4934"
sys_sel = "#cc241d"
alias = "#b8bb26"
alias_sel = "#98971a"


```

---------

Co-authored-by: verse91 <versedev.store@proton.me>
Co-authored-by: VERSE <sunnyone0901@gmail.com>
2026-08-04 13:49:10 +07:00
VERSE b79d25a082 docs(readme): add navigate-right config 2026-08-03 18:50:04 +07:00
Ashvin Singh dfaa051f31 fix: make Right Arrow configurable and correct overlay positioning (#110)
## Summary

Closes #108

This PR fixes two issues related to terminal interaction and rendering:

- Make Right Arrow ghost acceptance configurable instead of hard-coded.
- Correct overlay positioning when the shell prompt wraps across
terminal lines.

## Changes

### Right Arrow configuration

- Add a new `navigate-right` keybinding to the configuration.
- Add `navigate-right = "right"` to the default configuration to
preserve existing behavior.
- Update the wrapper to use the configured binding instead of a
hard-coded Right Arrow check.
- Forward the Right Arrow escape sequence to the PTY when
`navigate-right` is unset, allowing the shell or terminal to handle it
normally.

### Overlay positioning

- Compute the cursor's current column from the total visual width
instead of using the accumulated width directly.
- Correctly handle wrapped prompts by calculating the cursor column
modulo the terminal width.
- Clamp the overlay position so it never extends beyond the terminal
width.
- Extend debug logging with the computed cursor position to aid
troubleshooting.

## Why

Right Arrow ghost acceptance was previously implemented as a hard-coded
behavior, making it impossible to disable or remap through
configuration. This change makes it consistent with the existing
configurable keybindings while preserving the default behavior.

Overlay positioning assumed that the prompt length represented the
cursor's current column. When the prompt wrapped onto a new terminal
line, this assumption caused the suggestion overlay to be positioned
incorrectly. Computing the cursor column from the wrapped position
ensures the overlay is aligned with the actual cursor.

## Testing

- [x] Default configuration retains Right Arrow ghost acceptance.
- [x] Setting `navigate-right = ""` forwards Right Arrow to the shell.
- [x] Existing keybindings continue to function as before.
- [x] Overlay is correctly positioned for both short and wrapped
prompts.
- [x] Overlay remains within terminal bounds.
2026-08-03 18:48:53 +07:00
shemishtameshandshemishtamesh 0b77c9334b fix(spec): isolate __complete probe from the controlling terminal (#111)
run the `__complete` probe subprocess in its own session so that a
cobra-incompatible binary that ignores `__complete` can't mess with the
user's controlling terminal.
tested on both macos and nixos.
encountered the problem while trying to use
[visidata](https://www.visidata.org/).

---------

Co-authored-by: shemishtamesh <shemishtamail@gmail.com>
2026-08-03 17:05:47 +07:00
d669e97423 fix: support kitty keyboard protocol for ctrl keybindings (#101)
Fixes #88

## Root cause

`MatchKey` treated `Ctrl+M` and the Enter key as the same raw byte
(`0x0d`). After editing the generated config, a `ctrl+m` binding could
shadow Enter, causing Return to toggle mode instead of executing the
selected command.

While investigating this, I also found that `MatchKey` only recognized
raw control bytes for `ctrl+<letter>` bindings. In Fish and terminals
that use the Kitty keyboard protocol (e.g. Kitty and Foot), those key
combinations may instead be sent as CSI sequences such as `\x1b[106;5u`,
preventing navigation bindings like `ctrl+j` / `ctrl+k` from being
matched.

## Changes

* `internal/config/keys.go`

* Reserve the Enter byte (`0x0d`) so it cannot be claimed by a `ctrl+m`
keybinding.
* Add `matchKittyCtrl()` to support Kitty keyboard protocol CSI
sequences for `ctrl+<letter>` bindings when the Ctrl modifier is
present.
* `root/wrapper.go`

* Extract `handleNavKey()` to remove duplicated navigation handling
logic.
* `internal/config/config_test.go`

* Add regression tests covering the Enter/`ctrl+m` fix and Kitty
keyboard protocol key sequences.

## Tested

* `go test ./...` — 201 passed
* Verified that Enter is no longer shadowed by `ctrl+m` after editing
the generated config.
* Verified that `ctrl+j` / `ctrl+k` navigation works correctly in Fish.

---------

Co-authored-by: verse91 <versedev.store@proton.me>
Co-authored-by: VERSE <sunnyone0901@gmail.com>
2026-08-02 14:40:55 +07:00
VERSE 6faa2e3274 feat(spec): support tool aliases (#107)
closes #57

IRIS now automatically read and suggest internal configuration aliases
for Git (`.gitconfig`, `.git/config`) and Cargo (`.cargo/config.toml`)

- Added the `Provider` interface and extended registry for CLI tools
that define aliases
- Git: parse aliases via `git config --show-scope`, supporting raw
tab/space separation and scope differentiation
- Cargo: traverse the directory tree upwards to root to read the
`.cargo/config.toml` configuration
- 0ms hot-path caching: key caching is calculated entirely via `os.Stat`
mtime (no subprocess spawn) combined with a 2-second TTL window to
ensure 0ms latency when typing
- Lookup integration: display alias suggestions at the subcommand level
and automatically expand aliases as the user enters further arguments
(ignore shell pipeline commands starting with `!`)
2026-08-02 14:30:46 +07:00
M57 476ca3946b fix: update stale vendorHash after lipgloss v2 upgrade (#99)
Commit `efc49ba` (feat: upgrade to lipgloss v2, #94) changed
`go.mod`/`go.sum` (lipgloss v1 → v2, ~24 dependency version bumps) but
did not update `vendorHash` in `flake.nix`.

As a result `nix build .#iris` (and any consumer) fails with a
fixed-output derivation hash mismatch:

```
error: hash mismatch in fixed-output derivation 'iris-<rev>-go-modules.drv':
         specified: sha256-kBSMhUsuCKIjAXjGfl1WSjCX+tlGi9BTnkRu9ScW6M0=
            got:    sha256-KQNloP/Aj283YQ4d5LFu/2Pbb2HbVTZPhLK1fs4xvGw=
```

This one-line change updates `vendorHash` to the hash actually produced
by the module set at HEAD. Verified: `nix build .#iris` succeeds with
the corrected hash.

Run `nix flake update` afterwards to regenerate `flake.lock`.
2026-08-01 18:51:42 +07:00
Kieran Klukas df42c95fa9 feat: adopt x/ansi instead of hand rolling escape sequences (#96)
also contains the lipgloss width change from #94
2026-08-01 16:30:52 +07:00
Kieran Klukas efc49bacfe feat: upgrade to lipgloss v2 (#94)
Hi! 

I upgraded lipgloss to v2 and also took the opportunity to migrate some
of the raw escape sequence handling to x/ansi. Feel free to cherry pick
whatever is helpful from this!
2026-08-01 00:19:16 +07:00
VERSE 23bd718899 docs(readme): reorder badge and description 2026-07-31 23:21:30 +07:00
VERSE bf75dc239b feat(path): support for XDG base directories (#95)
closes #93
2026-07-31 22:58:09 +07:00
VERSE aba4dc9716 chore(readme): #2 repo of the day badge
Updated README to include Trendshift badge and reordered platform badges.
2026-07-31 22:41:32 +07:00
verse91 9786f14158 chore(aur): transfer the aur maintainer 2026-07-31 22:31:25 +07:00
VERSE 8a1cec331a fix(overlay): dynamic select key ui component (#90)
closes #85
2026-07-31 19:03:38 +07:00
VERSE 235a7f98ea fix(config): resolve enter key submission and keybinding issues (#89)
closes #88
closes #85
2026-07-31 18:38:31 +07:00
verse91 85a9a7d55d fix(release): rename AUR package to iris-cli-bin due to upstream conflict 2026-07-31 17:48:27 +07:00
verse91 331f4c176c chore(release): release v0.4.18 2026-07-31 17:45:12 +07:00
verse91 84a7064e6a fix(release): correct AUR git url and workflow secret mapping 2026-07-31 17:32:38 +07:00
verse91 e4d799bdd8 chore(gitignore): ignore vendor directory and generated tarballs 2026-07-31 17:29:37 +07:00
verse91 15b5cccc42 fix(release): use preremove instead of prerm for goreleaser v2 compatibility 2026-07-31 17:23:21 +07:00
VERSEanduse-the-fork e09f4609f6 build: support pkg managers installation (#87)
closes #71, #84, #86
- AUR
- Homebrew
- Nix
- Debian (.deb)
- RPM (.rpm)
- Aqua
- ASDF

This is my first time doing this, so there might be mistakes. If you
can't download it through any pkg manager, please leave a comment or
open an issue

---------

Co-authored-by: use-the-fork <23747916+use-the-fork@users.noreply.github.com>
2026-07-31 17:16:31 +07:00
VERSE e9e50c7dea fix(history): respect zdotdir config (#83)
closes #82

Also added a `HISTFILE` so it always reads the correct file that the
shell is pointing to

Is there a `HISTFILE`? If so, use it
If it's Zsh: Is there a `ZDOTDIR`? Use `ZDOTDIR/.zsh_history`
If it's Fish: Is there an `XDG_DATA_HOME`? Use
`XDG_DATA_HOME/fish/fish_history`
If none of them are present, revert to the default `$HOME/...`
2026-07-31 15:12:49 +07:00
verse91 9663788de6 fix(config): sync config_cmd.go template with init.go template 2026-07-31 11:05:28 +07:00
VERSE 4421d6e6a5 docs(readme): warning about potential conflicts 2026-07-31 10:55:54 +07:00
VERSE a885c7462a feat(config): ui width, auto exec, selection and navigation configs (#80)
closes #67

So I made an auto-exec confg `auto-exec = true`
(e32c0ba6ed69f3c764353e58b8fbacf160f37d5a) which means:
- If you want your command in the prompt to be executed right away, you
can set this = false (for example, you are typing `nvim ~/.conf` but
IRIS is suggesting `nvim ~/.config`, it will ignore the suggestion and
exec what you are typing, this is current default behavior)
- If you want to auto execute full command which is being suggested, you
can set this = true (this is the opposite of above, when you are typing
`nvim ~/.conf` but IRIS is suggesting `nvim ~/.config`, it will auto
exec `nvim ~/.config` instead, but sometime you want to exec what you
are typing instead of the suggestion right?, just press esc or shift tab
to hide the menu and it will)

---

Select keybinding to replace tab
(0dc01cba8c610e8d6fd8c50f6a71bdcc061a098f)
`select = "ctrl+y"`

Some users may love nvim keybinding or emacs, so I bring navigation
keybinding to be configurable (0dc01cba8c610e8d6fd8c50f6a71bdcc061a098f)
```
navigate-up = "ctrl+k"
navigate-down = "ctrl+j"
```
---

I also added a option for UI width
(dfa3b810a7be406fe4652b3886020f37bb166811)
`max-width = 80`
- If you configure `max-width` to be larger than the actual width of the
current terminal, Iris will automatically "compress" the window to match
the terminal's width (meaning it will never overflow and break the
interface)
- If you configure `max-width` too small (e.g 10), the interface will
have cramped text, making it look very bad. So, I've set a minimum safe
min limit of 40. If the configured value is smaller than this, Iris will
automatically use 40

Small note: If you set `max-width = 0` (or leave it blank), it will
automatically use Iris's default standard size of 76. SO you can
confidently customize it without fear of breaking the UI (I hope so
lmao)

---

Added a fallback to ensure Iris never crashes or loses shortcuts if the
user accidentally deletes keybinding configuration lines or
intentionally assigns empty strings " "
(f682c9bf623f3ed46ad0763221145604dbd91b07)

Fix typo `toggle_mode` to `toggle-mode`
(b39be6673e552735fa65a6c9807510c83b4d9cdd)

if you have a better config design, please tell me, I always listen to
your idea
2026-07-31 10:49:10 +07:00
Pavel NaumovandPavel Naumov 9f43fcb352 fix: sync shell working directory for suggestions (#78)
## Summary
- synchronize the shell current working directory with Iris over the
existing IPC pipe
- use the synchronized directory for file, workspace, Git, and history
suggestions on macOS
- preserve the Linux `/proc/<pid>/cwd` and process-CWD fallbacks
- update zsh, bash, and fish integrations while preserving command exit
status

## Problem
On macOS, `/proc/<pid>/cwd` is unavailable, so `GetCWD` fell back to the
directory where Iris was launched, usually `$HOME`. After changing
directories in the shell, file suggestions could therefore continue to
come from `$HOME`.

## Tests
- `go test -race ./spec`
- `go test ./root -run ^'$'`
- `go test ./... -run ^'$'`
- generated zsh, bash, and fish hook syntax checks

Co-authored-by: Pavel Naumov <Pavel.Naumov@berekebank.kz>
2026-07-31 10:01:05 +07:00
Paolo Ricciuti cee756e2c1 fix: arrow up history entries (#77)
Closes #76 

Session history was recorded only after receiving `IRIS_CMD_STOP`.
Directly launched Bash sessions may not install that completion hook,
and Bash does not flush `.bash_history` until the shell exits.

There was also a race where `Enter` was sent to the shell before Iris
stored the submitted command, allowing fast commands to finish before
the command was captured.

The fix is

- Record commands in session history immediately when they are
submitted.
- Store the submitted command before sending Enter to the shell.
- Keep command-completion handling responsible for exit-code and
frecency data.

Once again (and please tell me if you prefer not) I'm not fluent in `go`
so this was all Sol
2026-07-31 09:53:31 +07:00
Paolo Ricciuti 2573ad73b4 feat: add shell login option (#75)
Closes #72
2026-07-30 22:45:23 +07:00
VERSE 37182f7212 fix(history): substring fuzzy search (#74)
closes #73

<img width="1434" height="302" alt="image"
src="https://github.com/user-attachments/assets/87bb8431-40c7-4ee8-ad58-79c4fea6efa7"
/>

I used use prefix match
imagine you have a long command ENOUGH that you used to use (like
image), with fuzzy search + substring, it will always show suggestion
about that command in the list but in the bottom
and I see this very annoying

but now I limit the score from fuzzy search, if the command is too long
(which means fuzzy score is extremely weak), skip it right away

<img width="1296" height="437" alt="image"
src="https://github.com/user-attachments/assets/77d807a2-ddce-4c37-9f5b-a02cd44de325"
/>

it now has substring support
2026-07-30 21:11:34 +07:00
VERSE 0049256844 docs: move user guide to top level readme (#70)
- I moved all information from user guide docs to top level readme so
now people can find information about IRIS easier and faster
- Also, some people always ask me how to uninstall while uninstall
subcommand already in IRIS, I've added to docs
- Corrected the way to install with go command
2026-07-30 13:27:35 +07:00
VERSE 979bd6f5d6 fix: show symbolic links in suggestion (#69)
fix #68 

IRIS noww lists all the symbolic links aside the directories and files
2026-07-30 12:33:46 +07:00
VERSE 812d73b42a fix: iris stops working after exec a command in bash (#66)
Fix #65

when the user presses Enter to run a command, Iris sets `isCommandActive
= true` so it knows a command is running and skips rendering the
overlay. After the command finishes, `isCommandActive` needs to reset to
`false` for Iris to work again. In zsh/fish, preexec/precmd hooks send
an `IRIS_CMD_STOP` signal over the IPC pipe, which Iris receives to
reset `isCommandActive = false`. Bash has no equivalent hook, so
`IRIS_CMD_STOP` is never sent and `isCommandActive` stays stuck at true
forever

so I added a bash-only fallback inside `isExecuting()`: if
`isCommandActive` is true but `TIOCGPGRP` (a kernel API) confirms the
shell's process group is back in the foreground (meaning the command
finished), automatically reset `isCommandActive` to false. zsh/fish
still rely on IPC signals as before

also added a `PROMPT_COMMAND` hook to iris init bash to `send
IRIS_CMD_STOP` after every command (belt-and-suspenders), though that's
not the main fix
2026-07-29 23:00:13 +07:00
d73921e419 fix: stdin handling and exit command (#58)
### Summary of Changes
Fixes **#53** (*Fish shell integration panics with `inappropriate ioctl
for device`*).
#### 1. Fixed Non-TTY Stdin (`panic: inappropriate ioctl for device`) —
Fixes #53
- **Root Cause**: When executing `iris init fish | source` (or sourcing
shell configs), `os.Stdin` (FD 0) is connected to a pipe instead of a
TTY. Calling `term.MakeRaw()` on
a pipe returns `ENOTTY`.
- **Fix**: Guarded `term.MakeRaw()` with `term.IsTerminal()` checks
across `root/wrapper.go` and `root/root.go`. Added fallback to open and
use `/dev/tty` when `os.Stdin` is
  not a terminal device.
- **Fish IPC Hooks**: Added `fish_preexec` and `fish_postexec` event
handlers to `iris init fish` to send `IRIS_CMD_START` / `IRIS_CMD_STOP`
IPC signals over `$IRIS_FD`.
  
#### 2. Fixed Shell Setup Order (Duplicate `fastfetch` / startup
executions) — Fixes #53
- **Root Cause**: `iris setup` appended the init script to the bottom of
shell configs (`config.fish`, `.zshrc`, `.bashrc`), causing pre-existing
interactive startup commands
  to run twice.
- **Fix**: Updated `setupCmd` in `root/init.go` to **prepend** `# Iris
Autocomplete` to the top of shell configuration files.
  
#### 3. Fixed Terminal Exit Loop Handling — Relates to #50
- **Root Cause**: When typing `exit` in the wrapped shell, Linux PTY
returns `syscall.EIO` (`Input/output error`) on `ptmx.Read()` rather
than `io.EOF`. `runWrapper()` was
ignoring non-EOF errors and looping indefinitely without restoring the
terminal or calling `os.Exit(0)`.
- **Fix**: Updated the `ptmx.Read` error handler in `root/wrapper.go` to
handle `syscall.EIO` and exit cleanly.
  
   ---
  
  ### Issues Addressed
   - Closes #53
   - Relates to #50, #55
  
   ---
  
  ### Verification Tested
- [x] Verified `iris setup fish` / `iris init fish | source` initializes
without `ioctl` panic.
- [x] Verified typing `exit` in Fish, Zsh, and Bash terminates IRIS
cleanly and restores standard terminal state.
   - [x] Ran `go test ./...` — all tests pass.

---------

Co-authored-by: verse91 <versedev.store@proton.me>
Co-authored-by: VERSE <sunnyone0901@gmail.com>
2026-07-29 21:28:48 +07:00
VERSE d6cfb9c909 feat(config): add some more config options (#64)
## Add
Make these things configurable
- Expand aliases
- Suggest hidden files (#59)
- Toggle menu and mode 

```
[ui]
hidden-files = true # or false

[core]
expand-alias = true # or false

[keybindings]
toggle-mode = "ctrl+r"
toggle-menu = "ctrl+space"
```

- Auto reload config on changes: now just changes config and save the
file, IRIS will auto detect and reload in silent
- Added all these in config on init and docs

## Fix
I tested on holding backspace and the ghost text keep glitching so I
fixed it, this is just a small fix
2026-07-29 20:43:46 +07:00
VERSE 69fb77910d feat(nix): add Nix flake for NixOS support (#52)
- Suppport NixOS
2026-07-28 22:00:01 +07:00
VERSE ebb0bead7d fix: ZDOTDIR and XDG_CONFIG_HOME config detecting (#51)
From this discussion:

https://www.reddit.com/r/zsh/comments/1v8rq7s/comment/p09b05o/?utm_source=share&utm_medium=web3x&utm_name=web3xcss&utm_term=1&utm_content=share_button

---

Problem: Iris hardcodes config paths to `~/.zshrc` and
`~/.config/fish/config.fish`. This ignores users' custom `ZDOTDIR` or
`XDG_CONFIG_HOME` setups, polluting their `$HOME` directory during init
and failing to scan their actual aliases. Also, ZDOTDIR is often set in
`~/.zshenv` without export, making it invisible to Go's `os.Getenv`

Solution:
- Bash: default `$HOME/.bashrc` so dont mind about it
- For Zsh, Iris now probes zsh directly (`zsh -c "echo $ZDOTDIR"`) with
a timeout to accurately resolve custom paths even if they aint exported
- For Fish, Iris now natively respects the `XDG_CONFIG_HOME` environment
variable
- Shared this robust resolution logic across init, uninstall, and alias
scanning
- Fixed alias scanning to process files in the correct zsh startup order
(`.zshenv` -> `.zprofile` -> `.zshrc`) and correctly merge them
2026-07-28 21:46:34 +07:00
VERSE 6f488c02cd fix(ui): set hex color for ghost text instead of hardcoded ANSI bright-black (#49)
fix #48 

Now ghost text use `#4B4A4C` color instead of hard-coded ANSI color
2026-07-28 19:01:44 +07:00
VERSE 93061c89ca fix(history): ranking (#46)
- I removed scoring system in history and it now only works in spec mode
- Also fix the AI suggestion placed in 3rd place instead of the first in
history mode ad7e2886950dc4e58b1cfac6fe15e4bb7a298865
- Clean up suggestions code
2026-07-28 10:47:56 +07:00
VERSE 5a05dc7553 test: goroutine leak detector (#45)
- Add goroutine leak detector to help avoid Goroutine leaks by Uber:
https://github.com/uber-go/goleak
- By using this package, I found an issue in frecency:
- Close global DB connection to fix goroutine leak in tests
(https://github.com/versenilvis/IRIS/commit/831f86ffdf01124da537c149559fa41f37500e1e)
2026-07-28 10:18:19 +07:00
VERSE 84f2c8f49a fix(history): fuzzy search not working (#44)
quick fix, please read commit I'm too lazy to write description of
changes
2026-07-27 20:05:44 +07:00
VERSE 078e5e817c docs: update docs (#43)
- macOS, Linux badge and AI suggestions showcase in README
- Update user guide and docs for development
2026-07-27 19:50:28 +07:00
VERSE 1540b9655a refactor(justfile): split justfile into small files (#42)
- build.just
- debug.just
- dev.just
- gen.just
- pkg.just
- test.just
2026-07-26 20:53:25 +07:00
VERSE 27e0792560 feat(spec): better file path suggestions (#41)
Enhance file/folder suggestion
2026-07-26 20:43:05 +07:00
VERSE c4e9bcdd88 feat(spec): better suggestion with cobra's cli __complete subcmd (#40)
Introduces dynamic completion inference for Cobra-based CLIs using the
hidden `__complete` subcommand. Iris can now automatically suggest
subcommands and flags for commands without hand-written specs.

Completions are structured, cached by binary modification time
(`mtime`), and safely isolated from hand-written specs.

Try testing with un-specced commands:
- `gh repo ` (suggests `clone`, `fork`, `sync`...)
- `kubectl get ` (suggests `pods`, `nodes`, `configmaps`...)
- `golangci-lint ` (suggests `run`, `fmt`, `linters`...)
2026-07-26 19:44:42 +07:00
VERSE 6ffb9f83f2 feat(scoring): transition workflow learning and fix history UX (#39)
- add transition scoring engine to learn sequential workflows per
directory using command skeletons
- prioritize current active git branch over older branches in
suggestions
- restore strict chronological order for history navigation and bypass
AI re-ranking
- add in-memory session history for instant access to just-run commands
- fix PTY prompt not syncing when using arrow keys in the history menu
- fix history tie-breaker to properly prioritize newer commands by
assigning larger IDs
- fix potential mutex deadlock between bufferMu and pty write during
history navigation
- fix workspace git detection to remove depth limits and correctly
identify repositories with detached HEADs
- fix SQLite connection leaks in frecency queries
- fix global state leaks in history tests by snapshotting and restoring
registry states
- modernize string prefix checks using strings.CutPrefix
2026-07-26 19:10:56 +07:00
VERSE 85ac76e85a fix(wrapper): skip alias expansion on paste (#38)
When you paste text in most modern terminals (Alacritty, iTerm2, Kitty,
WezTerm...), the terminal enables bracketed paste mode and wraps the
pasted content between two control strings:

`\x1b[200~` --> start pasting
`\x1b[201~` --> end pasting
Previously, iris detected these two strings but didn't track the state.
Now I have:

Declared `inBracketedPaste := false` before the stdin loop
Set `inBracketedPaste = true` when receiving `\x1b[200~`, `false` when
receiving `\x1b[201~`
Checked `!inBracketedPaste` before triggering the alias expansion
reset `inBracketedPaste` on enter/ctrl-c/ctrl-u and when executing
2026-07-14 09:09:16 +07:00
verse91 42d3bb14af ci/cd(release): replace install with update 2026-07-13 17:58:56 +07:00
VERSE 860b475b53 feat: scoring and frecency (#37)
Enhance lookup mechanics and priority propagation (`spec/lookup.go`)
Remove the requirement of typing a leading `-` when searching for
options, allowing flag suggestions to surface naturally during input
Accurately forward the `Priority` field from registry specs into the
`Suggestion` struct so the scoring engine evaluates relevance properly

Integrate scoring into the main suggestion pipeline
(`root/suggestions.go`)
Collect context signals using `scoring.CollectSignals(cwd, query,
rootCmd, store)` with the live working directory retrieved from
`spec.GetCWD()`
Pass the entire deduplicated list across spec, history and AI items
through `scoring.Score(deduped, signals)` to compute scores and sort by
descending order before rendering on screen

Record execution history in Frecency Store (`root/wrapper.go`)
Save the last executed command to `lastSubmittedCommand` whenever Enter
is pressed or a suggestion is selected
Trigger `store.Record(...)` asynchronously within the `IRIS_CMD_STOP`
hook using a dedicated goroutine guarded by panic recovery and timeout
limits, preventing blocks on the main shell thread

Optimize workspace identification for AI
(`internal/ai/context_provider.go`)
Use `workspace.DetectCached(cwd)` to instantly fetch ecosystem context
across Git, Node, Go, Rust, Python and Docker alongside active git
branch state
This caching mechanism avoids redundant subprocess execution when
outside git repositories, significantly speeding up prompt context
generation
2026-07-13 17:56:29 +07:00
VERSE f54e97a6c0 fix: enhance prompt (#36)
* Enforce verbatim input buffer prefix and add few-shot examples in
system prompt
* Omit empty context fields and format recent commands line by line
* Wrap untrusted data (`GitStatus`, `RecentCmds`, `DynamicContext`, and
`PreviousCommand`) in an explicit security boundary to prevent prompt
injection vectors
* Optimize string formatting with direct `fmt.Fprintf` inside
`BuildCompletionPrompt` to resolve `QF1012` staticcheck warnings
* Restore exact character prefix in `NormalizeSuggestion` to keep
`ShouldOverwrite` logic accurate
* Auto-join all continuation suffix completions (flags, quotes, regular
word arguments, and filenames) and insert a separating space whenever
the buffer ends in an ordinary word character
* Replace byte-indexed slicing with rune-safe slices (`[]rune`) and
`strings.EqualFold` to guarantee valid UTF-8 boundaries and prevent
panics on multi-byte characters
* Update and verify all unit tests (`go test -race ./internal/ai/...`)
with zero impact on other branches
2026-07-13 10:15:43 +07:00