openground add command extracts documentation from a source (sitemap, Git repository, or local path) and ingests it into the local vector database.
Usage
Arguments
Name of the library (or source key if no source is provided)
Options
Root sitemap URL, Git repo URL, or local path to process.Aliases:
-sSupports:- Sitemap URLs (e.g.,
https://example.com/sitemap.xml) - Git repository URLs (e.g.,
https://github.com/user/repo.git) - GitHub/GitLab web URLs (e.g.,
https://github.com/user/repo/tree/main/docs) - Local paths (e.g.,
/path/to/docs,~/docs,./docs)
Version of the library to extract. Only works for git repos. Corresponds to the tag of the version in the git repo.Aliases:
-vNote: Sitemap sources always use “latest”. Local paths automatically generate date-based versions (e.g., local-2026-02-28).Path to documentation within a git repo. Specify multiple times for multiple paths.Aliases:
-dIf not specified, indexes the entire repository.Example:String filter for sitemap URLs. Only used for sitemap sources. Can be specified multiple times.Aliases:
-fExample:Skip confirmation prompt between extract and ingest.Aliases:
-yPath to a custom sources.json file. If not provided, checks config for
sources.file_path, then uses default (~/.openground/sources.json).Trim query parameters from sitemap URLs to avoid duplicates.
Behavior
Source Detection
The command automatically detects the source type:- Git Repository: URLs containing
github.comorgitlab.com - Sitemap: URLs ending with
.xmlor containing “sitemap” - Local Path: Paths starting with
/,~,./, or../
.md, .rst, .txt, .mdx, .ipynb, .html, .htm
Library Updates
If the library already exists in the database, the command performs an incremental update:- Added: New pages from the source
- Modified: Pages with changed content (detected via content hash)
- Deleted: Pages removed from the source
- Unchanged: Pages with identical content
Auto-Save to sources.json
When you provide a--source directly (not from a sources file), the configuration is automatically saved to ~/.openground/sources.json for future use. Disable this with:
Examples
Add from Sitemap
Add from GitHub Repository
Add from Local Path
Add with Filter Keywords (Sitemap Only)
Add from sources.json
If your library is already configured in~/.openground/sources.json:
Skip Confirmation Prompt
Output Example
Update Example
Related Commands
- openground update - Alias for updating existing libraries
- openground list - View installed libraries
- openground query - Search the documentation