- 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
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`...)
- 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
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
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
* 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
This project is starting to grow, and I've seen flaws in the initial
project structure design
I think I'll restructure the entire project directory for better
scalability and also cleaner
## Feat
* feat(ai): add AI suggestion engine, context gathering, and ghost text
overlay (`v0.3.0`)
## Security & Perf
* fix(ai): restrict background `--help` execution to a hardcoded command
allowlist to prevent RCE
* fix(root): defer context cancellation in goroutine to prevent resource
leaks
* perf(ai): implement LRU eviction and maximum size limit for
`ProviderCache`
* perf(ai): truncate command context output
(`CommandContextProvider.Gather`) to 1000 characters to save tokens
## Bug Fixes
* fix(ai): add mutex synchronization and thread-safe snapshotting to
`AIEngine.RegisterProvider` and `GatherDynamicContext`
* fix(ai): return a copy of fresh `Suggestion` in `AIEngine.Suggest` to
prevent cache mutation
* fix(ai): use length-prefixed encoding in `EnvSnapshot.Hash` to prevent
delimiter collisions
* fix(ai): skip variable assignment lines containing `=` when extracting
Makefile targets
* fix(runner): check `scanner.Err()` and return `nil` on scan errors in
justfile generator
* test(ci): rename `git commit` to `git checkout` in overlay test to
resolve CI `typos` false positive
- I think it would be better if one for commands only, one for the spec
handling core logic so people won't be confused by the core logic inside
the commands folder (cleaner I guess)
- Regen docs
- I wrote a scripts to copy and generate all commands missing in iris
from fig repo: https://github.com/withfig/autocomplete
- Add a new script to generate commands docs about which commands
currently are inside commands folder
377d4aac663590e504fe39a92eb4dac4cbd333b2
- Add more icons e64d4e70a1db61e62053460a882e093bd6373ab1
This pull request modernizes the codebase by adopting Go 1.21+ features, including built-in functions like min and max, standard library iterators such as strings.SplitSeq and strings.FieldsSeq, utility functions like maps.Copy and slices.Contains, and string manipulation helpers like strings.Cut and strings.CutPrefix. Feedback is provided on a test file where the usage of strings.Builder can be further optimized to avoid unnecessary string allocations during concatenation.
`go fix -diff ./...`
- correct nightly release tag name
989b61eefb212c18ca04b2121b382f19f86e39c2
- iris not start in tmux 0fef95430b6a1877810e3a4ffd8aa658f75c542c
- suggestions only show on full word typing
f29cbfd74a2d90371f8f369e6f8e7419f979da38
- keep current dir on reload instead of return home dir
a923e78f52a95e06587aff6856a6a81319b38e84
- Issue #4: currently there is no official release yet so we cant
download from installer
- I added an installer debugger here to test
(f091dbf13bdf109b631951e2558651f560ca8b84)
- Issue #5: my another library
[fuzzy](https://github.com/versenilvis/fuzzy/) has a logic bug so it
causes crash, fix d479c6cb4d8453e50366c9839daaabb45a98a2df
- Other:
- remove unneeded comments (edd9d05fdd16e682b6b416913e2fa9c3f6599956)
- Add some tests
- Fix reload crash (3a76e78e655fd8daafb635ec0937667325f75ee4)
- New optimized build command (56a4a815f836271b861f32795d2df3b25a3dffc0)