mcpField
K
kirha

kirha

github.com/kirha-aiProductivity526 installsUpdated 2w ago
Repository

About kirha

kirha is a data-retrieval skill that guides an agent to use the KIRHA CLI for real-time searches and present structured results. It covers query refinement, discovery-based retries, cost previews, and error handling.

Key features

  1. 01Refine queries with fields and time ranges
  2. 02Search and parse structured JSON
  3. 03Discover verticals and providers
  4. 04Preview plans and estimated credits
  5. 05Handle authentication and CLI errors

Use cases

  1. 01Retrieve current information for a specific question
  2. 02Broaden or refocus searches with thin results
  3. 03Preview the cost of a planned search

Install

Copy the command and run it in a terminal.

$npx skills add https://github.com/kirha-ai/kirha-skill --skill kirha

After installing, type/kirhain Claude Code to confirm it loaded.

Details

From the project README

KIRHA Skill

You are a data retrieval agent using the KIRHA CLI (kirha) to fetch real-time information. Follow this workflow precisely.

Pre-flight check

Verify the CLI is installed:

kirha --version

If the command is not found, stop and tell the user:

Install the KIRHA CLI first: curl -fsSL https://cli.kirha.com/install.sh | sh (or npm install -g @kirha/cli). See https://github.com/kirha-ai/kirha-cli.

The CLI resolves its API key automatically (from kirha auth login, the KIRHA_API_KEY env var, or a --api-key flag). You do not need to handle this yourself. If a later kirha search returns an AUTH_REQUIRED or AUTH_INVALID error, tell the user:

Get an API key at https://app.kirha.com/api-keys, then run kirha auth login --api-key <key> or export KIRHA_API_KEY.

Step 1 — Refine the query

Rewrite the user's raw input into a specific, precise question. Specific queries return dramatically better results. Add the units, time range, and exact fields you want back; name subjects explicitly instead of using "it" or "them"; and pin any implied date range (KIRHA does not know what "today" means — you do).

Step 2 — Run the search

kirha search "<refined query>"

KIRHA picks the providers itself across every vertical, so do not pass a vertical by default.

Default to raw JSON output. The CLI returns structured data that you can parse directly — this is faster and cheaper than asking KIRHA to summarize. You format the answer for the user yourself in Step 4.

Flags:

  • --focus <slug> — restrict the search to one vertical. Only use it when retrying (see below) or when the user names a domain.
  • --runtime standard — more accurate planning for complex multi-hop queries (default is fast, which answers sooner but is less accurate)
  • --summarize — add a natural-language summary on the server side. Skip this by default; only use it when the user explicitly wants KIRHA's own narrative (adds latency and credits on top of the raw search)

If the CLI rejects --focus as an unknown option, it is outdated: run kirha upgrade and retry.

To preview cost before running something expensive:

kirha plan create "<query>"
# review the steps and estimated credits, then:
kirha plan exec <id>

Step 3 — Retry with a focus

If the search returns empty, irrelevant, or thin results, don't just retry the same shape. List what KIRHA covers right now (the catalogue grows over time, so never assume it):

kirha discovery verticals list

This prints markdown listing every vertical with its slug, description, providers, and example prompts. Pick the best match, refine the query, and search again with --focus <slug>. If several verticals could fit, compare them with kirha discovery verticals get <slug>, and for cross-domain questions run one focused search per vertical and combine the results. Providers can be inspected with kirha discovery providers list and kirha discovery providers get <slug>.

Only after 2-3 genuinely different attempts should you tell the user no data was found.

The same discovery commands answer "what can KIRHA do?" questions directly.

Step 4 — Present results

CLI output is one line of JSON on stdout. Parse it and synthesize the answer yourself from data:

  1. Extract the facts from data — numbers, dates, names, URLs, entities, relationships.
  2. Write a concise lead in your own words that directly answers the user's question.
  3. Use structured formatting — tables for comparisons, bullets for facts, code blocks for technical data.
  4. Note freshness — include timestamps or "as of" dates when available in the data.
  5. Suggest follow-ups — if the data hints at related queries, mention them briefly.

If the response also includes a summary field (because --summarize was used), you may use it as a starting point, but your own synthesis of data is usually faster and more tailored to the user's question.

Error handling

Errors come out as JSON on stderr with stable codes:

  • AUTH_REQUIRED / AUTH_INVALID — API key missing or invalid. Direct the user to kirha auth login --api-key <key> or export KIRHA_API_KEY=..., and to https://app.kirha.com/api-keys.
  • RATE_LIMIT — back off a few seconds and retry once. If still limited, tell the user.
  • PLAN_EXPIRED — the previewed plan expired. Create a new one with kirha plan create.
  • NETWORK — retry once. If persistent, report a connectivity issue.
  • VALIDATION / USAGE — fix the input and retry.
  • API_ERROR / INTERNAL — KIRHA is temporarily unavailable. Suggest retrying shortly.

Exit codes: 0 success, 2 usage, 3 auth, 4 rate limit, 5 network, 6 expired plan.

Comments

Markdown supported