# spin code

**Spinbox is experimental: APIs change and data may be lost.** What is built and what proves it is on [Status](https://spin-stack.github.io/website/reference/status.md); what Spinbox does not do is on [Limitations](https://spin-stack.github.io/website/overview/limitations.md).

> spin code: Open a workspace in VS Code.

<!-- Generated by tools/refgen from spin:cmd/cli. Edit the source, not this file. -->

```
Open a workspace in VS Code over Remote-SSH, at path (default /root).

The workspace is reached as the host spin.<workspace> (see 'spin ssh-config', which this
runs). Before VS Code connects, the workspace is asked whether it has the server for your
VS Code. When it has not, it is given it while it runs - published first if this installation
has not got that version, which takes minutes once and is said as it goes. Where that cannot
be done, VS Code downloads its own server into the workspace (about 220 MB), which this says.

Needs VS Code's 'code' command and the Remote-SSH extension.

Examples:
  spin code my-workspace
  spin code my-workspace /srv/app --start

Usage:
  spin code <workspace> [path] [flags]

Flags:
      --editor string      The VS Code command (default "code")
  -h, --help               help for code
  -i, --identity string    Identity file (private key); default: the first of ~/.ssh/id_ed25519, id_rsa, id_ecdsa
      --start              Start the workspace first if it is stopped
      --timeout duration   How long to wait for the workspace to be running; by default, until the control plane gives up on it

Global Flags:
      --config string    config file (default is $HOME/.spin/config.yaml)
  -o, --output string    text for a person, or json: one document of what the API answered, and no prose (default "text")
      --profile string   named profile to use; SPIN_PROFILE names it when this flag does not (default "default")
```
