kagi quick
Generate a Kagi Quick Answer from the authenticated web product and return the full answer envelope, references, and follow-up questions.
Synopsis
Description
kagi quick targets Kagi’s Quick Answer web-product flow, not FastGPT and not the public Search API. It is useful when you want a fast answer plus references without opening a browser tab.
This command is ideal for:
- factual questions with references
- shell workflows that want a single answer envelope
- quick terminal lookups with
prettyormarkdownoutput - automations that want the Quick Answer thread id for later inspection
Authentication
Required:KAGI_SESSION_TOKEN
Quick Answer uses subscriber session-token auth. The CLI accepts either:
- the raw session token
- the full Session Link URL such as
https://kagi.com/search?token=...
Arguments
<QUERY> (Required)
The text to send to Quick Answer.
The CLI sends the query verbatim. It does not auto-append a trailing question mark, so both of these are valid:
Options
--format <FORMAT>
Output format for the response.
Supported values: json, compact, pretty, markdown
Default: json
--no-color
Disable ANSI colors in --format pretty.
--lens <INDEX>
Scope the query to one of your Kagi lenses by numeric index.
l= numeric value you would use with kagi search --lens.
Output Format
Default JSON output:Fields
| Field | Type | Description |
|---|---|---|
meta | object | Stream metadata such as version and trace id |
query | string | The original query text sent to Quick Answer |
lens | string or null | The requested lens index, if one was supplied |
message | object | Final Quick Answer message payload |
references | object | Reference markdown plus parsed reference items |
followup_questions | array | Follow-up suggestions returned by Kagi |
Examples
Basic Queries
Pretty Terminal Output
Markdown for Notes
Lens-Scoped Quick Answers
JSON Processing
Output Modes
json
Pretty-printed JSON envelope for scripts and inspection.
compact
Minified JSON envelope for pipelines or storage-sensitive paths.
pretty
Terminal-friendly answer text followed by a references section and any follow-up questions.
markdown
The answer markdown, then the references markdown, then a follow-up section if present.
Limitations
- Requires an active Kagi subscription and session token
- This command is single-turn only
- The returned
message.thread_idis informational today; there is no--thread-idfollow-up mode yet - Output quality and references depend on the live Quick Answer product
See Also
- assistant - Conversational multi-turn AI via Kagi Assistant
- search - Full search results instead of a single synthesized answer
- Authentication - Session-token setup