Version Specifiers
| Format | Meaning | Example |
|---|---|---|
slug | Latest version | git-workflow |
slug==X.Y.Z | Exact version | git-workflow==1.0.0 |
slug>=X.Y.Z | Minimum version | git-workflow>=1.0.0 |
slug^X.Y.Z | Compatible (same major, >= specified) | git-workflow^1.0.0 |
major.minor.patch).
Compatible (^) means: same major version, at least the specified minor.patch. For example, ^1.2.0 matches 1.2.0, 1.3.0, 1.99.0, but not 2.0.0.
Resolution Algorithm
When you install a role with dependencies:- Fetch the role from the registry
- Read
metadata.strawpot.dependenciesfrom its frontmatter - For each dependency, recursively fetch and read its dependencies
- Resolve version constraints (find best matching version for each)
- Topological sort with cycle detection
- Return install order (leaves first)
/api/v1/roles/:slug/resolve endpoint, which returns the complete dependency tree.
Project File (strawpot.toml)
Declare project dependencies in strawpot.toml:
Constraint Formats
| Format | Meaning |
|---|---|
"*" | Any version (install latest) |
"^X.Y.Z" | Compatible — same major, >= specified |
"==X.Y.Z" | Exact version |
">=X.Y.Z" | Minimum version |
Commands
Update Behavior with --save
When strawhub update --save is used, the constraint operator is preserved — only the version number changes:
| Before | Installed | After |
|---|---|---|
^1.0.0 | 1.3.0 | ^1.3.0 |
==1.0.0 | 2.0.0 | ==2.0.0 |
>=1.0.0 | 1.5.0 | >=1.5.0 |
* | 3.0.0 | * (unchanged) |
Directory Structure
Local Scope (project-level)
Global Scope
Scope Resolution
- Install: defaults to local. Use
--globalfor global. - Resolve: checks local first, then global. Local takes priority.
- Project file: local only.
--saveflags are incompatible with--global.