KURAL
Commands

kural brief

Show existing code related to a concept before implementing it

Given a description of code you plan to write, returns the existing units in the snapshot that are closest in embedding space. Answers "what already exists in this area?" so you don't duplicate behavior or borrow the wrong vocabulary.

Synopsis

kural brief "<description>" [flags]

Flags

FlagShortTypeDescription
<description>stringDescription of the code you intend to write (positional, required).
--provider <name>-pstringEmbedding provider — openrouter, openai, vercel (default), ollama.
--model <id>-mstringModel ID override.
--api-key <key>-kstringAPI key. Falls back to AI_GATEWAY_API_KEY.
--jsonbooleanEmit the brief as JSON — agent-friendly.

Examples

kural brief "validate embedding provider configuration"
kural brief "persist score cards to the snapshot database" --json

When to use it

  • Before an AI agent writes code, pipe the brief into its context so it uses existing vocabulary and doesn't re-implement something that lives elsewhere.
  • When onboarding, to discover the handful of files that already touch a concept without grep'ing for keywords.
  • Before opening a PR, to sanity-check that your change isn't a near-duplicate of code that already exists.
  • Companion: kural place — same input, different question (where should the new code go?).
  • Concept: Embedding — what "close in embedding space" means in this system.

On this page