Skip to content

dft context

Question-aware schema search and isolation over the Super Schema artifact. Builds narrow, question-scoped working sets that an AI agent can consume without burning context on irrelevant tables.

dft context [OPTIONS] COMMAND [ARGS]

Companion to dft schema and dft schema-search: those verbs browse and search; dft context retrieves relevance-scoped bundles for a natural-language question.

Subcommands

Command Purpose
dft context build Build the context corpus from the Super Schema artifact.
dft context search Search for tables relevant to a question.
dft context show Show full detail for a single table.
dft context bundle Generate a narrow working-set bundle for an AI question.

All subcommands read from target/super_schema.json by default (build the artifact first with dft inspect). Override with --input PATH.

dft context build

Build the context corpus from the Super Schema artifact.

dft context build [OPTIONS]
Flag Description
--input PATH, -i PATH Path to super_schema.json. Default: target/super_schema.json.
dft context build
dft context build --input custom/super_schema.json

Search for tables relevant to a natural-language question.

dft context search [OPTIONS] QUESTION
Flag Description
--input PATH, -i PATH Path to super_schema.json.
--limit INT, -n INT Max results.
--format TEXT terminal (default) or json.
dft context search "total revenue by region"
dft context search "customer churn" --limit 3
dft context search "order status" --format json

dft context show

Show full detail for a single table.

dft context show [OPTIONS] TABLE_NAME
Flag Description
--input PATH, -i PATH Path to super_schema.json.
--format TEXT terminal (default) or json.
dft context show orders
dft context show customers --format json

dft context bundle

Generate a narrow working-set bundle for an AI question — the actual artifact you'd hand to a model to ground its SQL generation.

dft context bundle [OPTIONS] QUESTION
Flag Description
--input PATH, -i PATH Path to super_schema.json.
--max-tables INT Maximum tables in bundle. Default: 5.
--max-columns INT Maximum columns per table. Default: 20.
--format TEXT terminal (default) or json.
--output PATH, -o PATH Write bundle to file.
dft context bundle "total revenue by region"
dft context bundle "customer churn" --max-tables 3 --format json
dft context bundle "order status" --output bundle.json --format json
If you want… Use
A literal keyword / predicate match dft schema-search
Hierarchical drill-down into one table or column dft schema
A question-scoped relevance ranking ("what's relevant to X?") dft context search
A token-budgeted bundle to hand to an LLM dft context bundle

context answers semantic, question-shaped queries; schema-search answers exact-match filter queries.