www/docs/guide/ai/commands.md
AI Commands turn a saved prompt into a reusable Wox command. They are useful when you often send the same kind of text to a model: rewrite selected text, summarize a diff, translate a paragraph, or explain an error.
Configure AI Settings first.
%s in the prompt where Wox should insert your input.Command settings:
| Field | Value |
|---|---|
| Name | git commit msg |
| Query | commit |
| Vision | No |
Prompt:
Write a Git commit message for this diff.
Rules:
- First line: imperative mood, 50 characters or fewer.
- Then a blank line.
- Then 2-3 bullet points explaining the concrete changes.
- Output only the commit message.
Diff:
%s
Add a macOS shell helper:
commit() {
local input
input="$(cat)"
python3 -c 'import sys, urllib.parse; print("wox://query?q=ai%20commit%20" + urllib.parse.quote(sys.stdin.read()))' <<< "$input" | xargs open
}
Use it from a Git repository:
git diff | commit