AI commandPro
A ⌘K palette with an AI mode: search pages and actions, or press Tab to ask; the answer streams in place with numbered sources and next steps you can run, and the palette never changes size.
oxyn add ai-commandThe preview stays free for everyone. Pro opens the code of every Pro component, screen, agent-app template, block and kit, plus the Pro CLI.
Rendered from Rust at build time · goes live when visible
When to use
- One shortcut for both finding and asking: jump to a page or run an action, or ask a question about the workspace and act on the answer without leaving the palette.
When not to use
- Search and run anything from one field: use Command palette instead.
- One search card for an app or docs: use AI search bar instead.
- Cited sources under an answer: use Source cards instead.
Installation
AI command is part of Oxyn Pro; the preview is free. Pro items install with the oxyn CLI once your licence is signed in; until then Pro members copy the code from this page.
oxyn add ai-commandUsage
The preview is free. Pro opens the code of every Pro component, screen and template.
Examples
Answer
Streams an answer with sources and next steps.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Search
Pages and actions; Tab asks.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
Suggested
Ask mode, empty: suggested questions.
Code Pro
The preview is free. Pro opens the code of every Pro component, screen and template.
API reference
AiCommand
| Prop | Type | Default | Description |
|---|---|---|---|
itemsrequired | Vec<Command> | — | Pages and actions. |
suggested_questions | Vec<String> | Default::default() | Questions offered while Ask is open and empty. |
model | String | "Claude Sonnet" | The model that answers. |
default_mode | String | "search" | `search` · `ask`. |
default_query | String | Default::default() | Initial query. |
thinking_label | String | "Searching your workspace" | Status before text arrives. |
height | f32 | 392.0 | Results height px. |
elevated | bool | Default::default() | Floating shadow. |
answerrequired | ScriptedAnswer | — | The answer streamed for any question (demo engine). |
autoplay | bool | Default::default() | Ask on mount with the default query (demo). |
nowrequired | ClockMs | — | Clock. |
width | f32 | 600.0 | Width px. |
on_select | EventHandler<String> | — | A page or action was chosen. |
on_ask | EventHandler<String> | — | A question was asked. |
Read from the Rust signature and doc comments.
Keyboard interactions
| Key | Action |
|---|---|
| ↑or↓ | Move |
| Enter | Open, ask, or run the highlighted step |
| Tab | Switch between Search and Ask AI |
| Esc | Close the answer, back to search, then close |
Accessibility
- The answer is a region marked aria-busy while it streams; the footer status is a polite live region.
- Citations are buttons named by their source.
From the spec
Combobox for the field; the answer is a region with aria-busy while streaming; the footer status announces Thinking, Answer ready and step results. Citations are buttons named "Source n: <title>".
Motion & interaction
The palette never resizes: views crossfade inside a fixed body. Sources pop in as they are first cited; citations pop as they stream. Steps show a spinner then a check.
Timing
| Transition | Duration | Easing | Reduced motion |
|---|---|---|---|
| View crossfade | 160 ms + 60 ms delay | ease.out | instant |
| Thinking | 900 ms | — | same |
| Stream | ~45 chars / s | linear | full text at once |
| Step run | 900 ms | — | same |
Responsive behaviour
- Fixed results height so typing, switching modes and streaming never resize it.
Edge cases (spec)
Empty questions don't ask. Asking again replaces the answer. Very long answers scroll inside the fixed body. Running a step twice is prevented.
Notes for AI
- Import
AiCommand,ScriptedAnswerfromoxyn_dioxusand includePRIMITIVES_CSSplus the token stylesheet once. - A GPUI version exists:
AiCommandElinoxyn_gpui. - Props to set first:
items,answer,now. - It reads a clock (
now) for live timers; pass one clock for the whole page rather than one per component. - Keep its states and timings as they ship; restyle it through the CSS variables rather than by hand.