Code Indexing
Code indexing is the process of uploading your codebase's structure and content to DPage. This enables AI-powered search, analysis, and RAG for generating dynamic components.
Indexing Features
Recursive Scanning
Automatically scans nested directories for supported code files.
Change Detection
Uses SHA-1 hashing to only re-index files that have actually changed.
Smart Filtering
Automatically excludes node_modules, build artifacts, and hidden files.
Batch Processing
Handles large codebases by uploading files in optimized batches.
Index Your Code
Once your project is linked, indexing is a single command:
dpage code indexThe CLI will scan your directory, calculate hashes, and upload chunks to the server for embedding.
Advanced Indexing
Specific Directory
By default, the CLI indexes the current directory. Use --dir to index a specific path:
dpage code index --dir ./srcExclude Patterns
Add custom exclusion patterns using --exclude:
dpage code index --exclude test legacy scriptsWithout Linking
If you don't want to link the directory, you must provide IDs manually:
dpage code index -o org_123 -p proj_456Check Indexing Status
To see statistics about what has been indexed for your project, use:
dpage code statusExample output:
š Code Indexing Status
āāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāāā
Organization: Acme Corp
Project: My Website
Files indexed: 150
Code chunks: 543
Total size: 2.34 MB
Last indexed: 11/13/2025, 10:30:00 AM
Languages: ts, tsx, jsBest Practices
- Index regularly: Re-index after significant code changes to keep the AI updated.
- Include relevant files: Ensure your
srcdirectory is indexed so the AI understands your components and hooks. - Exclude binaries: Don't index large non-code files (images, PDFs, etc.) as it wastes bandwidth and indexing quota.