Infrastructure as code
Infrastructure as code keeps your organization’s Ren setup as files in Git, and the ren infra commands make Ren match them.
When to use it
Use it when you want to review setup changes the way you review code: in a pull request, with a plan of what will change and the history in Git. It also suits a coding agent that drafts your setup, because you can read its files and its plan before anything changes.
The files live in a .ren folder in your repository. Together they’re your spec: a description of what your organization should look like in Ren. ren infra plan shows what would change in Ren, ren infra apply makes the changes, and a lock file records what Ren looked like the last time you synced.
You can still change things in the app. The next plan shows those changes, and ren infra pull writes them into your spec.
Get started
You need the CLI, signed in as an Owner or Admin of the organization. This example adds the Engineering space and its planner agent to acme.
-
Pull your organization into
.ren:ren infra pullThis creates
.renwith your organization settings and shared spaces as files, plusdeploy.yamlandren.lock. -
Add the space and the agent as files in
.ren:spaces/engineering/space.yaml name: Engineeringspaces/engineering/agents/planner/agent.yaml description: Breaks a request into steps.spaces/engineering/agents/planner/instructions.md Break each request into small steps. Name the files you expect to change. -
See what would change in Ren:
ren infra planOutput + create space spaces/engineering + create agent spaces/engineering/agents/planner Digest: 6a1c80664535bd7dc8591f61cc602541d69f82a6900bb3d12bc21578609584ac -
Apply the plan. It lists the changes again and asks you to type the organization’s slug:
ren infra applyOutput + create space spaces/engineering + create agent spaces/engineering/agents/planner Type acme to apply: acme Applied 2 changes. -
Commit
.ren, includingren.lock.
Engineering and planner are now in Ren, and the next ren infra plan prints No changes. Plan and apply covers the rest: changes made in the app, conflicts, removals, and applying from a script.
What the spec covers
The spec describes your whole organization: its settings, and every shared space with its agents, apps, automations and channels. It’s all or nothing. Once a space has been pulled or applied, deleting its folder archives the space at the next apply, so you can’t keep a few spaces in the spec and leave the rest out.
Configuration files shows where each file goes and links to the page for each part.
Some things stay in the app:
- Personal spaces.
- Members, their roles and who is in each space.
- Secrets and sign-ins. You can declare a shared profile, but you connect it in the app.
- Connecting Slack or GitHub. You can only point a space at a Slack channel or repository that Ren already has access to.
- Chats, tasks, Drive and artifacts.