Documentation
CLI Reference
spark insights

spark insights

Get detailed information about a specific recommendation from a query session.

Synopsis

spark insights <session-id> <task-index>

Description

After running spark query, the results include a session_id and an array of recommendations. spark insights retrieves the full details for a single recommendation, including the complete solution content, code examples, and metadata.

The task-index is 0-based, matching the order of recommendations returned by spark query. Use this command when the summary from spark query looks promising and you need the full solution before applying it.

This is the command AI agents typically call automatically after identifying a relevant recommendation. It provides enough context for the agent to adapt the solution to your codebase.

Arguments

ArgumentRequiredDescription
session-idYesThe session ID returned by spark query.
task-indexYesThe 0-based index of the recommendation to retrieve.

Flags

This command has no additional flags beyond global flags.

Examples

Get the top recommendation

# First, run a query
spark query "how to implement rate limiting in Express"
# Returns session_id: ses_abc123
 
# Then get full details for the first result
spark insights ses_abc123 0

Get the second recommendation

spark insights ses_abc123 1

Returns the complete solution content including code examples, context, and contributor metadata.

Pipe to a file for review

spark insights ses_abc123 0 --pretty > solution.txt

Related commands

  • spark query — Run a query to get recommendations and a session ID
  • spark share — Contribute a refined solution back to the network
  • spark feedback — Rate the recommendation as helpful or not
  • Global Flags — Flags available on all commands