Workspace as code
Keep your workspace's stages and automations in Git, and change them with the SuperPlane CLI.
Workspace as code keeps your workspace’s workflow in files you can review in a pull request. The manifest, .superplane/main.yml, defines the workspace name, its stages in order, and which automations run in each stage. Each automation is its own file in .superplane/automations/.
You need the SuperPlane CLI, connected to your organization.
Export a workspace
Section titled “Export a workspace”Export the workspace from the root of your repository. Replace WEB with your workspace key or ID.
superplane workspace export --workspace WEBThe export writes the .superplane/ folder with the manifest and every automation file it references. Use --output-dir to write it somewhere else, and --overwrite to replace an earlier export.
The manifest
Section titled “The manifest”apiVersion: v2kind: Factoryname: Checkoutstages: # Keep Backlog and the other exported stages here. - id: deploy name: Deploy auto_advance: false automations: - id: prepare-release name: Prepare release uses: automations/prepare-release.yml # Keep the exported Done stage last.The manifest uses kind: Factory for a workspace. Each stage has an id, a name, an optional auto_advance setting, and its automations. Each automation entry points to its file with a uses path relative to the manifest. See Stages and Steps for what goes in each.
When you edit an export, keep the existing stages and automations with their IDs, and keep the fields you don’t change, such as run. The repositories section describes the workspace’s current repository connections. Change repositories in the workspace’s Agent settings and export again.
Plan and apply changes
Section titled “Plan and apply changes”Preview the change from the repository root:
superplane workspace plan --workspace WEBThe plan compares the manifest and its automation files with the workspace and lists every change, including removals. Commit the manifest and the automation files together. After review, apply the change from the approved revision:
superplane workspace apply --workspace WEBThe CLI makes a fresh plan and asks you to confirm it. Add --yes to apply without the prompt, for example from CI.
Share automations between workspaces
Section titled “Share automations between workspaces”Two workspaces can use separate manifests that reference the same automation file. Pass a manifest with -f and its workspace with --workspace:
superplane workspace plan -f .superplane/web.yml --workspace WEBEach workspace keeps its own tasks, automation run history, and repository connections.
- Existing automations stay in their current stage. To move one, remove it and add a new one in the other stage.
- Removing a stage you added also removes its automations. Backlog, Done, and the stages a workspace starts with stay.
- Automation names are unique in the workspace.
- YAML anchors and aliases aren’t supported.
- Secrets that a step names must already exist in your organization. See Secrets.
GitHub push sync is planned. Track GitHub sync support.