Skip to main content
Documentation

Installation

Set up your environment, create an account, and log in to the CLI.

On this page

One-line staging agent instruction: Complete your human's request from a persistent container by following the staging app-building quickstart; use the agent account HTTP API for a language-agnostic client. Production signup is not enabled.

You don't install DeepSpace globally. The CLI ships inside the deepspace package, which is added to every new app by the scaffolder. The only thing you need on your machine ahead of time is Node.js.

Prerequisites#

  • A supported Node.js line: 22.15+, 24, or 26. The exact engines range is >=22.15.0 <23 || >=24 <25 || >=26 <27 - the odd-numbered lines (23, 25) are excluded. Verify with node --version. If you need to switch versions, use nvm or download an installer from nodejs.org.
  • npm, pnpm, or yarn. Examples in these docs use npm; substitute your favorite if you prefer.
  • A GitHub or Google account. Used for signing in to the CLI and your deployed apps. There's no separate DeepSpace account.

You do not need a Cloudflare account. DeepSpace deploys to a shared Workers for Platforms namespace operated by the platform. If you want a custom domain, you'll buy it through the CLI (Cloudflare Registrar or Porkbun under the hood) - no DNS setup on your side.

Create a new app#

npm create deepspace@latest my-app
cd my-app
bash

This:

  1. Downloads the latest create-deepspace package on demand (no global install).
  2. Scaffolds a Vite + React app with the worker and Durable Objects pre-wired.
  3. Installs deepspace and the starter's dependencies.
  4. Initializes a git repository.

The scaffold takes about 30 seconds. You'll have a working app at the end, but npx deepspace dev start won't start until you've logged in.

The scaffolder does not register the app or make a commit. wrangler.toml keeps the __APP_ID__ placeholder until the app's first use registers it - see which account the app registers under.

Which account the app registers under#

Apps register on first use. The first command that uses the app - app init, dev start, test run, deploy, or a secrets write such as secrets set or secrets upload - registers it under whatever login the shell holds at that moment, on the plane DEEPSPACE_ENV selects (production when it is unset). Nothing asks which account to use, so check it before that first command:

npx deepspace auth whoami
bash

If it shows the wrong account, run npx deepspace auth login as the intended owner first. The command that registers the app prints the id, the plane, and the account's email:

Registered app_01J… on production to you@example.com — apps register on first use.

app init and deploy also make the repository's initial commit when it has none. Register before you commit anything yourself: once the __APP_ID__ placeholder is in a commit, first use stops registering on its own (in a shared repo, every clone would otherwise mint its own app), and you register with npx deepspace app init instead. Commit wrangler.toml after it gets its id - the id is the app's identity.

Scaffold options#

# Interactive prompt-driven mode
npm create deepspace@latest -- --interactive

# Scaffold into the current directory (must be near-empty)
mkdir my-app && cd my-app
npm create deepspace@latest .

# Print help
npm create deepspace@latest -- --help
bash

--no-register is still accepted so older scripts keep working, but it does nothing: scaffolds never register.

The scaffolder is non-interactive by default (--interactive opts in), so there is no --yes flag - passing one is refused with an explanation rather than treated as unknown.

"Near-empty" means the target directory contains only boilerplate (.git, .gitignore, LICENSE, any *.md, etc.). Anything else triggers a guardrail to prevent overwriting an existing project.

Log in to the CLI#

Every CLI command that talks to the platform - dev start, deploy, integrations invoke, test accounts, and the rest - requires a session. Plan to log in once before your first npx deepspace dev start.

npx deepspace auth login
bash

This opens your default browser to sign in with GitHub or Google and waits for up to 10 minutes. DeepSpace accounts are OAuth-only - you never set a password, and your first sign-in creates the account. After you authorize, the CLI writes two files into ~/.deepspace/:

  • ~/.deepspace/session - the long-lived refresh token used to mint new JWTs.
  • ~/.deepspace/token - the current short-lived JWT, refreshed automatically by other commands.

The same session covers every DeepSpace app on the machine - you don't log in per project. It also covers coding agents you run here: they read the same file and act as you. To do that from a container or CI, see agents and CI.

Check your login state:

npx deepspace auth whoami
npx deepspace auth whoami --json   # machine-readable
bash

whoami refreshes the short-lived JWT on demand, so an expired token is handled silently. If ~/.deepspace/session is missing, it prints "Not logged in." and exits 1. If the session can no longer be refreshed, it prints "Session expired." and exits 1. In either case, re-run npx deepspace auth login.

Manage your account, deployed apps, billing, and earnings at dashboard.deep.space. The CLI and the dashboard share one session - signing in once covers both.

Update the SDK#

DeepSpace ships frequently. To pull in the latest SDK and CLI, run:

npm install deepspace@latest
bash

The CLI and the SDK are the same package - bumping the version updates both.

Verify your setup#

You're ready to build when all of these succeed:

node --version             # v22.15+, v24.x, or v26.x
npm create deepspace@latest -- --help
npx deepspace --version
npx deepspace auth whoami       # prints your account, after `auth login`
bash

Next steps#