Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
C

cli

> 开发工具
Open source

A CLI to create remote development environments in your cloud provider account in seconds

630 stars0 likes2 views
WebsiteGitHub

About

A CLI to create remote development environments in your cloud provider account in seconds

Recode

Remote development environments defined as code. Running in your cloud provider account. Currently available on Amazon Web Services and Visual Studio Code.

... you can think of it as a desktop version of Gitpod / Coder / GitHub Codespaces less polished and with less features but 100% free, 100% open-source and 100% community-driven

bash
recode aws start recode-sh/workspace --instance-type t2.medium

https://user-images.githubusercontent.com/1233275/172346442-d6fef09c-2ef0-4633-8d72-e20bef8fc1a9.mp4

... see the recode-sh/workspace repository for an example of development environment configuration

Table of contents

  • Requirements
  • Installation
  • Usage
    • Login
    • Start
    • Stop
    • Remove
    • Uninstall
  • Development environments configuration
    • Tip: the --rebuild flag
    • Tip: Docker & Docker compose
    • User configuration
    • Project configuration
      • What if I don't have an user configuration?
    • Recode configuration
      • Base image (recode-sh/base-dev-env)
      • Visual Studio Code extensions
      • Multiple repositories
      • Build arguments (RECODE_INSTANCE_OS and RECODE_INSTANCE_ARCH)
      • Hooks
  • Frequently asked questions
    • How does it compare with GitPod / Coder / Codespaces / X?
    • How does it compare with Vagrant / VSCode remote SSH / Container extensions?
    • Why using Docker as a VM and not something like NixOS, for example?
    • Given that my dev env will run in a container does it mean that it will be limited?
  • The future
  • License

Requirements

The Recode binary has been tested on Linux and Mac. Support for Windows is theoretical (testers needed ).

Before using Recode, the following dependencies need to be installed:

  • Visual Studio Code (currently the sole editor supported).

  • OpenSSH Client (used to access your development environments).

Installation

The easiest way to install Recode is by running the following command in your terminal:

bash
curl -sf https://raw.githubusercontent.com/recode-sh/cli/main/install.sh | sh -s -- -b /usr/local/bin latest

This command could be run as-is or by changing:

  • The installation directory by replacing /usr/local/bin with your preferred path.

  • The version installed by replacing latest with a specific version.

Once done, you could confirm that Recode is installed by running the recode command:

bash
recode --help

Usage

…

Login

bash
recode login

To begin, you need to run the login command to connect your GitHub account.

Recode requires the following permissions:

  • "Public SSH keys" and "Repositories" to let you access your repositories from your development environments.

  • "GPG Keys" and "Personal user data" to configure Git and sign your commits (verified badge).

All your data (including the OAuth access token) are only stored locally in ~/.config/recode/recode.yml (or in XDG_CONFIG_HOME if set).

The source code that implements the GitHub OAuth flow is located in the recode-sh/api repository.

Start

bash
recode  start 

The start command creates and starts a development environment for a specific GitHub repository.

If a development environment is stopped, it will only be started. If a development environment is already started, only your code editor will be opened.

An --instance-type flag could be passed to specify the instance type that will power your development environment. (See the corresponding cloud provider repository for default / valid values).

Examples

bash
recode aws start recode-sh/workspace
bash
recode aws start recode-sh/workspace --instance-type t2.medium

Stop

bash
recode  stop 

The stop command stops a started development environment.

Stopping means that the underlying instance will be stopped but your data will be conserved. You may want to use this command to save costs when the development environment is not used.

Example

bash
recode aws stop recode-sh/workspace

Remove

bash
recode  remove 

The remove command removes an existing development environment.

Removing means that the underlying instance and all your data will be permanently removed.

Example

bash
recode aws remove recode-sh/workspace

Uninstall

bash
recode  uninstall

The uninstall command removes all the infrastructure components used by Recode from your cloud provider account. (See the corresponding cloud provider repository for details).

Before running this command, all development environments need to be removed.

Example

bash
recode aws uninstall

Development environments configuration

If you think about all the projects you've worked on, you may notice that you've:

  • a set of configuration / tools used for all your projects (eg: a preferred timezone / locale, a specific shell...);

  • a set of configuration / tools specific for each project (eg: docker compose, go >= 1.18 or node.js >= 14).

This is what Recode has tried to mimic with user and project configuration.

Tip: the --rebuild flag

bash
recode aws start recode-sh/workspace --rebuild

If you update the configuration of an existing development environment, you could use the --rebuild flag of the start command to rebuild it without having to delete it first.

