Declarative filesystem management for developers
Define, version, and replicate directory structures declaratively
Define your filesystem structure in simple, readable spec files
Capture and restore directory states at any point in time
Track changes, lock versions, and safely upgrade structures
Reusable specs with variables for consistent project scaffolding
pip install seed-cli
seed capture --out project.tree
seed plan project.tree
seed apply project.tree
Available on all commands:
seed [command] --verbose # Enable verbose logging
seed [command] --debug # Enable debug logging
seed [command] --ignore PATTERN # Extra ignore patterns (glob)
seed [command] --targets PATTERN # Extra targets (glob)
seed [command] --target-mode {prefix,exact} # Target matching mode
Parse spec and generate execution plan. Runs plugin parse + plan lifecycle and outputs the planned changes without modifying the filesystem.
# Preview what would be created
seed plan project.tree
# With template variables
seed plan project.tree --vars environment=prod
# Export plan as JSON
seed plan project.tree --out plan.json
# Export as Graphviz DOT
seed plan project.tree --dot > plan.dot
Acquire state lock, run hooks (pre_apply, post_apply), execute plan, and run plugin build lifecycle. Creates files and directories as specified.
# Apply spec to current directory
seed apply project.tree
# Apply to specific directory
seed apply project.tree --base ./myproject
# Preview without making changes
seed apply project.tree --dry-run
# Auto-create all optional items
seed apply project.tree --yes
# Skip all optional items
seed apply project.tree --skip-optional
Compare spec with filesystem and show missing, extra, and drifted paths. Useful for detecting drift from your intended structure.
# Compare spec with current directory
seed diff project.tree
# Ignore certain patterns
seed diff project.tree --ignore "*.pyc" --ignore "__pycache__"
# Only show top-level extras
seed diff project.tree --no-sublevels
Capture current filesystem state as a spec file. Useful for creating initial specs from existing projects.
# Capture to file
seed capture --out project.tree
# Capture specific directory
seed capture --base ./src --out src.tree
# Output as JSON
seed capture --json --out project.json
# Output as Graphviz DOT
seed capture --dot --out project.dot
Create a new instance of a template directory structure. Use with specs containing <varname>/ template patterns.
# Create new version directory from template
seed create releases.tree version_id=v3
# Preview without creating
seed create releases.tree version_id=v3 --dry-run
# Multiple variables
seed create project.tree name=myapp env=production
These commands modify the filesystem to match your spec exactly, including deleting extra files. Use with caution.
Same as apply, but also deletes extraneous files. Plugins may veto deletions. Requires --dangerous flag.
# Preview what would be synced
seed sync project.tree --dry-run
# Actually sync (deletes extra files!)
seed sync project.tree --dangerous
# Sync with auto-create optionals
seed sync project.tree --dangerous --yes
Modify filesystem to match the spec. Creates missing items and deletes extras. Use ... in spec to mark directories where extra files are allowed.
# Preview what would change
seed match project.tree --dry-run
# Match filesystem to spec (creates and deletes!)
seed match project.tree --dangerous
# Match specific directory
seed match project.tree --base ./target --dangerous
Use ... to mark directories where extra files should be preserved:
project/
├── src/
│ └── main.py
├── data/ ... # Extra files here won't be deleted
└── config.yaml
Spec files use an intuitive tree-like syntax. Supports .tree, .yaml, .json, .dot, and even images.
project/
├── src/
│ ├── main.py
│ └── utils/
│ └── helpers.py
├── tests/
│ └── test_main.py
├── config.yaml
└── README.md
@generated - File is auto-generated, can be safely overwritten@manual - File is manually maintained, never overwrite? - Optional file or directory (prompts during apply)... - Directory has contents but we don't manage them (preserves extras during sync/match)scripts/
├── build.py @generated
├── config.json @manual
├── cache/ ...
└── docs/?
Create reusable specs with dynamic values:
<varname>/ - Directory placeholder, replaced at runtime{{var}} - String interpolation in file contents<project_name>/
├── src/
│ └── <module_name>/
│ └── __init__.py
├── <environment>/
│ └── config.yaml
└── README.md
# With seed plan/apply
seed apply spec.tree --vars project_name=myapp module_name=core
# With seed create
seed create spec.tree project_name=myapp environment=prod
Import other spec files to compose larger structures:
@include base.tree
@include ./shared/common.tree
project/
├── custom/
└── specific.py
Manage reusable spec templates from GitHub or local sources.
Add a template from GitHub URL or local file path. Supports fetching real file contents from a content source.
# From GitHub
seed templates add https://github.com/user/template-repo
# From local file
seed templates add ./my-templates/python-project.tree
# With custom name
seed templates add ./template.tree --name my-template
# With specific version
seed templates add ./template.tree --name my-template --version v1.0
# With content from GitHub
seed templates add ./fastapi --name fastapi \
--content-url https://github.com/tiangolo/full-stack-fastapi-template/tree/master/backend/app
# With content from a local directory
seed templates add ./my-template --name myapp --content-url /path/to/local/files
List all stored templates with their versions and lock status.
seed templates list
Apply a template to the filesystem. Creates the directory structure defined in the template.
# Use template in current directory
seed templates use python-project
# Use in specific directory
seed templates use python-project --base ./myproject
# With variables
seed templates use python-project --vars name=myapp version=1.0
# Preview without applying
seed templates use python-project --dry-run
# Use specific version
seed templates use python-project --version v2
Show the content of a template.
# Show current version
seed templates show python-project
# Show specific version
seed templates show python-project --version v1
Manage template versions. List versions, add new versions, or set current version.
# List versions
seed templates versions python-project
# Add new version
seed templates versions python-project --add ./updated.tree --name v2
# Set current version
seed templates versions python-project --set-current v2
Lock or unlock a template to prevent/allow updates.
# Lock template
seed templates lock python-project
# Lock at specific version
seed templates lock python-project --version v1
# Unlock template
seed templates lock python-project --unlock
Re-fetch content from a template's content source. Use --all to update every template that has a content URL. Use --content-url to change where content is fetched from.
# Re-fetch content for a template
seed templates update fastapi
# Update all templates
seed templates update --all
# Change content source
seed templates update myapp --content-url https://github.com/owner/repo/tree/develop/src
# Switch from GitHub to local directory
seed templates update myapp --content-url /path/to/local/files
Remove a template from the registry.
seed templates remove python-project
Templates can include a source.json file that tells seed where to fetch real file contents from. When a template with a source.json is installed, seed automatically downloads the files.
{
"content_url": "https://github.com/owner/repo/tree/main/src"
}
Content sources support both local directory paths and GitHub tree URLs. The built-in fastapi, python-package, and node-typescript templates ship with source.json and auto-fetch content on first use.
Use seed templates update with --content-url to point a template at a different source. This updates both meta.json and source.json in ~/.seed/templates/<name>/.
# Point to a different repo/branch
seed templates update myapp \
--content-url https://github.com/owner/repo/tree/develop/src
# Switch to a local directory
seed templates update myapp --content-url /path/to/local/files
Lock filesystem structures to a spec. Supports versioning and watch mode to prevent drift.
Set the active structure spec. Creates a version if needed.
# Set lock with auto-versioning
seed lock set project.tree
# Set lock with specific version name
seed lock set project.tree --version v1.0
# Set lock for specific directory
seed lock set project.tree --base ./myproject
Watch filesystem and enforce structure continuously. Runs as a daemon to detect and report drift.
# Start watching with default interval
seed lock watch
# Watch with custom interval (every 5 seconds)
seed lock watch --interval 5
# Watch specific directory
seed lock watch --base ./myproject
List available structure versions.
seed lock list
Show current structure lock status including active version and any drift.
seed lock status
Upgrade to a newer structure version. Applies changes to bring filesystem to the new version.
# Preview upgrade
seed lock upgrade v2 --dry-run
# Apply upgrade
seed lock upgrade v2 --dangerous
Downgrade to an older structure version.
# Preview downgrade
seed lock downgrade v1 --dry-run
# Apply downgrade
seed lock downgrade v1 --dangerous
Snapshots are created automatically before apply/match/sync operations. Use them to undo changes.
Revert filesystem to a previous snapshot. Snapshots are created automatically before apply/match/sync operations.
# List all snapshots
seed revert --list
# Revert to latest snapshot
seed revert
# Revert to specific snapshot
seed revert abc123
# Preview revert
seed revert abc123 --dry-run
# Delete a snapshot
seed revert --delete abc123
View and manage automatically captured spec versions.
List all captured spec versions with timestamps and metadata.
seed specs list
Show content of a spec version.
# Show latest spec
seed specs show
# Show specific version
seed specs show v1
seed specs show 2
Compare two spec versions to see what changed.
# Compare two versions
seed specs diff v1 v2
seed specs diff 1 3
Lint spec file and optionally auto-fix issues. Checks for syntax errors, invalid paths, and common mistakes.
# Check spec for issues
seed doctor project.tree
# Auto-fix issues
seed doctor project.tree --fix
Export filesystem state or plan in various formats: tree, json, plan, or dot.
# Export current filesystem as tree
seed export tree --out structure.tree
# Export as JSON
seed export json --out structure.json
# Export as Graphviz DOT
seed export dot --out structure.dot
# Export existing spec to different format
seed export json --input project.tree --out project.json
Install git hooks (e.g., pre-commit) to automatically validate filesystem structure on commits.
# Install default pre-commit hook
seed hooks install
# Install specific hook
seed hooks install --hook pre-push
Extract tree structure from an image using OCR. Useful for converting screenshots of directory structures into spec files.
# Extract from screenshot
seed utils extract-tree screenshot.png
# Specify output path
seed utils extract-tree screenshot.png --out project.tree
# Debug OCR output
seed utils extract-tree screenshot.png --raw
Manage execution state locks for concurrent access control. Use if a process crashed and left a stale lock.
# Check lock status
seed utils state-lock
# Force unlock after crash
seed utils state-lock --force-unlock
# Renew existing lock
seed utils state-lock --renew