# ast-query > Query TypeScript codebase structure. Use when asking "what does X contain?", "where is X defined?", "what calls X?", or exploring type/interface/function definitions. Answers structural questions by parsing actual code. - Author: Tyler Morgan - Repository: tylermorganme/crop_plan_2025 - Version: 20260204175813 - Stars: 0 - Forks: 0 - Last Updated: 2026-02-06 - Source: https://github.com/tylermorganme/crop_plan_2025 - Web: https://mule.run/skillshub/@@tylermorganme/crop_plan_2025~ast-query:20260204175813 --- --- name: ast-query description: Query TypeScript codebase structure. Use when asking "what does X contain?", "where is X defined?", "what calls X?", or exploring type/interface/function definitions. Answers structural questions by parsing actual code. --- # AST Query Query TypeScript code structure without reading files manually. ## Usage ```bash # What fields does an interface have? node crop-api/scripts/ast-query.js "Plan" # Find a function signature node crop-api/scripts/ast-query.js "validatePlan" # Find all matching definitions node crop-api/scripts/ast-query.js "Bed" # Find what calls a function node crop-api/scripts/ast-query.js "validatePlan" --callers ``` ## Output Compact, greppable format: ``` interface: Plan (src/lib/entities/plan.ts:45) id: string schemaVersion: number metadata: PlanMetadata beds: Record cropCatalog: Record plantings: Planting[] ``` ## When to Use - Understanding type structure before modifying code - Finding where something is defined - Checking function signatures - Discovering related types (query "Bed" finds Bed, BedSpanInfo, getBedLength, etc.)