The rcli ask command sends a single text query to the LLM, executes any triggered actions, and prints the response. Perfect for scripting and automation.
Usage
rcli ask "<your query or command>"
# Examples
rcli ask "open Safari"
rcli ask "what is the capital of France?"
rcli ask "create a note called Ideas with buy milk"
How It Works
- Initialization — Loads LLM, STT, TTS models (one-time per invocation)
- LLM Processing — Classifies intent and generates response
- Action Execution — If action detected, executes via AppleScript/shell
- Response — Prints text to stdout
- TTS — Speaks response (unless
--no-speak)
- Exit — Process terminates
Options
--models
string
default:"~/Library/RCLI/models"
Models directory path
Load RAG index for document-grounded answers
Examples by Category
Productivity Actions
rcli ask "create a note called Meeting Notes"
rcli ask "create a note called Ideas with buy milk, call mom"
Communication Actions
rcli ask "send message to John saying I'll be late"
rcli ask "text Sarah happy birthday"
rcli ask "play some jazz on Spotify"
rcli ask "next track"
rcli ask "set music volume to 75"
System Control
rcli ask "open Safari"
rcli ask "quit Chrome"
rcli ask "list running apps"
Web & Navigation
rcli ask "search the web for RCLI documentation"
rcli ask "search YouTube for Python tutorial"
Conversational Queries
rcli ask "what is the capital of France?"
rcli ask "explain quantum computing in one sentence"
rcli ask "write a haiku about programming"
RAG-Powered Queries
Use --rag to query indexed documents:
# Index documents first
rcli rag ingest ~/Documents/notes
# Query with RAG
rcli ask --rag ~/Library/RCLI/index "what were the key decisions?"
rcli ask --rag ~/Library/RCLI/index "summarize the project plan"
RCLI will:
- Embed the query
- Retrieve relevant chunks via hybrid search (vector + BM25)
- Pass context to LLM
- Generate document-grounded response
Scripting Examples
Shell Automation
#!/bin/bash
# morning-routine.sh
rcli ask "open Safari" --no-speak
rcli ask "open Mail" --no-speak
rcli ask "set volume to 30" --no-speak
rcli ask "what's on my calendar today?"
Capture Output
# Capture LLM response
response=$(rcli ask "what is 2 plus 2?" --no-speak 2>/dev/null)
echo "Answer: $response"
# Answer: Four.
Conditional Actions
#!/bin/bash
# Check battery, lock if low
battery=$(rcli ask "what's my battery level?" --no-speak 2>/dev/null)
if [[ $battery =~ ([0-9]+)% ]]; then
level=${BASH_REMATCH[1]}
if [ $level -lt 20 ]; then
rcli ask "lock screen" --no-speak
fi
fi
Typical latencies on Apple M3 Max:
- Initialization — 1-2 seconds (model loading)
- LLM TTFT — 15-25ms
- LLM throughput — 150-200 tok/s
- Action execution — 10-100ms (depends on action)
- TTS synthesis — 100-200ms
For repeated queries, use interactive mode (rcli) to avoid reloading models.
By default, rcli ask prints:
Initializing...
<response text>
LLM: 87 tok 189 tok/s TTFT 18ms
TTS: 142ms 0.8x RT
To get clean output (stdout only, no metrics):
rcli ask "what is 2 plus 2?" --no-speak 2>/dev/null
# Four.
Action Execution Feedback
When actions are triggered:
$ rcli ask "open Safari"
Initializing...
✓ open_app: Opened Safari
Done! Safari is now open.
LLM: 12 tok 203 tok/s TTFT 15ms
TTS: 98ms 0.6x RT
The ✓ indicates successful execution. Failures show:
✗ [failed] create_note Error: Notes.app not installed
Error Handling
No Models Installed
$ rcli ask "hello"
Error: Models not found at ~/Library/RCLI/models
Run: rcli setup
Solution: rcli setup
Invalid Action Arguments
$ rcli ask "open"
I need to know which app to open. Try "open Safari" or "open Mail".
The LLM will ask for clarification.
Empty Query
$ rcli ask ""
Usage: rcli ask "your question or command"
Advanced Usage
Custom Context Size
# Increase context window for long queries
rcli ask "explain the entire history of computing" --ctx-size 8192
CPU-Only Mode
# Run LLM on CPU (slower, but frees GPU)
rcli ask "what is 2 plus 2?" --gpu-layers 0
Silent Mode (No TTS)
# Text output only
rcli ask "open Safari" --no-speak
When rcli ask "open Safari" is run:
- LLM receives:
"open Safari"
- LLM generates:
<tool_call>{"name": "open_app", "arguments": {"app_name": "Safari"}}</tool_call>
- Tool engine parses and executes
open_app({"app_name": "Safari"})
- AppleScript runs:
tell application "Safari" to activate
- Result:
{"success": true, "output": "Opened Safari"}
- LLM generates final response:
"Done! Safari is now open."
- TTS speaks: “Done! Safari is now open.”
Use --verbose to see full tool call JSON and execution logs.