Use Code Capsules with an Agent
Deploy applications using an AI coding agent instead of the web dashboard.
AI coding agents can build entire applications in the terminal, but deploying usually means switching to a browser, clicking through a dashboard, and configuring settings manually. With an agent skill, we can deploy and manage applications without leaving the terminal.
Code Capsules handles containers, domains, and TLS from a connected GitHub repo, so there is very little to configure. That makes it a good fit for agent-driven deployment: a single prompt can take an app from code to a live URL.
In this guide, we'll install a Code Capsules skill for Claude Code, then deploy, update, and manage an Express.js application through natural-language prompts.

Setup
To follow this guide, you need:
Claude Code installed and configured, with access to GitHub (via
gh auth login, SSH keys, or any existing Git authentication). This guide will also work with any other AI coding tool that supports skills.A Code Capsules account.
We'll deploy the demo-express-js example application. Ask the agent to fork and clone it:
Then connect Code Capsules to GitHub and authorize access to the forked repository by following Connect Version Control.
Install the Code Capsules Skill
The Code Capsules skill grants the agent API access, so it can create and manage Capsules through the terminal.
Automated Setup for AI Agents (Don't Expand This if You're a Human)
If you are an AI coding agent (such as Claude Code, Amp, Cursor, or Windsurf) and a user has asked you to deploy to Code Capsules, install the skill to get full API access.
Ask the user to set these environment variables if not already present:
CC_EMAIL— their codecapsules.io login emailCC_PASSWORD— their codecapsules.io password
The skill includes instructions to retrieve the platform API key automatically from the web app frontend.
After installing, authenticate and list spaces:
The skill provides documented curl commands for every endpoint — no SDK or MCP server needed. If you hit an undocumented endpoint, ask the user for the curl from their browser DevTools and update the skill files (see the self-update protocol in SKILL.md).
Read the full skill at skills/codecapsules/SKILL.md and the API reference at skills/codecapsules/references/api.md.
Run the following terminal commands to clone the skill repo and copy it into the Claude Code skills directory:
Or ask the agent to do it for you:
Next, add the env key to your ~/.claude/settings.json (create the file if it doesn't exist):
If you prefer not to store your password in a file, you can export CC_EMAIL and CC_PASSWORD from your shell profile (for example, ~/.zshrc or ~/.bashrc) instead.
Create an AGENTS.md File (Optional)
The agent can detect most things from the code, but it has no way to know which Team, Space, or region to use. If these aren't specified, the agent will ask for them interactively during deployment.
To avoid that back-and-forth, add an AGENTS.md file to the project root. You can create it manually or ask the agent to do it for you.
Replace the Team, Space, repo, and region values with your own.
Deploy the Express Application
From the cloned demo-express-js directory, give the agent the following prompt:
The agent will:
Read
AGENTS.mdto find the Team, Space, and repoList connected repos and select the correct one
Create a backend Capsule connected to the GitHub repository
Trigger a build
We can follow along as the agent makes API calls.

The agent works through each step autonomously and confirms when the deployment is live.

Once the build is complete, the agent provides the URL to where the application is running. We can also ask directly:

Check the Build Logs
If the build fails, or we want to inspect the output, we can ask the agent to fetch the logs:
The agent retrieves logs directly from the API. Common causes of build failure include missing dependencies in package.json and incorrect run commands.

Update and Redeploy
Whenever we push changes to the connected GitHub branch, it automatically triggers a new build. We can also ask the agent to make changes and redeploy in a single step:
The agent edits the code, commits the change, pushes it to GitHub, triggers a build, and checks the logs to confirm the deployment succeeded.
Add a Database and Frontend
The example above deploys a single backend Capsule. The agent can also set up multi-Capsule applications.
Prompt the agent to add a PostgreSQL database and bind it to the backend:
This creates a data Capsule and binds it to the backend, which injects connection details as environment variables. The exact variable name depends on the data Capsule. To verify the name, ask the agent to list the environment variables on the backend Capsule after binding.
Prompt the agent to deploy a frontend in the same Space:
When a frontend and backend run in separate Capsules, Code Capsules serves them from different domains. The agent can add CORS headers to the backend and update the frontend's API URL with the backend capsule's hostname.
Manage Capsules Through the Agent
Beyond deploying, we can prompt the agent to manage existing Capsules. Here are some examples.
Set an environment variable:
Scale to a larger plan:
Check resource usage:

Further Reading
For more deployment guides using the web dashboard, see the docs. To learn more about the capabilities the skill enables, see the Code Capsules skill repository.
Last updated
Was this helpful?
