API Reference¶
The repoenv Python package is primarily an implementation detail of the renv CLI. Symbols and module layout may change before v1.0 — pin your dependency if you integrate programmatically.
Direct CLI users can skip this section.
repoenv¶
repoenv
¶
repo-env: git-worktree environments across many repositories.
Public command is renv; import package is repoenv.
repoenv.domain¶
repoenv.domain
¶
Pure domain layer: models and logic with no IO.
Environment
¶
Bases: BaseModel
A named collection of git worktrees.
Source code in src/repoenv/domain/models.py
touch()
¶
RepoEntry
¶
Bases: BaseModel
A single repository's worktree within an environment.
Source code in src/repoenv/domain/models.py
RepoStatus
¶
RunResult
¶
Bases: BaseModel
Outcome of running a command in one repository's worktree.
Source code in src/repoenv/domain/models.py
ok
property
¶
True when the command succeeded (or the repo was skipped).
SetOp
¶
RunSummary
dataclass
¶
Aggregate counts for a batch run.
Source code in src/repoenv/domain/summary.py
from_results(results)
classmethod
¶
Build a summary from per-repo results.
Source code in src/repoenv/domain/summary.py
resolve_selection(candidates, *, include=None, exclude=None)
¶
Resolve a selection of names from candidates.
includeglobs are OR-ed; if omitted, all candidates are included.excludeglobs are applied after include and take precedence.- Order is preserved from
candidates; duplicates are removed. - Patterns may contain
**to match across path separators. - Comma-separated values within a single pattern string are split.
Source code in src/repoenv/domain/selection.py
set_combine(left, right, op)
¶
Combine two ordered name lists with a set operation, preserving order.
Order follows left first, then any new names from right (for union).
Source code in src/repoenv/domain/selection.py
aggregate_exit_code(results)
¶
Map a batch of results to a single process exit code.
- no results -> NOTHING_MATCHED
- all ok/skipped -> OK
- some ok, some failed -> PARTIAL
- all failed -> GENERIC
Source code in src/repoenv/domain/summary.py
repoenv.services¶
repoenv.services
¶
Orchestration services: use-cases that coordinate domain + adapters.
repoenv.adapters¶
repoenv.adapters
¶
IO-boundary adapters (mockable): config, state, and git.
repoenv.errors¶
repoenv.errors
¶
Typed exception hierarchy mapped to stable process exit codes.
Exit-code contract (from the safety spec): 0 ok 1 generic error 2 usage error 3 partial failure (some repos failed) 4 nothing matched 5 config / state error
ExitCode
¶
RepoEnvError
¶
Bases: Exception
Base class for all repo-env errors.
Carries an :class:ExitCode plus an optional user-facing hint that the
UI layer renders as a "next step" line.
Source code in src/repoenv/errors.py
UsageError
¶
NothingMatchedError
¶
Bases: RepoEnvError
A selector or glob matched no repositories.
Source code in src/repoenv/errors.py
PartialFailureError
¶
Bases: RepoEnvError
Some repositories in a batch operation failed.