Skip to main content

kagi quick

Generate a Kagi Quick Answer from the authenticated web product and return the full answer envelope, references, and follow-up questions. Quick Answer demo

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 pretty or markdown output
  • 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, toon, compact, pretty, markdown Default: json

--no-color

Disable ANSI colors in --format pretty.

--local-cache

Store and reuse the response in the local cache under ~/.cache/kagi-cli or KAGI_CACHE_DIR.

--cache-ttl <SECONDS>

Override the local cache TTL. Quick answers default to 900 seconds when --local-cache is enabled.

--lens <INDEX>

Scope the query to one of your Kagi lenses by numeric index.
Lens indices are user-specific. Use the same l= numeric value you would use with kagi search --lens.

Output Format

Default JSON output:

Fields

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_id is informational today; there is no --thread-id follow-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