BUILD

SDK and CLI

The `tessera` binary lives at `/opt/tessera/deploy/tessera` (production). Commands: `auth login`, `projeto criar-ia`, `projeto esperar`, `projeto publicar`, `projeto tema`, `projeto temas`. cURL + jq recipes and Python, Java, PHP, and Go examples are below.

Examples by language

The blocks below cover authentication and the main project flow. Select your stack tab — the same endpoint in each.

Authentication (JWT)

# 1. login
curl -X POST https://tesserra.io/api/auth/login \
  -H "Content-Type: application/json" \
  -d '{ "email": "you@acme.com", "password": "..." }'
# resposta: { "access_token": "eyJ..." }

# 2. uso
curl https://tesserra.io/api/projetos \
  -H "Authorization: Bearer eyJ..."

Create project

curl -X POST https://tesserra.io/api/projetos \
  -H "Authorization: Bearer $TESSERRA_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "nome": "Loja Acme",
    "modo": "simples",
    "ambiente": "prod",
    "resiliencia": "unica"
  }'

Provision

curl -X POST https://tesserra.io/api/projetos/$PROJETO/provisionar \
  -H "Authorization: Bearer $TESSERRA_TOKEN"

Check health

curl https://tesserra.io/api/projetos/$PROJETO/saude \
  -H "Authorization: Bearer $TESSERRA_TOKEN"

curl + jq recipes

Environment variables

bash
export TESSERRA_API="https://tesserra.io/api"
export TESSERRA_TOKEN="$(curl -s -X POST $TESSERRA_API/auth/login \
  -H 'Content-Type: application/json' \
  -d '{"email":"you@acme.com","password":"..."}' | jq -r .access_token)"

List Projects

bash
curl -s $TESSERRA_API/projetos \
  -H "Authorization: Bearer $TESSERRA_TOKEN" \
  | jq '.[] | {nome, estado, modo}'

Create Project and add a resource

bash
PROJ=$(curl -s -X POST $TESSERRA_API/projetos \
  -H "Authorization: Bearer $TESSERRA_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"nome":"Loja","modo":"simples","ambiente":"prod","resiliencia":"unica"}' \
  | jq -r .id)

curl -s -X POST $TESSERRA_API/projetos/$PROJ/recursos \
  -H "Authorization: Bearer $TESSERRA_TOKEN" \
  -H 'Content-Type: application/json' \
  -d '{"tipo":"compute","nome":"web","config":{"subtipo":"web","imagem":"nginx","porta":80}}'

Provision and watch state

bash
curl -s -X POST $TESSERRA_API/projetos/$PROJ/provisionar \
  -H "Authorization: Bearer $TESSERRA_TOKEN"

while true; do
  STATE=$(curl -s $TESSERRA_API/projetos/$PROJ \
    -H "Authorization: Bearer $TESSERRA_TOKEN" | jq -r .estado)
  echo "estado: $STATE"
  [[ "$STATE" == "provisionado" ]] && break
  sleep 5
done

Check health

bash
curl -s $TESSERRA_API/projetos/$PROJ/saude \
  -H "Authorization: Bearer $TESSERRA_TOKEN" \
  | jq '{cpu, p95, erros, sla_mes}'

Example: GitHub Actions

yaml
name: deploy-tessera
on: { push: { branches: [main] } }
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - name: Atualizar imagem do recurso
        env:
          TESSERRA_TOKEN: ${{ secrets.TESSERRA_API_KEY }}
          PROJETO: ${{ secrets.TESSERRA_PROJETO_ID }}
          IMAGEM: ghcr.io/${{ github.repository }}:${{ github.sha }}
        run: |
          curl -s -X POST https://tesserra.io/api/projetos/$PROJETO/recursos/web \
            -H "X-Tesserra-Api-Key: $TESSERRA_TOKEN" \
            -H 'Content-Type: application/json' \
            -d "{\"config\":{\"imagem\":\"$IMAGEM\"}}"
          curl -s -X POST https://tesserra.io/api/projetos/$PROJETO/provisionar \
            -H "X-Tesserra-Api-Key: $TESSERRA_TOKEN"

In pipelines, use the commit SHA as Idempotency-Key on POST calls. Re-runs of the same workflow do not duplicate resources.

Documentation · Tesserra