Ought documentation

Configuration

The ought.toml schema — every section and key.

ought init writes an ought.toml at the project root. Every CLI command discovers it by walking up from the current directory. Pass --config <path> to point at a different file.

Full example

[project]
name = "myapp"
version = "0.1.0"

[specs]
roots = ["ought/"]

[context]
search_paths = ["src/", "lib/"]
exclude = ["vendor/", "generated/"]
max_files = 50

[generator]
provider = "anthropic"          # "anthropic" | "openai" | "openrouter" | "ollama"
model = "claude-sonnet-4-6"
max_turns = 50
parallelism = 1

[generator.anthropic]
api_key_env = "ANTHROPIC_API_KEY"
# base_url = "https://api.anthropic.com"   # proxies / Bedrock / Vertex

[generator.tolerance]
must_by_multiplier = 1.0        # CI timing slack for MUST BY clauses

[runner.rust]
test_dir = "ought/ought-gen/"
# Bare section name matches a built-in preset (rust, python, typescript, go).
# Override any field below to customize.

[mcp]
enabled = false
transport = "stdio"             # "stdio" | "sse"

[project]

KeyDefaultNotes
nameRequired. Used in banners.
version0.1.0Free-form string; not parsed.

[specs]

Where on disk Ought looks for .ought.md files.

KeyDefaultNotes
roots["ought/"]Directories the parser walks. Relative to ought.toml.

[context]

Source files included as context for LLM-driven commands (generate, extract, analyze survey).

KeyDefaultNotes
search_paths[]Source roots. Empty means “no source context.”
exclude[]Glob patterns relative to each search path.
max_files50Hard cap on files read into a single generation prompt.

[generator]

LLM provider, model, and agent-loop limits.

KeyDefaultNotes
provider"anthropic"One of anthropic, openai, openrouter, ollama.
model"claude-sonnet-4-6"Provider-specific model identifier.
max_turns50Cap on agent-loop iterations per clause.
max_tokens_per_response8192Per-response token cap.
temperatureunsetOptional sampling temperature.
read_source_limit_bytespreset-definedPer-call cap on bytes from read_source; truncated reads can resume.
context_budget_tokens180000Hard cap on input tokens; aborts before the provider would 400.
eviction_threshold_tokens130000Soft threshold at which old tool_result blocks get rewritten.
parallelism1Concurrent assignments.

Provider sub-blocks

Only the block matching provider is read — the rest are ignored, so it’s fine to leave them in.

[generator.anthropic]
api_key_env = "ANTHROPIC_API_KEY"
# base_url = "https://api.anthropic.com"

[generator.openai]
api_key_env = "OPENAI_API_KEY"
# base_url = "https://api.openai.com/v1"

[generator.openrouter]
api_key_env = "OPENROUTER_API_KEY"
# app_url   = "https://example.com"      # HTTP-Referer header
# app_title = "myapp"                    # X-Title header

[generator.ollama]
# base_url = "http://localhost:11434/v1"

[generator.tolerance]

KeyDefaultNotes
must_by_multiplier1.0Multiplier applied to every MUST BY deadline. Raise on slow CI.

[runner.<name>]

One section per language runner. The section name is significant: if it matches a built-in preset (rust, python, typescript, go), the preset fills in any unset field.

KeyRequiredNotes
presetOptional explicit preset. Defaults to the section name if it matches.
commandyes (or preset)Shell command. Tokens: {test_dir}, {junit_path}, {tap_path}, {json_path}.
test_diryesWhere generated test files are written.
formatyes (or preset)junit-xml | tap | ought-json | cargo-test.
file_extensionsyes (or preset)Extensions Ought treats as generated tests, e.g. ["rs"].
output_pathFixed path for formatted output; otherwise inferred from command.
working_dirWorking directory for the spawned command.
envEnv vars merged into the child process; values may use the same tokens.
available_checkShell command to probe runner availability. Defaults to first token of command.

A bare [runner.python] with just test_dir is enough — the preset supplies the rest.

[mcp]

Settings for the ought mcp server.

KeyDefaultNotes
enabledfalseWhether the server starts.
transport"stdio"stdio for local IDEs, sse for HTTP.