Skip to main content

Synopsis

Description

crucihil discover automates the process of creating a rig TOML configuration. It:
  1. Probes the local system for CAN interfaces, USB adapters (PEAK, IXXAT), and Ethernet interfaces
  2. Asks for a brief hardware description (optional — can be skipped or passed via --describe)
  3. Generates a ready-to-use rig TOML using an AI model
  4. Validates the generated TOML against the Pydantic schema
  5. Confirms before writing — you review the TOML and approve the write
This is “Path C” rig setup (alongside manual TOML editing and crucihil init). All three paths produce the same TOML format.

Options

path
default:"rigs/"
Directory to write the generated rig TOML into. Created if it does not exist. Short form: -d.
string
AI provider: anthropic, openai, or gemini. If omitted, auto-detected from environment variables. Short form: -p.
string
Hardware description passed directly to the AI. Skips the interactive prompt. Example: --describe "Nvidia Orin NX, two CAN buses (can0 powertrain 500k, can1 chassis 250k), DoIP on eth1".
boolean
default:"false"
Skip AI entirely. Generates a minimal stub TOML from probe results only, with # TODO: comments marking values that need manual editing. Useful when no API key is available.
string
AI model override. Defaults: claude-sonnet-4-6 (Anthropic), gpt-4o (OpenAI), gemini-2.0-flash (Gemini).

API key setup

If no key is set in the environment, crucihil discover prompts for a provider and API key interactively.

Example session

Hardware probe details

The probe checks: On systems where probe commands are not available (e.g. macOS without SocketCAN), the probe returns empty results. The AI can still generate a TOML from the --describe text alone.

Confirm-on-write security model

crucihil discover never writes to disk without explicit confirmation. You always see the full TOML before approving the write. This is by design — AI-generated configs may need manual adjustment, and writing without review could overwrite an existing config. If you decline the write, the TOML is printed to stdout so you can copy-paste it manually.

Stub TOML mode (no AI)

Use --no-ai when you don’t have an API key or prefer to start from a minimal scaffold:
The stub TOML includes # TODO: comments on every value that needs review:

After discovery

Once the TOML is written, run the interactive validator to check for missing DBC paths or misconfigured ECUs:
If the DBC paths are not set yet, the run will report BLOCKED (not FAIL) — rig configuration errors are precondition failures, not firmware failures.

See also