Set up Shardflux with your coding agent
Ask Claude Code, Codex or Cursor to install Shardflux. It asks one question, then sets up your product or your own cloud coding agents.
Ask your coding agent to install Shardflux. This page is the order it follows. Agents: work through it top to bottom, and ask your user wherever it says Ask.
npm i -g shardfluxThe CLI needs Node.js 24 or later. Every command takes --json, reads secrets only from standard input and has
documented exit codes.
First, one question
Ask: Is Shardflux for a SaaS platform, or for your personal setup?
| Answer | What it means | What gets set up |
|---|---|---|
| SaaS platform | Your product runs VMs for its own customers through the API, SDK or MCP | An account, an API key for your product, the integration, and templates for your customers' workspaces |
| Personal setup | Your own cloud coding agents: each Claude or Codex conversation gets its own VM | Your account, Claude and Codex, your machine, your project, then shard ./ |
Sign in
Both answers start here.
Ask: Do you agree to the Terms of Service and the Privacy Policy? Continue once your user does.
shard signup --accept-terms --jsonWith the Codex CLI signed in with ChatGPT on this computer, signup signs up (or signs in) with that login, no
browser, then saves an organization, a project and an API key. A new account starts with 60 days of Pro.
Without a Codex login, or for an account your user already has, sign in in the browser:
shard auth login --browser --no-open --json
shard setup --jsonThe first line it prints is {"event":"open",...} with the link and the code: give both to your user. It ends with
{"event":"signed_in",...} once they approve, within 10 minutes; run it in the background if your tool stops
commands sooner. shard setup then saves the organization, project and API key, and is safe to run again.
SaaS platform
Your product calls Shardflux with a project API key. Claude and Codex sign-ins, the menu bar and the machine are for personal cloud coding agents, so skip them.
eval "$(shard env)"exportsSHARDFLUX_API_KEYfor the SDKs and the MCP server. Put the key in your product's server-side secrets.- Integrate with the TypeScript SDK (
npm install @shardflux/sdk), the Python SDK (pip install shardflux), the HTTP API or the MCP server. The quickstart runs a complete example. - Give your customers' workspaces what they need from the first second:
build a template with
shard templates build template.yaml. - Choose a plan when you need more:
shard billing upgrade <plan> --jsonprints the Stripe Checkout URL for your user.
Personal setup
Each Claude or Codex conversation gets its own VM, started from your machine (tools, logins, dotfiles and agent config) and the project's template (dependencies, services and secrets).
1. Connect Claude and Codex
Ask: Which do you use: Claude, Codex or both?
-
Claude uses one cloud sign-in for your account. Your user runs this in their own terminal, once: it shows a claude.ai link and asks for the code.
shard agents credentials login claude -
Codex uses this computer's Codex login:
codex login(with ChatGPT), once.
Then check both live and finish the Codex connection:
shard setup --inspect --connect --json --apps claude,codexEach connection reports verified, or the action that completes it. Pass only the apps your user picked.
2. Build the machine
Ask: What should every cloud agent start with?
- Languages and runtimes, such as Node.js 24, Python with uv, Go or Rust
- CLIs and tools, such as gh, the AWS CLI, Terraform or ripgrep
- Dotfiles and shell:
.gitconfigwith their name and email, shell config and aliases - Secrets and credentials that tools read from files, such as
~/.npmrcorghauth - Editor and agent config:
CLAUDE.mdandAGENTS.md, Claude and Codex settings, skills and MCP servers
Write the answers as one brief. Your user runs shard machine in their own terminal and pastes the brief to the
machine agent, which installs and configures everything in the machine VM. Then save it:
shard machine save --wait --jsonThe first open copies this computer's Claude and Codex settings into the machine. Every new conversation starts from the saved version; Machine and template covers changes and rollback.
3. Set up the project
Ask: Which project, which secrets does it need, and what does a good first run look like (the tests, a dev server)?
Import the project's secrets from your user's vault, then start a conversation in the project folder:
shard secrets import --from 1password 'op://Private/GitHub/token' --as GITHUB_TOKEN
shard ./ --json --prompt "Set up this project and run its tests"
shard conversations wait <conversation-id> --timeout 90
shard template --jsonshard ./ --json starts the conversation in its own VM and prints it (conversation.id); use shard ./ codex --json ... for Codex. Setup installs the dependencies, runs the build and tests and saves the project template
in the background. conversations wait returns the agent's result or question; run it again while it says
Still working. shard template shows the saved version. Tell setup what to skip or how to run a step in
.shardflux/setup.yaml.
4. Hand over
Your user runs this in their own terminal, from the project folder:
shard ./It opens Claude Code in a new conversation VM (shard ./ codex for Codex). Claude conversations continue on
claude.ai and in the Claude app; Codex threads continue in the Codex app, on the web and on the phone. T3 Code,
Claude Desktop and the Codex app work too: see Cloud conversations.
What your user does
Answer the question, agree to the terms, approve the browser sign-in, sign in to Claude in their terminal and run
codex login, describe their machine and project, and pay in Stripe Checkout when they choose a plan. The agent
does the rest.