Tip: Docker & Docker compose

Docker and Docker compose are already preinstalled in all development environments so you don't have to install them.

User configuration

User configuration corresponds to the set of configuration / tools used for all your projects. To create an user configuration, all you need to do is to:

  1. Create a repository named .recode in your personal GitHub account.

  2. Add a file named dev_env.Dockerfile in it.

The file dev_env.Dockerfile is a regular Dockerfile except that:

  • it must derive from recode-sh/base-dev-env (more below);

  • the user configuration needs to be applied to the user recode.

Otherwise, you are free to do what you want with this file and this repository. You could see an example with dotfiles in recode-sh/.recode and use it as a GitHub repository template:

…

Project configuration

Project configuration corresponds to the set of configuration / tools specific for each project. As you may have guessed, to create a project configuration, all you need to do is to:

  1. Create a directory named .recode in your project's repository.

  2. Add a file named dev_env.Dockerfile in it.

The file dev_env.Dockerfile is a regular Dockerfile except that:

  • it must derive from user_dev_env (your user configuration);

  • the user configuration needs to be applied to the user recode.

Otherwise, you are free to do what you want with this file and this directory. You could see an example in recode-sh/workspace:

…

What if I don't have an user configuration?

If you don't have an user configuration, the recode-sh/.recode repository will be used as a default one.

That's why you will have zsh configured as default shell in your project.

Recode configuration

As you may have noticed from previous sections, some commands in the dev_env.Dockerfile files (like the LABEL ones) are specific to Recode. This section will try to explain them.

Base image (recode-sh/base-dev-env)

As you may have understood, all the development environments derive directly or indirectly from recode-sh/base-dev-env. You could see the source of this Docker image in the recode-sh/base-dev-env repository:

…

As you can see, nothing fancy here.

Recode is built on ubuntu with docker and docker compose pre-installed. An user recode is created and configured to be used as the default user. Root privileges are managed via sudo.

Your repositories will be cloned in /home/recode/workspace. A default timezone and locale are set.

(To learn more, see the recode-sh/base-dev-env repository).

Visual Studio Code extensions

In order to require Visual Studio Code extensions to be installed in your development environment, you need to add a LABEL named sh.recode.vscode.extensions in your user's or project's dev_env.Dockerfile.

(As you may have guessed, if this label is added to your user configuration, all your projects will have the listed extensions installed).

An extension is identified using its publisher name and extension identifier (publisher.extension). You can see the name on the extension's detail page.

Example
dockerfile
LABEL sh.recode.vscode.extensions="golang.go, zxh404.vscode-proto3, ms-azuretools.vscode-docker"

Multiple repositories

If you want to use multiple repositories in your development environment, you need to add a LABEL named sh.recode.repositories in your project's dev_env.Dockerfile.

In this case, we recommend you to create an empty repository that will only contain the .recode directory (as an example, see the recode-sh/workspace repository).

(As you may have guessed, if this label is added to your user configuration it will be ignored).

Repositories may be set as relative to the current one (eg: cli) or fully qualified (eg: recode-sh/cli).

Example
dockerfile
LABEL sh.recode.repositories="cli, agent, recode, aws-cloud-provider, base-dev-env, api, .recode, workspace"

Build arguments (RECODE_INSTANCE_OS and RECODE_INSTANCE_ARCH)

Given the nature of this project, you need to take into account the fact that the characteristics of the instance used to run your development environment may vary depending on the one chosen by the final user.

As an example, an user may want to use an AWS graviton powered instance to run your project and, as a result, your project's dev_env.Dockerfile must be ready to be built for ARM.

To ease this process, Recode will pass to your dev_env.Dockerfile files two build arguments RECODE_INSTANCE_OS and RECODE_INSTANCE_ARCH that will contain both the current operating system (linux) and architecture (eg: amd64) respectively.

Example
dockerfile
# Reserved args (RECODE_*). Provided by Recode.

# eg: linux
ARG RECODE_INSTANCE_OS

# eg: amd64 or arm64
ARG RECODE_INSTANCE_ARCH

Hooks

Hooks are shell scripts that will be run during the lifetime of your development environment. To be able to add a hook in a project, all you have to do is to add a directory named hooks in your .recode directory.

First Hook

Before adding your first h

Issues· 0 open

View all issuesOpen on GitHub

No open issues yet, or sync has not completed.

> Tags

Goawscligolangrecode

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 17, 2026
Category开发工具
PricingOpen source

> Related tools

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具