Support project-local (committed) templates
Problem
.orbxrc is meant to be committed and shared (the orbx init scaffold says so),
but template = <name> resolves only against per-user/bundled dirs
(orbx::resolve_template, bin/orbx:95). So a repo can't ship its own template:
template = default → works for everyone (bundled). ✅
template = my-custom → teammates who clone get template "my-custom" not found
unless they manually copy the YAML into ~/.orbx/templates or export
ORBX_TEMPLATE_DIR. ❌
There's no config key for a template directory, and a path value isn't accepted
(it's concatenated as "$dir/$name.yaml"). The only lever, ORBX_TEMPLATE_DIR,
lives outside orbx, so the repo still isn't self-contained.
Proposed solution
Add a template_dir key to .orbxrc, resolved relative to the repo root and
prepended to the search path:
template_dir = .orbx/templates
template = rails-e2e # → ./.orbx/templates/rails-e2e.yaml
Search order becomes:
$ORBX_TEMPLATE_DIR → <template_dir> → ~/.orbx/templates → bundled → <script>/../templates
Keeps template = <name> working, lets a repo carry its own template, and stays
within the security model (config is parsed, never sourced; template_dir is
just a path).
Acceptance criteria
- [ ] template_dir (relative to .orbxrc, or absolute) is honored in
resolve_template/resolve_context.
- [ ] User/bundled shadowing behavior stays defined; missing dir errors clearly.
- [ ] bats coverage + docs (AGENTS.md "Template resolution", orbx init scaffold).
Workaround until then
Commit the template to the repo and set
export ORBX_TEMPLATE_DIR="$PWD/.orbx/templates" via direnv/CI.
Support project-local (committed) templates
Problem
.orbxrcis meant to be committed and shared (theorbx initscaffold says so),but
template = <name>resolves only against per-user/bundled dirs(
orbx::resolve_template,bin/orbx:95). So a repo can't ship its own template:template = default→ works for everyone (bundled). ✅template = my-custom→ teammates who clone gettemplate "my-custom" not foundunless they manually copy the YAML into
~/.orbx/templatesor exportORBX_TEMPLATE_DIR. ❌There's no config key for a template directory, and a path value isn't accepted
(it's concatenated as
"$dir/$name.yaml"). The only lever,ORBX_TEMPLATE_DIR,lives outside orbx, so the repo still isn't self-contained.
Proposed solution
Add a
template_dirkey to.orbxrc, resolved relative to the repo root andprepended to the search path: