Configuration¶
SpecSync reads configuration from several sources so you can tailor the workflow to each repository and workstation.
Configuration Hierarchy¶
From highest to lowest precedence:
Command-line arguments
Environment variables (e.g.,
SPECSYNC_WORKSPACE_ROOT)pyproject.tomlentries under[tool.specsync]
The first source that defines a setting wins. For example, a CLI flag overrides the environment, which overrides the project configuration file.
Environment Variables¶
Variable |
Description |
|---|---|
|
Base directory of your external workspace or vault. |
|
Directory within the repository that stores synchronized specs. Defaults to |
|
Optional name used to filter specs by frontmatter |
Use these variables for per-machine overrides or integrate them into automation.
Project Configuration (pyproject.toml)¶
Add a section similar to the following inside your repository:
[tool.specsync]
workspace_subdir = "specs"
repo_specs_dir = "specs"
project_name = "my-project"
[tool.specsync.filter]
require_expose = true
match_project = true
workspace_subdir: Subdirectory inside the workspace root containing synced files.repo_specs_dir: Repository directory where SpecSync writes the synced files.project_name: Optional default project filter applied when pulling or pushing.require_expose: Enforcesexpose: truein frontmatter before syncing.match_project: Sync only specs whoseprojectmatchesproject_name.
Setting Environment Variables¶
You have several options for configuring environment variables:
Option 1: direnv (Automatic per-directory)¶
direnv automatically loads environment variables when you enter a directory:
# Create .envrc in repository root
export SPECSYNC_WORKSPACE_ROOT="/Users/you/Documents/SpecsVault"
export SPECSYNC_REPO_SPECS_DIR="specs"
export SPECSYNC_PROJECT_NAME="specsync"
Run direnv allow to activate. Remember to add .envrc to .gitignore.
Option 2: Shell Export (Session-only)¶
export SPECSYNC_WORKSPACE_ROOT="/Users/you/Documents/SpecsVault"
Option 3: Shell Configuration (Permanent)¶
Add exports to your shell configuration file (~/.bashrc, ~/.zshrc, etc.) for persistent settings across all projects.
Frontmatter Format¶
SpecSync relies on YAML frontmatter to decide which notes to synchronize. Example:
---
expose: true
project: specsync
status: draft
title: Documentation Plan
---
exposecontrols visibility; only files withtrueare eligible for syncing whenrequire_exposeis enabled.projectlets you scope synchronization to a specific initiative.Additional metadata is preserved but not interpreted directly by SpecSync.