Skip to main content
ZeroTwo
Language
Login

How do I run Code in the cloud with ZeroTwo?

Cloud Code runs a task in a cloud machine with your repositories cloned. Create and publish an environment, then start a task from the web or desktop app.

Updated: 18 hours ago

Cloud Code runs each task in a cloud machine that has your repositories cloned, so the work runs there instead of on your computer. On the web, Code always runs in the cloud, and a new task starts from a cloud environment: a saved setup of repositories, install steps, variables, secrets and internet rules. In the desktop app you choose Cloud instead of a local folder or worktree, and a Cloud task can start from an environment or from a project alone.

Before you start

Create an environment

  1. Choose the Code tab. Above the message box, the environment chooser reads Choose environment. In the desktop app it appears once you choose Cloud in the environment menu. Select it and choose Create environment. You can also open Settings > Code Cloud and select Create environment.
  2. In the Create a cloud environment box, select the repositories ZeroTwo should set up. Use the search box or filter by owner. If one is missing, select Configure access at the bottom of the box. If GitHub is not connected, the box asks you to Connect GitHub first.
  3. Select Get started, which is available once you have selected a repository. ZeroTwo opens a chat named "Set up" followed by the environment's name. It inspects the repositories, runs the install and startup commands in a cloud machine, tests that they work and saves what it learned as a draft.
  4. Review the draft. Above the message box in the setup chat, select Edit environment to open the Environment tab beside the chat, where you can edit each part. Then publish. The pill at the right of that bar reads Publish, and in the Environment tab the button reads Publish, Republish, or Save & publish when you have unsaved edits. Publishing waits until ZeroTwo finishes its turn. Once the environment is published, the pill reads Environment published · Start a task and starts a new Code task in it.

Only a published environment can start tasks. Each environment shows a status: Unpublished, Published, or Unpublished changes when the draft differs from what is published. Use Save draft to keep edits without publishing them.

What an environment holds

  • Repositories. The ones you selected.
  • Setup. An Install script, a shell script that installs dependencies and prepares the project, and a Start skill, instructions ZeroTwo reads when a task starts about how to run, test and check the project.
  • Internet access. A switch labeled "Allow ZeroTwo to access the internet". When it is on, Allow domains chooses Package managers (the default), Custom domains only or All (unrestricted), and Additional allowed domains adds more, except with All (unrestricted). Domain rules apply to HTTP and HTTPS traffic. ZeroTwo can suggest domains while it sets the environment up, but you decide: you Accept or Dismiss the suggestion and ZeroTwo cannot widen the access itself.
  • Environment variables and Secrets. Secrets are added to the environment's shells as environment variables, and ZeroTwo never shows their values. An environment can hold up to 100 variables and 50 secrets.
  • Access. Who can use is Only me. Environments are private to you.

To keep your own values out of an environment, save them under Settings > Code Cloud > Personal vault, which holds your own environment variables and network secrets for cloud environments in this workspace. Each entry's Applies to setting is all environments or one environment, and saved secret values stay hidden.

The cloud machine does not hold a GitHub credential. ZeroTwo clones your repositories with your GitHub connection, so a task cannot push to or fetch other private GitHub repositories unless you declare a secret, such as a token, for that purpose.

Start a task in the cloud

  1. In the Code tab, open Choose environment and select a published environment. On the web there is no repository picker, because the environment supplies the repositories. In the desktop app, choose Cloud in the environment menu first. The menu also offers Local and New local worktree.
  2. Write the task and send it.

On the web, if you send a new Code task before choosing an environment, ZeroTwo opens the environment chooser and keeps your draft. In the desktop app, a Cloud task can also start from a project alone, without an environment. You can also start from Settings > Code Cloud: select the ... menu on a published environment and choose Start a task. In a Code chat in the desktop app, the /cloud command, described as "Run this chat in the cloud", sets the environment to Cloud, the same as choosing Cloud in the environment menu.

Edit or delete an environment

Settings > Code Cloud lists your environments with the repositories each one uses. Select a row to edit it, or use its ... menu to Edit, Continue setup for one you have not finished, or Delete environment. Deleting one means tasks that use it no longer start in it.

Need more help? Search with the help chat, email us or ask in the ZeroTwo community on Discord.

Help chat

Signed in to ZeroTwo? Open Help, then Support, in the app to send us a message.

Related articles

Was this article helpful?

Log in to message us in the app.

Log in

ZeroTwo help chat

Get help from ZeroTwo

This chat only searches the articles here. It isn’t a person or an AI, and sends nothing. To reach ZeroTwo, email reed@zerotwo.ai or join the ZeroTwo Discord.