Spec-driven filesystem orchestration, scaffolding, and maintenance
Define, version, and replicate directory structures declaratively
Export plans to JSON, review them, then apply the exact plan later.
Use reusable templates, content sources, and Copier-style template config.
Plan or execute repository, service, and system upkeep from manifests.
Snapshots, spec history, structure locking, and state locks keep changes auditable.
pip install seed-cli
pip install "seed-cli[image]" # OCR/image parsing
pip install "seed-cli[ui]" # rich terminal output
seed capture --out project.tree
seed plan project.tree --out plan.json
seed apply plan.json
seed maintain maintenance.yml
seed maintain maintenance.yml --execute
.tree, .seed, YAML, JSON, DOT, image OCR, and stdin-driven specs.fastapi, python-package, and node-typescript.--unsafe and answers files stay inside the target base directory.Available on all commands:
seed [command] --verbose # enable verbose logging
seed [command] --debug # enable debug logging
seed [command] --ignore PATTERN # extra ignore patterns
seed [command] --targets PATTERN # extra target globs
seed [command] --target-mode {prefix,exact} # target matching mode
Parse a spec and build a deterministic execution plan without modifying the filesystem.
seed plan project.tree
seed plan project.tree --vars environment=prod
seed plan project.tree --out plan.json
seed plan project.tree --dot > plan.dot
Apply a spec directly or execute a previously saved plan. When applying a spec, seed also registers project-local templates and removes stale literal placeholder paths from older runs.
seed apply project.tree
seed apply plan.json
seed apply project.tree --base ./myproject
seed apply project.tree --dry-run
Register any .tree spec into project .seed support files. If the spec contains template placeholders, seed also extracts project templates and removes stale literal placeholder paths such as <name>/.
seed register project.tree
seed register project.tree --base ./myproject
Compare a spec with the current filesystem and show missing, extra, or drifted paths.
seed diff project.tree
seed diff project.tree --ignore "*.pyc" --ignore "__pycache__"
seed diff project.tree --no-sublevels
Build or execute repository, project, service, and system maintenance plans from YAML or JSON manifests.
seed maintain maintenance.yml
seed maintain ./workspace
seed maintain ./workspace --execute
Capture the current filesystem state as a spec, JSON document, or DOT graph.
seed capture --out project.tree
seed capture --json --out project.json
seed capture --dot --out project.dot
Create a new instance from a spec with template directories, a mirrored project template path, or a registered project template name.
seed create releases.tree version_id=v3
seed create --template .seed/templates/releases.tree version_id=v3
seed create --project version_id version_id=v3
seed create releases.tree version_id=v3 --dry-run
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, .seed, .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/?
Use .seed when tree nodes need inline metadata for semantic kind, tags, or content/source URLs. Directory URLs can hydrate template content from remote sources.
!kind - semantic kind marker such as !service, !doc, or !template+tag - repeatable tags such as +remote or +shared-> URL - metadata URL, used as a content source on directory nodesvendor/
└── api/ !service +remote -> https://github.com/acme/api-client.git
Structured YAML and JSON specs can carry the same data with a metadata object or top-level kind, tags, and url fields.
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
Use the registry for reusable templates, or create directly from project-local templates under .seed/templates/.
Add a template from GitHub or a local .tree/.seed spec. Directory sources can contain spec.seed or spec.tree. Templates can also fetch real file contents from a content source.
seed templates add ./template.tree --name my-template
seed templates add ./template.seed --name service-template
seed templates add ./fastapi --name fastapi \
--content-url https://github.com/tiangolo/full-stack-fastapi-template/tree/master/backend/app
seed templates add ./service.seed --name service \
--content-url https://github.com/acme/service-skeleton.git
Apply a stored template with direct vars, data files, answers files, overwrite rules, and gated template tasks.
seed templates use python-package --base ./myapp
seed templates use python-package --data-file answers.yml --defaults
seed templates use python-package --answers-file .seed/answers.yml
seed templates use python-package --unsafe --overwrite
Inspect templates, manage versions, lock a template to a specific version, refresh content sources, or remove a template from the registry.
seed templates list
seed templates show python-package --version v1
seed templates versions python-package --add ./updated.tree --name v2
seed templates lock python-package --version v2
seed templates update --all
seed templates remove python-package
Run seed register to mirror any .tree or .seed spec into .seed/templates/. If the spec contains template subtrees, seed also extracts nested project templates into .seed/templates/project/. seed apply <spec> runs the same registration step automatically.
seed register releases.tree
seed create --template .seed/templates/releases.tree version_id=v3
seed create --project version_id version_id=v3
Templates can include a source.json file so seed fetches actual file contents from a local directory, a GitHub tree URL, or a git repository URL. .seed directory nodes can also declare nested content sources inline with -> URL.
{
"content_url": "https://github.com/owner/repo/tree/main/src"
}
vendor/
└── api/ !service +remote -> https://github.com/acme/api-client.git
The built-in fastapi, python-package, and node-typescript templates use this pattern. Template storage defaults to ~/.seed/templates/ and can be moved with SEED_HOME.
Template configs are discovered from copier.yml, copier.yaml, .seed-template.yml, or .seed-template.yaml. seed understands question defaults, choices, _exclude, _skip_if_exists, _answers_file, and _tasks.
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
Poll the workspace and capture a new .seed/specs/vN.tree whenever the filesystem structure changes.
seed specs watch
seed specs watch --interval 2
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 lightweight git hooks from seed. Use this when you want repository-local automation around your structure workflow.
# 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
seed integrates with argcomplete for shell tab completion.
eval "$(register-python-argcomplete seed)"
register-python-argcomplete --shell fish seed | source