Browse the docs

Connect your repository

In 10 minutes, your repository is linked to a Putnami Cloud workspace, and the putnami CLI can reach it. Hosting and the factory both start here.

What happens in the cloud

  1. putnami cloud login signs you in. Your first sign-in creates your account and a personal organization where you are admin.
  2. putnami cloud setup creates a workspace for your repository: its slug, its repository and its place on the platform. It creates no cloud resource yet: those come with your first deploy.
  3. Setup writes the link to that workspace in putnami.workspace.json. You commit it, so everyone who clones the repository works against the same workspace.
  4. putnami cloud source connect connects the GitHub repository to the workspace, so the platform can read it at an exact commit.

Your workspace in the cloud explains what a workspace holds.

Before you start

  • The putnami CLI and a workspace that builds with putnami build. Without them, start with Getting started.
  • A browser, to approve the sign-in.

1. Install the cloud extension

putnami deps add @putnami/cloud

This records @putnami/cloud in your workspace and installs it. The CLI now has the putnami cloud commands. Check it:

putnami cloud

You see the list of cloud commands.

2. Sign in

putnami cloud login

The CLI opens a URL in your browser and shows a code. Approve the code in the browser. You never paste a secret into the terminal. On a machine without a browser, add --no-open and open the printed URL elsewhere.

3. Create the workspace

Choose a name and a slug: a short name of 12 characters at most, such as acme. The slug names your services and event topics, and it never changes.

putnami cloud setup --workspace-name "Acme" --slug acme

To link a workspace that already exists, pass its id instead:

putnami cloud setup --workspace <workspace-id>

Commit the change to putnami.workspace.json and .putnami/cache.json. Setup also turns on the remote build cache; --no-cache skips it.

4. Connect GitHub

putnami cloud source connect --repo <owner>/<repo>

The CLI opens GitHub in your browser. Authorize Putnami, then install the Putnami GitHub App on the repository. The factory reads your pull requests and issues through the App, and the platform reads your environment definitions through it.

What you see

putnami cloud whoami
putnami cloud source status

whoami shows two checks and the time left on your session:

  • session: signed in as you@example.com.
  • workspace: linked to workspace Acme (<workspace-id>).

source status shows the connected repository, its GitHub App installation, and whether the App has every permission it needs.

When it fails

You see Cause Fix
putnami cloud is an unknown command the extension is not installed putnami deps install
whoami: not signed in you are not signed in, or the session expired putnami cloud login
whoami: this repository is not linked to a workspace setup did not run in this repository putnami cloud setup
setup refuses the slug the slug is taken, too long, or a reserved name choose another slug; see the slug rules
source status: no GitHub repository connected step 4 did not complete putnami cloud source connect --repo <owner>/<repo>
source status: permission update(s) required the App asks for a permission you did not accept yet accept the App's new permissions on GitHub
source status: GitHub App uninstalled someone removed the App from the repository putnami cloud source connect --replace

Next