Learning paths / Vibe coding to production / Ship it with an agent

Lab: ship the starter

Verified lab · 35 min · Module 8, lesson 3 of 440 min left in this module

Module 8 · Ship it with an agentLesson 3 of 4

Self-checked for now. Automatic checking arrives with sign-in; until then, tick off each item under Check your work yourself.

Goal: Build the starter from your fork, then have your agent redeploy it with a project-scoped, expiring token while you approve each step.

You need Your fork of computesphere-samples/learn with the module 2 fix on main, csph set up for the learn project (lesson 5.1.1), and your agent.

Haven't connected GitHub to ComputeSphere?

Follow lesson 5.3.1 and give the ComputeSphere app access to only your fork of learn. If you did module 6, also set the ADMIN_KEY secret after step 2 (lesson 4.6.1).

  1. Create the service from your fork

    In learn, choose New service, then Web Service. Name it vibe-starter, choose Git repository, then Private (Connections), your connection, your fork and main.

    You should seeThe Runtime step of the new service form.

  2. Set the runtime build and deploy

    Choose Node.js, version 20. Build command cd labs/vibe-starter && npm ci, Start command cd labs/vibe-starter && npm start. Under Networking, set the port to 3000. Choose Deploy.

    You should seeIn the Builds tab: Queued, Building, Deploying, then Running.

  3. Turn on the health check

    In Settings, under Health check, choose Add health check: Endpoint path /healthz, Port 3000, Initial delay 5, Check interval 10. Choose Save, then Later: your agent redeploys in step 6.

    You should seeThe Health check card shows Path /healthz and Port 3000.

  4. Create a project token

    Settings, User tokens, New token. Name agent_deploy, Project access for learn, expiration 7 days, Create token. Keep the window open for the next step.

    You should seeA token starting csph_, shown once.

  5. Give it to the agent's terminal, not its chat

    In the terminal you'll start your agent from:

    read -rs COMPUTESPHERE_API_TOKEN && export COMPUTESPHERE_API_TOKEN
    

    Paste the token, press Enter, then start your agent from this terminal (lesson 4.8.1 has Windows).

    You should seeNothing printed.

  6. Ask, read, approve

    Send your agent:

    Using csph, redeploy the vibe-starter service in my learn project.
    Show me each command that changes anything and wait for my OK.
    Then check its status until it's Running, and report its URL.
    

    Check the command and deployment ID before approving.

    Check yourself

    While it rolls out: if the token leaked right now, what could it reach?

    You should seeThe agent shows a csph deployments redeploy command, waits, and after your OK reports Running.

  7. Check it yourself

    curl https://<your-vibe-starter-url>/healthz
    

    You should seeYour URL answers with status ok, in JSON.

Check your work

  • If this doesn't pass

    Follow lesson 5.3.1 and grant the app access to your fork of learn.

  • If this doesn't pass

    Build Failed: open it in the Builds tab (lesson 5.3.3); a typo in the cd path is the usual cause. Built but Failed: check the start command, then csph logs vibe-starter. Still listening on 127.0.0.1? Merge the module 2 fix and start Build & deploy again.

  • If this doesn't pass

    Endpoint path must be /healthz and Port 3000, the port the app listens on.

  • If this doesn't pass

    Your own sign-in doesn't count. Check COMPUTESPHERE_API_TOKEN is set in the agent's terminal, then ask the agent to redeploy again.

When you're done

Revoke agent_deploy in Settings, User tokens, unless you're going straight on to module 9, which uses it again. Stop vibe-starter when you no longer need it; it runs on a Flex spherelet.