batho export
Export the latest Batho Structured Graph (BSG) artifacts from a database into a transport ZIP, or export JSON views for downstream ingestion.
Description​
The export command produces a transportable ZIP archive containing the local database artifact by default. Use the --json flag to export one of several predefined JSON views for downstream ingestion instead.
Usage​
batho export [options]
Options​
--root PATHRepository root directory (default: current directory.).--verboseEnable verbose debug logging.--view VIEWThe view to export (default:storage). Options:storage: Full-fidelity representation including raw content and syntax glue.agent: LLM-optimized view with lightweight structural nodes.overview: High-level statistics on entities, languages, and LOC.files: File-centric outline list.symbols: Flat symbol indexing.dependencies: Dependency graph layout.delta: Node-level modifications versus the baseline.rel: Relationships list only.
--output PATHOutput file path. If not specified, defaults to<root>/artifact_<dirname>.batho(or<root>/batho_export.jsonif--jsonis used).--index-id IDExport a specific index run UUID. Default is the latest completed run.--filter GLOBFilter exported files using a glob pattern (e.g.'src/**/*.py').--format FORMATOutput format:json(compact) orpretty(indented). Default:json.--category CATEGORYFilter files by BSG category (source,test,doc,config,infra,all). Default:all.--token-budget NLimit the agent view to a maximum token budget (by truncating lower priority entities).--baseline PATHPath to a previous export JSON file for comparison indeltaview.--relInclude relationships array explicitly in the export output.--jsonExport a JSON view instead of the default transport ZIP. Use--view,--format,--filter, and--categoryto control the JSON output.
Examples​
Export a transport artifact (default):
batho export --root .
Export an agent-optimized JSON view:
batho export --json --view agent --token-budget 8000 --output context.json
See Also​
batho load— Unpack the transport artifact ZIP produced byexport.batho patch— Incrementally update after loading.