Setup & Teardown Scripts
Overview
Run commands automatically when creating or deleting workspaces.
Create .superset/config.json in your project:
{
"setup": ["bun install", "cp \"$SUPERSET_ROOT_PATH/.env\" .env"],
"teardown": ["docker-compose down"]
}How It Works
- Create workspace → setup commands run
- Delete workspace → teardown commands run
Commands run sequentially in the workspace directory.
Environment Variables
| Variable | Description |
|---|---|
SUPERSET_ROOT_PATH | Path to root repository |
SUPERSET_WORKSPACE_NAME | Current workspace name |
Examples
Node.js:
{ "setup": ["bun install", "cp \"$SUPERSET_ROOT_PATH/.env\" .env"] }Docker:
{
"setup": ["docker-compose up -d", "bun run db:migrate"],
"teardown": ["docker-compose down -v"]
}User Overrides
Override project setup/teardown scripts without modifying the repo by placing a config.json in your home directory:
~/.superset/projects/<project-id>/config.jsonWhere <project-id> is your project's unique ID in Superset (visible in the app's project settings).
Priority Order
Config is resolved in this order (first found wins, for both setup and teardown):
~/.superset/projects/<project-id>/config.json— user override<worktree>/.superset/config.json— worktree-specific<repo>/.superset/config.json— project default
No merging occurs between levels—the first config found is used entirely.
Examples
Custom setup script:
{
"setup": ["~/.superset/projects/<project-id>/setup.sh"],
"teardown": ["~/.superset/projects/<project-id>/teardown.sh"]
}Skip setup entirely:
{ "setup": [], "teardown": [] }Local Config
Extend or override your team's committed scripts without modifying the repo. Create .superset/config.local.json alongside config.json — it's gitignored automatically.
Prepend and/or append
Add steps before or after the team's scripts:
{
"setup": {
"before": ["echo 'running pre-setup'"],
"after": ["./.superset/my-post-setup.sh"]
},
"teardown": {
"after": ["./.superset/my-cleanup.sh"]
}
}Result: before → committed setup scripts → after. Keys you don't specify pass through unchanged.
Override entirely
Use a plain array to replace the team's scripts completely:
{
"setup": ["./.superset/my-custom-setup.sh"]
}Mix and match
Override one key while extending the other:
{
"setup": { "after": ["bun run my-extra-step"] },
"teardown": ["my-custom-teardown.sh"]
}Resolution order
The local config merges on top of whichever base config wins the priority order. If a config.local.json exists in both the worktree and main repo, the worktree's local config takes priority.
Force Delete
If teardown scripts fail during workspace deletion, you can force-delete to skip the failed teardown and continue cleanup.
When teardown fails:
- Error toast appears with "Delete Anyway" and "View Logs" buttons
- Click "Delete Anyway" to force-delete immediately
- Or click "View Logs" to review the failure, then force-delete from the dialog
Tips
- Keep setup fast—runs every workspace creation
- Commit
.superset/to share with team - Use shell scripts for complex logic:
"setup": ["./.superset/setup.sh"] - Use
config.local.jsonto add personal steps without touching the team's config - Use user overrides (
~/.superset/projects/) to replace scripts entirely per-project