Prerequisites
- Ona CLI installed
- Authenticated via
ona 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:--inactivity-timeout to set a custom auto-stop timeout. See auto-stop timeout for details and examples.
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
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: