Examples

Real-world configuration examples for common use cases.

Quick Examples

Frontend Development

 1resources:
 2  frontend:
 3    http:
 4      - cdn.jsdelivr.net
 5      - unpkg.com
 6      - fonts.googleapis.com
 7    mounts:
 8      - source: ${{ env.HOME }}/.npm
 9        target: /home/${{ conf.TARGET_USER }}/.npm
10        mode: rw
11
12apply:
13  - path: ./
14    resources: [base-allowlist]
15  - path: frontend
16    resources: [frontend]
1shai -rw frontend/src -- claude-code

Backend API

 1resources:
 2  api-dev:
 3    vars:
 4      - source: DATABASE_URL
 5    mounts:
 6      - source: ${{ env.HOME }}/.cargo
 7        target: /home/${{ conf.TARGET_USER }}/.cargo
 8        mode: rw
 9    ports:
10      - host: localhost
11        port: 5432
12
13apply:
14  - path: backend/api
15    resources: [api-dev]
1shai -rw backend/api -- cargo build

ML/AI Development

 1resources:
 2  ml-tools:
 3    http:
 4      - huggingface.co
 5    vars:
 6      - source: HUGGINGFACE_TOKEN
 7    mounts:
 8      - source: ${{ env.HOME }}/.cache/huggingface
 9        target: /home/${{ conf.TARGET_USER }}/.cache/huggingface
10        mode: rw
11
12apply:
13  - path: ml
14    resources: [ml-tools]
15    image: ghcr.io/my-org/pytorch-gpu:latest

Deployment

 1resources:
 2  deploy:
 3    vars:
 4      - source: AWS_ACCESS_KEY_ID
 5      - source: AWS_SECRET_ACCESS_KEY
 6    http:
 7      - amazonaws.com
 8    calls:
 9      - name: deploy-to-staging
10        description: Deploy to staging
11        command: /usr/local/bin/deploy.sh
12        allowed-args: '^--env=staging$'
13
14apply:
15  - path: infrastructure
16    resources: [deploy]

Agent Integration

Claude Code

1# Basic usage
2shai -rw src -- claude-code --dangerously-bypass-approvals-and-sandbox
3
4# With specific component
5shai -rw src/components/Auth -- claude-code --dangerously-bypass-approvals-and-sandbox

Codex

1shai -rw backend/services -- codex --dangerously-bypass-approvals-and-sandbox

Gemini CLI

1shai -rw packages/web-app -- gemini-cli

Monorepo Pattern

 1apply:
 2  - path: ./
 3    resources: [base-allowlist, git-ssh]
 4
 5  - path: packages/web-app
 6    resources: [frontend-tools]
 7
 8  - path: packages/api-client
 9    resources: [typescript-tools]
10
11  - path: services/auth
12    resources: [backend-tools, database-access]
13
14  - path: services/payments
15    resources: [backend-tools, database-access, stripe-api]
16
17  - path: infrastructure
18    resources: [cloud-tools]
19    image: ghcr.io/my-org/devops:latest

Usage:

1# Work on web app
2shai -rw packages/web-app
3
4# Work on auth service
5shai -rw services/auth
6
7# Work on infrastructure
8shai -rw infrastructure

See Also