KURAL
Commands

kural place

Find the directory where new code should live

Takes a natural-language description of code you're about to write, embeds it, and ranks every directory in the snapshot by fit. Answers the core kural question — where should this code live? — before you commit to a path.

Synopsis

kural place "<description>" [flags]

The description is a required positional argument. Quote it so the shell treats it as one argument.

Flags

FlagShortTypeDescription
<description>stringNatural-language description of the code (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 ranked candidates as JSON.

Use the same provider/model you used for kural snapshot generate — vector spaces aren't portable across models.

Examples

kural place "parses CLI flags for the audit command"
kural place "retries failed HTTP requests with exponential backoff" --json

When to use it

  • Before adding a new file, especially when several directories feel plausible.
  • In an AI coding loop, to give the agent a ranked list of candidate homes instead of letting it guess.
  • When refactoring, to sanity-check where a piece of logic has drifted — if place ranks a different directory first than where the code currently lives, you likely have a misplaced finding waiting.
  • Concept: Placement — how the ranking is computed.
  • Companion: kural brief — same input, different question (what already exists in this area?).

On this page