base ast asks the map questions, and base sync --ast builds it. The map lives with the app it describes, at <app>/.base-ast/ast.ttl, so a workspace with several apps has several maps rather than one shared index.
Every command on this page is read-only except
base sync, which writes to the graph and to the code map. Nothing here removes anything.Querying the code map
Four questions, one command.base ast query answers all of them, and which flag you pass decides which question you asked. base ast list tells you which maps exist to ask.
Aliases: base a for base ast, q for query, l for list. base a q -c "auth" and base ast query --contains "auth" are the same command.
base ast query
Find entities by name, list what is in one file, find every caller of a function, or find every file that imports from a file.--target is the flag worth remembering. Without it, base ast query reads the map for your current directory, which means answering a question about apps/portal from the workspace root returns nothing rather than an error. With --target apps/portal you can ask from anywhere.
base ast list
Show every code map registered in this workspace, with its app name, how many entities it holds, its path, and when it was last synced.base sync --ast --target <path> once.
base sync
Read file-owned data into the graph. Run with no flags, it extracts your markdown: frontmatter and body, from the files base already knows about. Run with--ast, it builds the code map instead.
Map a new app once with
base sync --ast --target apps/portal. After that it stays current on its own, and you only need to run it again if you want to force a rebuild.
--repair is for one specific symptom: a project whose tasks or milestones exist but do not show up attached to it, or a decision that a domain-scoped search cannot find. It rebuilds those links and changes nothing else.