What is OpenPortal CLI?
OpenPortal CLI is a command-line tool that launches OpenCode with an integrated web UI, making it easy to interact with OpenCode through a browser interface. It manages both the OpenCode server and the web UI as separate processes or Docker containers.Architecture
OpenPortal operates with a dual-server architecture:Components
- OpenCode Server - The core AI coding assistant that processes requests
- Web UI Server - A web interface for interacting with OpenCode
- Configuration Manager - Stores instance state in
~/.portal.json
Deployment Modes
OpenPortal supports two deployment modes:Process Mode (Default)
Both OpenCode and the Web UI run as local processes on your machine. This is the default and fastest mode for local development.Docker Mode
OpenCode runs in a Docker container while the Web UI runs locally. This mode provides better isolation and consistency across different environments.Instance Management
OpenPortal maintains a configuration file at~/.portal.json that tracks all running instances. Each instance includes:
- Unique identifier
- Instance name
- Working directory
- Port assignments (Web UI and OpenCode)
- Process IDs or Container IDs
- Deployment mode (process or docker)
- Startup timestamp
Port Allocation
By default, OpenPortal automatically finds available ports:- Web UI: Port 3000 (customizable with
-por--port) - OpenCode Server: Port 4000 (customizable with
--opencode-port)
Quick Start
Start OpenPortal with Web UI
Start Only OpenCode Server
View Running Instances
Stop an Instance
Configuration File
OpenPortal stores its configuration at~/.portal.json. The file contains:
Environment Variables
Docker image to use when running in Docker mode
Docker daemon connection string (e.g.,
tcp://localhost:2375, unix:///var/run/docker.sock)Enable debug logging for Docker operations
Directory Behavior
OpenPortal uses the working directory as the root for OpenCode operations. You can specify the directory in several ways:Instance Naming
By default, OpenPortal names instances after the directory basename. You can specify a custom name:openportal list.
Docker Mode Details
When running in Docker mode (--docker):
Mount Behavior
- Your working directory is mounted into the container at the same path
- The container runs with read-write access to the mounted directory
- Container is configured with
AutoRemove: truefor automatic cleanup
Security Validations
OpenPortal prevents mounting sensitive system directories: Unix/Linux:/,/etc,/usr,/bin,/sbin,/lib,/lib64,/boot,/dev,/proc,/sys,/run,/var/run,/root
C:/,C:/Windows,C:/Program Files,C:/Program Files (x86),C:/ProgramData
Container Lifecycle
Common Workflows
Development Workflow
Multiple Projects
Docker Deployment
Next Steps
Commands
Explore all available commands
Options
Learn about command-line options