Overview
OpenGround can crawl and extract documentation from websites using XML sitemaps. This is ideal for documentation hosted on platforms like Mintlify, Docusaurus, or any site that provides a sitemap.Basic Usage
1
Add documentation with sitemap URL
Use the The
add command with a sitemap URL:-y flag skips the confirmation prompt between extract and ingest.2
Verify the library was added
List all libraries in your database:
Filtering URLs
Using Filter Keywords
Use--filter-keyword to only extract URLs containing specific strings:
Multiple Filter Keywords
Specify multiple keywords by using the flag multiple times. URLs matching any keyword will be included:No Filtering
If no filter keywords are provided, all URLs from the sitemap are extracted:Handling Query Parameters
Trimming Query Parameters
Some sitemaps include duplicate URLs with different query parameters. Use--trim-query-params to avoid duplicates:
https://docs.example.com/page?v=1→https://docs.example.com/pagehttps://docs.example.com/page?v=2→https://docs.example.com/page(deduplicated)
Version Handling
Sitemap-based documentation is assumed to be the current/latest version. If you need version-specific documentation:-
Check if the site has version-specific sitemaps:
- Use git repositories instead (if available) for proper version management.
Concurrency Control
By default, OpenGround uses the concurrency limit from your config. You can override it:All Available Flags
Arguments
LIBRARY- Name of the library (required)
Options
--source, -s TEXT- Root sitemap URL (e.g.,https://docs.example.com/sitemap.xml)--filter-keyword, -f TEXT- Filter for URLs (can be specified multiple times)--trim-query-params- Remove query parameters from URLs to avoid duplicates--yes, -y- Skip confirmation prompt between extract and ingest--sources-file TEXT- Path to a custom sources.json file
The following flags are for git sources only and are ignored for sitemaps:
--version, -v- Sitemaps always use “latest”--docs-path, -d- Not applicable to sitemaps
Using Sources Files
When you add documentation with--source, OpenGround automatically saves the configuration to ~/.openground/sources.json:
1
First time: Add with source
2
Later: Add by name only
Auto-Detection
OpenGround can auto-detect sitemap sources:- URL ends with
.xml - URL contains “sitemap” (case-insensitive)
- If detection fails, OpenGround defaults to sitemap with a warning
Updating Documentation
To refresh documentation from a sitemap:Advanced: Direct Extract Command
For advanced use cases, you can use theextract-sitemap command separately:
Examples
Real-World Example: Mintlify Documentation
Docusaurus Site
Entire Site Without Filtering
Troubleshooting
Too Many Pages
If extraction pulls in too many irrelevant pages:- Add more specific filter keywords
- Use multiple keywords to narrow down
- Consider using a git repository source instead if available