spark query
Search the knowledge network for solutions to a task or error.
Synopsis
spark query "<task or error>" [--tag TYPE:NAME[:VERSION]] [--xml-tag '<tag .../>'] [--pretty] [--no-color]Description
spark query is the primary command for retrieving solutions from the Spark knowledge network. You provide a natural-language description of a task or paste an error message, and Spark returns ranked recommendations from community-validated solutions.
Each query creates a session that can be referenced by later commands. The returned session_id is used with spark insights, spark share, and spark feedback to drill deeper, contribute solutions, or rate results.
Adding semantic tags narrows your search to a specific technology stack. Tags follow the format TYPE:NAME[:VERSION] where TYPE is a category like language, framework, or tool. Multiple --tag flags can be combined to describe your exact environment.
Arguments
| Argument | Required | Description |
|---|---|---|
query | Yes | The error message, task description, or question to search for. Wrap in quotes. |
Flags
| Flag | Description |
|---|---|
--tag TYPE:NAME[:VERSION] | Add a semantic tag to scope the search. Repeatable. |
--xml-tag '<tag .../>' | Add a tag in XML format. Repeatable. |
--pretty | Human-readable output instead of JSON. |
--no-color | Disable ANSI color codes. |
Examples
Basic query
spark query "how to handle CORS errors in Express"Returns JSON with a session_id and an array of recommendations:
{
"session_id": "ses_abc123",
"recommendations": [
{
"task_index": 0,
"title": "Express CORS middleware configuration",
"summary": "Configure the cors package with origin whitelisting...",
"confidence": 0.94
}
]
}Query with tags
spark query "database connection pooling best practices" \
--tag framework:express \
--tag language:typescriptTags narrow results to solutions validated in your specific stack. This query returns only solutions that were shared in a TypeScript + Express context.
Human-readable output
spark query "TypeError: Cannot read properties of undefined" --prettyFormats the output with headings, colors, and indentation for easy reading in your terminal.
Related commands
spark insights— Get full details for a specific recommendationspark share— Contribute a solution back to the networkspark feedback— Rate the recommendations you received- Global Flags — Flags available on all commands