Overview
OpenGround usessources.json files to store library source configurations. This allows you to add documentation by name alone, without repeatedly specifying URLs and options.
How Sources Files Work
When you add documentation with the--source flag, OpenGround automatically saves the configuration so you can reference it by name later.
Types of Sources Files
OpenGround supports multiple sources files with a priority system:1. User Sources File
Location:~/.openground/sources.json
- Shared across all your projects
- Created automatically when you first use
--source - Default location for auto-saved sources
2. Project Sources File
Location:.openground/sources.json (in project directory)
- Project-specific overrides
- Takes priority over user sources
- Useful for project-specific documentation versions
3. Custom Sources File
Location: Anywhere you specify- Specified via
--sources-fileflag - Takes highest priority
- Useful for team-shared configurations
4. Package-Level Sources
Location: Inside OpenGround package- Bundled default sources
- Lowest priority (fallback)
Priority Order
When looking up a library by name, OpenGround checks in this order:2. Project-local .openground/sources.json
Located in current directory’s
.openground/ folder.Allows project-specific overrides.Sources File Structure
Thesources.json file maps library names to their configurations:
Source Type Fields
Git Repository ("type": "git_repo")
type- Must be"git_repo"repo_url- Git repository URL (required)docs_paths- Array of paths within repo (optional, defaults to entire repo)languages- Array of programming languages (optional, metadata only)
Sitemap ("type": "sitemap")
type- Must be"sitemap"sitemap_url- URL to XML sitemap (required)filter_keywords- Array of URL filters (optional)languages- Array of programming languages (optional, metadata only)
Local Path ("type": "local_path")
type- Must be"local_path"local_path- Path to local directory (required)languages- Array of programming languages (optional, metadata only)
Auto-Save Behavior
By default, OpenGround automatically saves sources to~/.openground/sources.json when you use --source:
Disable Auto-Save
To disable automatic source saving:Re-enable Auto-Save
Project-Specific Overrides
Use project-local sources files to override user sources for specific projects:Custom Sources File
Share a sources file across a team:Set Default Custom Sources
Configure OpenGround to always use a custom sources file:Viewing Sources Files
View User Sources
View Project Sources
View Which File Is Used
When you runadd with an existing source, OpenGround shows which file it’s using:
Editing Sources Files
Manual Editing
You can directly edit the JSON file:Adding a New Source Manually
Modifying Existing Source
Examples
Team Workflow
Multi-Project Developer
Personal + Team Sources
Troubleshooting
Library Not Found
If OpenGround can’t find a library:Wrong Source Being Used
Check the priority order:Invalid JSON
If you get JSON parse errors:Auto-Save Not Working
Check if auto-save is enabled:Best Practices
-
Use user sources for personal libraries - Keep frequently used libraries in
~/.openground/sources.json -
Use project sources for project-specific versions - Override in
.openground/sources.jsonwhen needed -
Share team sources via config - Point
sources.file_pathto a shared location -
Keep sources.json in version control - Commit
.openground/sources.jsonto share with team - Document custom sources - Add comments in README about custom sources setup