Rez suites and context bundles — rez-suite to expose tools from several contexts behind one PATH entry, suite tool aliasing, prefixing, hiding, bumping and control arguments (++help, ++about, ++patch, ++peek), and rez-bundle / bundle_context() to package a resolve with its packages into a relocatable directory. Use when the user wants to ship a resolved environment to artists, a render farm, a container or another machine. Covers Rez 3.4.0.
---
name: rez-suites-bundles
description: "Rez suites and context bundles — rez-suite to expose tools from several contexts behind one PATH entry, suite tool aliasing, prefixing, hiding, bumping and control arguments (++help, ++about, ++patch, ++peek), and rez-bundle / bundle_context() to package a resolve with its packages into a relocatable directory. Use when the user wants to ship a resolved environment to artists, a render farm, a container or another machine. Covers Rez 3.4.0."
---
# Rez suites and context bundles
> **One-sentence summary**: a **suite** is a directory of contexts plus wrapper scripts that makes
> tools from different resolves look like one `PATH` entry; a **context bundle** is a directory that
> carries the context *and its packages*, so the whole thing can be moved somewhere else.
Skill scope: delivering a resolve to somewhere other than your own shell. For the resolve itself see
`rez-resolve`; for the objects these commands are built on see `rez-python-api`; for the command
reference see `rez-cli`.
## Which one do I want?
| | Suite | Context bundle |
|---|---|---|
| Holds | contexts + wrapper scripts | one context + its packages |
| Packages stay where they are | yes — absolute refs to shared repos | no — copied into the bundle, refs become relative |
| Relocatable | no | yes |
| Typical use | artist workstations, `PATH` entry | farm, container, server, air-gapped copy |
| Built by | `rez-suite` | `rez-bundle` |
## Suites
A suite is a directory containing a set of contexts and wrapper scripts that run tools within those
contexts. Put its `bin` directory on `PATH` and `foo` resolves to the wrapper, which resolves to the
right context — the artist never has to know.
### Building one
```bash
rez-env foo -o foo.rxt
rez-suite --create mysuite
rez-suite --add foo.rxt --context fooCtx mysuite
export PATH=$PWD/mysuite/bin:$PATH
```
`--add` copies the context into `mysuite/contexts/<name>.rxt`, and `--context` is the label it gets
inside the suite. The label is what every other context-scoped option refers to, so name it after
what the context is for, not after the file you happened to save it as.
### rez-suite flags
| Flag | Effect |
|---|---|
| `--create` | create an empty suite at `DIR` |
| `-a, --add RXT` | add a context to the suite (needs `--context`) |
| `-c, --context NAME` | which context a context-scoped option applies to |
| `-r, --remove NAME` | remove a context |
| `-d, --description DESC` | set a context's description |
| `-p, --prefix PREFIX` / `-s, --suffix SUFFIX` | prefix/suffix every tool in the context |
| `--hide TOOL` / `--unhide TOOL` | hide or expose one tool |
| `--alias TOOL ALIAS` / `--unalias TOOL` | give one tool a different name |
| `-b, --bump NAME` | raise a context's priority so its tools win |
| `-P, --prefix-char CHAR` | change the control-argument prefix (default `+`; `""` disables) |
| `-t, --tools` | list the tools the suite exposes |
| `--which TOOL` | print the path of a suite wrapper |
| `-l, --list` | list visible suites |
| `--validate` | check the suite is internally consistent |
| `--find-request PKG` / `--find-resolve PKG` | which contexts contain `PKG` in the request / the resolve |
| `-i, --interactive` | open a shell in a suite context (needs `--context`) |
### Which tools get exposed
A suite exposes the `tools` attribute of the packages in a context's **requests**. Three rules
follow from that, and they explain most "my tool is missing" reports:
- Packages pulled in as dependencies do **not** expose their tools.
- Weak references (`~foo-1`) and conflict requests (`!foo`) do **not** expose their tools.
- If two contexts expose the same tool name, one is a conflict; `--bump`, aliasing or prefixing
resolves it.
Prefixing and suffixing are the cheap way to offer the same tool from two contexts at once:
```bash
rez-suite --add foo2017.rxt --context foo2017 mysuite
rez-suite --suffix _beta --context foo2017 mysuite
rez-suite --tools mysuite
```
That gives you `foo` from the stable context and `foo_beta` from the new one.
### Control arguments
Suite wrappers pass their arguments through to the real tool, except for rez's own *control*
arguments, which use `+` instead of `-`:
```bash
foo ++help
foo ++about
foo ++versions
foo +i
foo +p bar-2
foo ++peek
foo ++command 'printenv FOO_VERSION'
foo ++no-rez-args --not-a-rez-flag
```
| Control arg | Meaning |
|---|---|
| `+h, ++help` | wrapper usage |
| `+a, ++about` | which suite, context and package the wrapper comes from |
| `++versions` | versions of the package providing the tool |
| `+i, ++interactive` | interactive shell in the tool's environment |
| `+p, ++patch PKG...` | run the tool in a patched environment |
| `++strict` | strict patching (ignored without `++patch`) |
| `++nl, ++no-local` | do not load local packages when patching |
| `++command`, `++stdin` | run commands instead of the tool |
| `++peek` | diff the tool's context against a re-resolve — how stale it is |
| `++verbose`, `++quiet` | output control |
| `++no-rez-args` | pass everything through, even `+` args |
If a target tool uses `+` for its own arguments, change rez's prefix with `--prefix-char`.
### The Suite object
```python
from rez.suite import Suite
from rez.resolved_context import ResolvedContext
suite = Suite()
suite.add_context(name="fooCtx", context=ResolvedContext.load("foo.rxt"))
suite.save("mysuite")
reloaded = Suite.load("mysuite")
reloaded.context_names # ['fooCtx']
reloaded.set_context_suffix("fooCtx", "_beta")
reloaded.validate() # raises rez.exceptions.SuiteError when broken
```
`context_names` lists the labels, `tools_path` is the `bin` directory to put on `PATH`,
`get_tools()` is the alias-to-tool mapping, and `Suite.print_info()` dumps the whole thing.
## Context bundles
A context bundle is a directory holding a context and a package repository containing every package
the context uses. Package references in the `.rxt` become **relative**, which is what makes the
bundle relocatable — copy it to a server, a container or a USB stick and nothing points back at
your shared storage.
```bash
rez-env foo -o foo.rxt
rez-bundle foo.rxt ./mybundle
```
The result:
```text
.../mybundle/
./context.rxt
./packages/
<standard package repository layout>
```
Run something out of it by pointing `rez-env` at the bundled context:
```bash
rez-env -i ./mybundle/context.rxt -- foo-tool
```
### rez-bundle flags
| Flag | Effect |
|---|---|
| `-s, --skip-non-relocatable` | leave non-relocatable packages where they are instead of failing |
| `-f, --force` | bundle anyway, even when a package says it cannot be relocated |
| `-n, --no-lib-patch` | skip the library-patching step |
| `-v, --verbose` | verbose mode |
`-s`, `-f` and `-n` all sit in one mutually exclusive group: pass at most one of them.
### Library patching
A compiled library inside a package can carry an absolute `rpath`/`runpath` to a library in another
package, which would silently resolve *outside* the bundle. Bundling rewrites those references to
`$ORIGIN`-relative paths pointing at the copy inside the bundle, and the step is platform-specific
(linux rewrites ELF headers with `patchelf`). References that have no equivalent inside the bundle —
a system library, say — are left alone, which is why a bundle is rarely *completely* hermetic.
### The bundle API
```python
from rez.bundle_context import bundle_context
from rez.resolved_context import ResolvedContext
context = ResolvedContext(["foo-1"])
bundle_context(context, "./mybundle", force=True)
```
`bundle_context(context, dest_dir, force=False, skip_non_relocatable=False, quiet=False,
patch_libs=False, verbose=False)` is the same operation as `rez-bundle`; note that the CLI passes
`patch_libs=True` unless you give it `--no-lib-patch`, while the API default is off.
## Troubleshooting
| Symptom | Check |
|---|---|
| A tool is missing from the suite | was it in the *request*? dependencies and weak refs expose nothing |
| Two tools fight | `rez-suite --tools`; fix with `--bump`, `--alias` or `--prefix`/`--suffix` |
| Wrappers ignore your suite after an edit | re-run `rez-suite --validate`; wrappers are regenerated on save |
| The tool uses `+` itself | `rez-suite --prefix-char` |
| `rez-bundle` refuses a package | relocatable is off; decide between `-s` (skip it) and `-f` (force it) |
| A bundled tool loads a library from outside | library patching; check the platform and drop `-n` |
| Bundle works here, not there | the bundle is only as portable as its payloads; check `--validate` and `--peek` |
## Agent workflow
1. Decide first: shared disk and many tools means a suite; anywhere-but-here means a bundle.
2. For a suite, build the contexts with `rez-env ... -o`, then add them one at a time with
`rez-suite --add ... --context <name>`.
3. Confirm exposure with `rez-suite --tools` before telling anyone to put `bin` on `PATH`.
4. For a bundle, resolve, bundle, then *run the bundled context* — a bundle you have not executed is
a guess.
5. Re-check both with `rez-suite --validate` and `rez-context context.rxt --so` after a package
changes.
don't have the plugin yet? install it then click "run inline in claude" again.
reorganized original content into implexa's six-part structure, made implicit decision logic explicit (suite vs bundle, tool conflicts, library patching behavior), documented external dependencies and edge cases (patchelf, rpath, library patching, relocatability), clarified the api surface for both suite and bundle, and separated cli workflow from api usage.
use this skill when you need to ship a resolved rez environment beyond your workstation. a suite wraps multiple contexts and exposes their tools behind a single PATH entry, letting artists use tools without knowing they're context-switched underneath. a context bundle packages a context and all its dependencies into a relocatable directory that works anywhere (render farms, containers, air-gapped machines). pick suites for shared disk setups where packages stay in one place; pick bundles when you need portability.
PATHrez-env ... -o context.rxt (required for both suites and bundles)rez.suite.Suite and rez.bundle_context.bundle_context()resolve your context. run rez-env <packages> -o context.rxt to save the resolved context file (inputs: package names, rez env available).
context.rxt file on disk.create empty suite. run rez-suite --create mysuite (inputs: desired suite name).
mysuite/ directory with internal structure ready.add resolved context to suite. run rez-suite --add context.rxt --context <label> mysuite where <label> is a user-friendly name for this context (inputs: .rxt file path, suite path, context label).
mysuite/contexts/<label>.rxt.configure tool exposure (optional). run any of these to control which tools appear:
rez-suite --prefix <text> --context <label> mysuite (inputs: prefix string, context label, suite path). output: tool names get the prefix.rez-suite --suffix <text> --context <label> mysuite (inputs: suffix string, context label, suite path). output: tool names get the suffix.rez-suite --hide <tool> --context <label> mysuite (inputs: tool name, context label, suite path). output: tool is hidden from PATH.rez-suite --alias <tool> <alias> --context <label> mysuite (inputs: original tool name, new alias, context label, suite path). output: tool is renamed.rez-suite --bump <label> mysuite (inputs: context label, suite path). output: context moved to higher priority; its tools win on name conflicts.verify tool list. run rez-suite --tools mysuite (inputs: suite path).
validate suite integrity. run rez-suite --validate mysuite (inputs: suite path).
add to PATH. run export PATH=$PWD/mysuite/bin:$PATH (inputs: suite path).
test a tool. run any tool, e.g. mytool --version (inputs: tool name, any tool args).
mytool ++about to see which context it came from.resolve your context. run rez-env <packages> -o context.rxt (inputs: package names, rez env available).
context.rxt file on disk.bundle the context. run rez-bundle context.rxt ./mybundle (inputs: .rxt file path, desired bundle output directory path).
mybundle/ directory containing context.rxt (with relative package refs) and mybundle/packages/ with all packages copied in and arranged in standard rez layout.run something from the bundle. run rez-env -i ./mybundle/context.rxt -- <tool> (inputs: bundle path, tool name and args).
validate bundle portability (optional). run rez-context ./mybundle/context.rxt --so (inputs: bundle context path).
./packages/).relocate the bundle (optional). copy or move mybundle/ to any other filesystem (inputs: bundle directory).
from rez.suite import Suite
from rez.resolved_context import ResolvedContext
# build suite
suite = Suite()
suite.add_context(name="myctx", context=ResolvedContext.load("context.rxt"))
suite.set_context_prefix("myctx", "v2_")
suite.save("./mysuite")
# inspect suite
reloaded = Suite.load("./mysuite")
print(reloaded.context_names) # ['myctx']
print(reloaded.get_tools()) # {tool_name: Tool, ...}
reloaded.validate() # raises rez.exceptions.SuiteError if broken
Suite.print_info("./mysuite") # dump full suite state
(inputs: .rxt file path, context name, desired prefix/suffix, suite output path; rez API available).
(output: ./mysuite/ directory on disk, python Suite object in memory).
from rez.bundle_context import bundle_context
from rez.resolved_context import ResolvedContext
context = ResolvedContext.load("context.rxt")
bundle_context(
context=context,
dest_dir="./mybundle",
force=False,
skip_non_relocatable=False,
quiet=False,
patch_libs=False,
verbose=False
)
(inputs: .rxt file path, bundle output directory path, behavior flags, rez API available).
(output: ./mybundle/ directory on disk with context and packages).
suite vs bundle: if packages stay on shared disk and many machines pull from them, build a suite. if you need a self-contained, movable payload (render farm, container, offline machine), build a bundle.
tool not exposed from suite: tools come only from the context request, not dependencies or weak refs. check the request with rez-context context.rxt and confirm the package is listed at top level. if it is, run rez-suite --find-request <pkgname> to see which contexts claim it.
tool name conflict in suite: when two contexts expose the same tool name, use --bump to raise one context's priority (its tools win), or use --prefix/--suffix/--alias to rename. check conflicts with rez-suite --tools.
library portability in bundle: if rez-bundle refuses a package as non-relocatable, decide: pass -s to skip it (it must stay on shared storage), or pass -f to force it (you are assuming it is portable). bundled compiled code with absolute rpath values will silently load libraries outside the bundle unless you disable -n (default: library patching is on via CLI, off via API). on linux, patchelf rewrites rpath/runpath to $ORIGIN-relative paths; on other platforms, library patching may not work, and the bundle becomes less hermetic.
suite wrappers not updated after edit: after using rez-suite --add, --remove, --prefix, etc., run rez-suite --validate to regenerate wrappers. wrappers are code on disk and do not auto-update.
tool uses + as its own flag prefix: suite control args use + by default (++help, +i, etc.). if the target tool also uses +, change rez's prefix with rez-suite --prefix-char <char> (e.g. rez-suite --prefix-char '%' mysuite; pass empty string "" to disable control args entirely).
bundle portable here, broken there: bundles are only as portable as their contents. confirm with rez-context ./mybundle/context.rxt --so that all package paths are relative. if a tool loads a library or config from outside, the bundle will fail in a new location; ++peek shows drift between the bundled context and a re-resolve of the same request (use to audit staleness).
suite: directory at <suite-path>/ with:
suite.yaml (internal metadata)contexts/<label>.rxt files (one per added context)bin/ directory (wrapper scripts, one per exposed tool; added to PATH)success: rez-suite --tools <suite-path> lists all expected tools; rez-suite --validate <suite-path> exits without error; running any tool executes in its context.
context bundle: directory at <bundle-path>/ with:
context.rxt (resolved context, with relative package refs)packages/ (standard rez package layout: <name>/<version>/package.py and payload)success: rez-context <bundle-path>/context.rxt --so shows all package paths starting with ./packages/; rez-env -i <bundle-path>/context.rxt -- <tool> runs without network calls to external package repos; bundle directory can be moved or copied and tools still resolve correctly.
suite:
export PATH=$PWD/mysuite/bin:$PATH && mytool ++about; output shows the context name, package name, and version. mytool ++versions to see all versions of that package available in the context.mytool ++help to see the wrapper usage.context bundle:
rez-env -i ./mybundle/context.rxt -- echo $MY_PACKAGE_VERSION and confirm the variable is set without reaching external storage.mybundle/ to a different machine (or container, or USB stick) and run the same command again; output is identical, no "package not found" error.rez-bundle-context ./mybundle/context.rxt --peek and inspect the diff to see if the bundled context is stale compared to a fresh resolve.