Installation
Getting started with the Gitpod CLI is straightforward. You have two options:Option 1: Quick Install (UNIX Systems - macOS, Linux)
This one-line installation method works for macOS and Linux systems:Option 2: Direct Download
Choose the appropriate version for your system: After downloading, you’ll need to:-
Make the binary executable:
Move it to your PATH:
Note for macOS users: When first running a downloaded binary, you may see
a security warning.
Verifying Download Integrity
For security, verify the integrity of your downloaded CLI binary using SHA256 checksums from our release manifest:Verification Steps
-
Get the expected checksum for your platform:
-
Calculate your file’s checksum:
- Compare the checksums - they must match exactly.
Security Warning: If the checksums don’t match, do not use the binary and re-download from the official source.
Without jq
If you don’t havejq
installed, view the full manifest and manually find your platform’s digest:
Getting started with Gitpod CLI
Authentication
The Gitpod CLI supports multiple authentication methods:Automated Authentication (in Ona Environments)
When using the CLI in an Ona environment, it automatically authenticates using the environment’s token. Check your authentication status:PRINCIPAL_ENVIRONMENT
: Limited access to current environment only- Your username: Full access to all features and environments
Browser-based Authentication
- Open your default browser for authentication
- Create a new context for your session
- Store your credentials securely
Personal Access Token Authentication
For headless environments or automation scenarios, you can authenticate using a Personal Access Token:Environment Variables
Set theGITPOD_TOKEN
environment variable before logging in:
CLI in Ona Environments
Pre-installed CLI
Every Ona environment comes with the Gitpod CLI pre-installed asgitpod
. The CLI is automatically authenticated with limited access to the current environment’s context, allowing you to:
- Stop the current environment (
gitpod environment stop
) - View environment logs (
gitpod environment logs
) - Rebuild the development container (
gitpod devcontainer rebuild
)
Upgrading Environment Access
To access additional features like managing other environments or organization resources, you’ll need to create a new, fully authenticated context:-
From within your environment, run:
-
After authentication, the new context will automatically activate, giving you access to:
- All environment management commands
- Organization settings
- Project management
- Automation controls
- Secret management
Access Levels and Authentication Scope
Depending on how you’re logged in, you may have different access levels. You can always change your authentication method or scope using thegitpod login
command.
Default Environment Access (Pre-authenticated)
- View current environment status
- Basic environment operations
- Local development container management
- Port forwarding
Full Authentication Access (After Login)
- Create and manage all environments
- Organization management
- Project creation and configuration
- Secret management
- Automation control
- Runner management
- Cross-environment operations
Basic Commands
Here are some essential commands to get you started:Machine-readable Output
For scripting and automation, you can get machine-readable output in JSON or YAML format:Core Features
Environment Management
Creating Environments
Working with Running Environments
Automation Management
The CLI provides comprehensive automation management capabilities:Advanced Features
SSH Configuration
Set up native SSH access to your environments:File Transfer with SCP
To transfer files to and from your environments using SCP, you must use the-O
flag to ensure compatibility:
Important: The
-O
flag is required when using SCP with Gitpod environments. Without this flag, file transfers may fail or behave unexpectedly.Project Management
Port Management
Context Management
Global Configuration
The CLI configuration file is located at~/.gitpod/configuration.yaml
. You can modify settings using:
Best Practices
-
Context Management
- Use separate contexts for different projects or organizations
- Name contexts meaningfully for easy identification
-
Environment Lifecycle
- Stop unused environments to conserve resources
- Use
--dont-wait
flags for batch operations - Set appropriate timeouts for long-running operations
-
Automation
- Initialize automation files in your project root
- Use descriptive task names
- Monitor task logs for debugging
-
Security
- Regularly rotate access tokens
- Use environment-specific SSH keys
- Keep the CLI updated for security patches
Troubleshooting
Common issues and solutions:Authentication Issues
Connection Problems
Too Many SSH Authentication Failures
If you encountertoo many authentication failures
when connecting to a Gitpod environment, it may be due to multiple SSH keys being offered by an agent (e.g., 1Password). The server rejects connections after six failed attempts.
Solutions:
- Stop the SSH agent to prevent other keys from being offered.
- Ensure only the CLI key is used by adding
IdentitiesOnly yes
to your~/.ssh/gitpod/config
under theHost *.gitpod.environment
section.
Testing:
Re-enable your SSH agent and test the connection:Offering public key:
) is used.
Shell Completion
Enable shell completion for easier CLI usage:Updates and Maintenance
Keep your CLI up to date:Additional Resources
- Use
gitpod help
for comprehensive command documentation - Add
-h
or--help
to any command for specific usage information - Use
--verbose
flag for detailed logging when troubleshooting - Check the configuration file at
~/.gitpod/configuration.yaml
for custom settings