Skip to main content
Project scripts cover four different moments in a workspace lifecycle.

Startup command

Use a startup command to arrange a project group with the Radius CLI:
Radius creates the group and its terminal before launching the command. The command receives RADIUS_WINDOW_ID, RADIUS_GROUP_ID, and RADIUS_TAB_ID, so it can open tabs and build splits relative to its own terminal.
Startup commands are literal automation, not a saved layout. Radius does not reuse matching URLs, undo completed commands after a failure, or continue enforcing the result after the script exits.

Write a startup script

Follow the complete CLI guide, including resource IDs and failure handling.

Setup command

Use setup for dependencies or generated files required by a newly created worktree:
Radius opens the worktree, exposes its terminal, and runs setup visibly. The worktree records whether setup is pending, running, successful, failed, or interrupted. If setup fails, open the terminal’s Run… menu and run Setup again after fixing the problem.
Setup prepares files inside a worktree. Startup arranges the Radius group around that worktree. Keep them separate even when both commands run during creation.

Named run commands

Named run commands appear in the terminal’s Run… menu:
The table name after scripts.run is the stable script ID. name is the label shown in Radius. If you omit the name, Radius derives one from the ID. To hide a shared run command on one machine, add this to .radius/settings.local.toml:

Archive command

Use archive for cleanup or validation that must finish before a worktree is removed:
The command runs from the worktree directory with the effective project environment. A non-zero exit status blocks deletion.

Script environment

All project scripts receive variables from project settings plus:
  • RADIUS_PROJECT_ROOT
  • RADIUS_WORKSPACE_PATH
  • RADIUS_WORKSPACE_NAME
  • RADIUS_DEFAULT_BRANCH
Startup terminals also receive the Radius CLI resource IDs.