Prerequisites
- Ona CLI installed
- Authenticated via
gitpod login - At least one runner available in your organization
Discover projects
List projects to find one to create an environment from:-o json for machine-readable output:
Discover environment classes
Environment classes define the compute resources (CPU, memory) for your environment. List available classes:Create an environment
From a project
The simplest way. The project already has a repository URL, environment class, and configuration:From a context URL
Create directly from a repository URL. Requires an environment class:Non-blocking creation
Use--dont-wait to return the environment ID immediately without waiting for it to start:
List environments
Run commands
Execute commands inside a running environment usingexec:
Examples
Exit codes
The CLI exits with the same exit code as the remote command. A non-zero exit code means the command failed.Flags
| Flag | Default | Description |
|---|---|---|
--timeout | 120 | Command timeout in seconds |
--working-dir | workspace folder | Working directory inside the environment |
-o json | table | Output format (json, yaml, table) |
SSH access
For interactive sessions or when you need a persistent shell:Clean up
Stop an environment to preserve its state:Full workflow example
End-to-end script that creates an environment, runs a command, and cleans up:JSON workflow for agents
Agents that parse structured output can use-o json throughout: