docs/settings/projects-repositories.mdx
The Projects tab allows you to configure settings specific to individual projects.
The Repositories tab allows you to configure scripts that run when a repository is used in workspaces.
Configure basic repository information:
Configure dev server, setup, and cleanup scripts for this repository. These scripts run whenever the repository is used in any workspace, ensuring a consistent development environment.
Command to start your development server. This enables the built-in preview browser in Workspaces, allowing you to see your application running as you make changes.
Common examples:
| Framework | Command |
|---|---|
| Vite | npm run dev |
| Next.js | npm run dev |
| Create React App | npm start |
| Django | python manage.py runserver |
| Rails | rails server |
Commands that run before the coding agent starts working. Use this to prepare the development environment.
Why use a setup script?
Examples:
# Node.js project
npm install
# Python project
pip install -r requirements.txt
# Multiple commands
npm install && npm run build:deps
# Rust project
cargo fetch
Commands that run when a workspace closes. Use this to clean up resources and stop background processes.
Why use a cleanup script?
Examples:
| Use Case | Command |
|---|---|
| Stop Docker containers | docker compose down |
| Kill background processes | pkill -f "node server.js" |
| Clean build artifacts | rm -rf dist/ .cache/ |
| Stop PostgreSQL | pg_ctl stop -D /usr/local/var/postgres |
| Kill process on port | lsof -ti:3000 | xargs kill -9 2>/dev/null |
Code formatting examples:
| Language/Tool | Command |
|---|---|
| JavaScript/TypeScript (Prettier) | npx prettier --write . |
| JavaScript/TypeScript (ESLint) | npx eslint --fix . |
| Rust (cargo fmt) | cargo fmt |
| Rust (Clippy) | cargo clippy --fix --allow-dirty |
| Python (Black) | black . |
| Python (Ruff) | ruff check --fix . |
| Go | go fmt ./... |
Combining multiple commands:
# Chain commands with &&
docker compose down && rm -rf tmp/
# Format code after agent changes
npx prettier --write . && npx eslint --fix .
# Rust formatting and linting
cargo fmt && cargo clippy --fix --allow-dirty
# Use || true to ignore failures
pkill -f "node server.js" || true
rm -rf .cache/ || true