Summary
Show suggested next actions in the input field as dim/grey text that can be accepted with Tab, similar to Claude Code's behavior.
Example
After clemini completes a task:
[bash] cargo check, 0.8s
All checks passed.
> run the tests█ ← cursor here, dim grey suggestion
Pressing Tab accepts the suggestion:
How It Works
- After each response, clemini generates 1-3 contextual suggestions
- The first suggestion appears as ghost text in the input field
- Tab accepts the suggestion, or user can type to override
- Cycle through suggestions with Tab (before typing anything)
Suggested Actions by Context
| After... |
Suggestions |
cargo check passes |
"run the tests", "commit changes" |
cargo check fails |
"fix the first error", "show the error details" |
| Reading a file |
"edit this file", "search for usages" |
| Creating a file |
"run cargo check", "add tests" |
| Fixing a bug |
"verify the fix", "commit the fix" |
| No recent context |
"show project structure", "what can you help with?" |
Implementation Notes
rustyline supports hints via the Hinter trait:
use rustyline::hint::Hinter;
struct SuggestionHinter {
suggestions: Vec<String>,
}
impl Hinter for SuggestionHinter {
type Hint = String;
fn hint(&self, line: &str, pos: usize, _ctx: &Context) -> Option<String> {
if line.is_empty() && !self.suggestions.is_empty() {
// Return first suggestion as ghost text
Some(self.suggestions[0].clone())
} else {
None
}
}
}
The hint appears in a different color (configurable via Highlighter).
Generating Suggestions
Options:
- Rule-based: Pattern match on last tool calls and responses
- Model-generated: Ask Gemini to suggest next steps (adds latency/cost)
- Hybrid: Rule-based with model fallback for complex contexts
Start with rule-based for speed, consider model-generated for the "no recent context" case.
Related
Summary
Show suggested next actions in the input field as dim/grey text that can be accepted with Tab, similar to Claude Code's behavior.
Example
After clemini completes a task:
Pressing Tab accepts the suggestion:
How It Works
Suggested Actions by Context
cargo checkpassescargo checkfailsImplementation Notes
rustyline supports hints via the
Hintertrait:The hint appears in a different color (configurable via
Highlighter).Generating Suggestions
Options:
Start with rule-based for speed, consider model-generated for the "no recent context" case.
Related