Web

Using CoDev Code in your browser.

CoDev Code can run as a web application in your browser, providing the same powerful AI coding experience without needing a terminal.

CoDev Code Web - New Session

Getting Started

Start the web interface by running:

codev web

This starts a local server on 127.0.0.1 with a random available port and automatically opens CoDev Code in your default browser.

If CODEV_SERVER_PASSWORD is not set, the server will be unsecured. This is fine for local use but should be set for network access.

Windows Users

For the best experience, run codev web from WSL rather than PowerShell. This ensures proper file system access and terminal integration.

Configuration

You can configure the web server using command line flags or in your config file.

Port

By default, CoDev Code picks an available port. You can specify a port:

codev web --port 4096

Hostname

By default, the server binds to 127.0.0.1 (localhost only). To make CoDev Code accessible on your network:

codev web --hostname 0.0.0.0

When using 0.0.0.0, CoDev Code will display both local and network addresses:

  Local access:       http://localhost:4096
  Network access:     http://192.168.1.100:4096

mDNS Discovery

Enable mDNS to make your server discoverable on the local network:

codev web --mdns

This automatically sets the hostname to 0.0.0.0 and advertises the server as opencode.local.

You can customize the mDNS domain name to run multiple instances on the same network:

codev web --mdns --mdns-domain myproject.local

CORS

To allow additional domains for CORS (useful for custom frontends):

codev web --cors https://example.com

Authentication

To protect access, set a password using the CODEV_SERVER_PASSWORD environment variable:

CODEV_SERVER_PASSWORD=secret codev web

The username defaults to opencode but can be changed with CODEV_SERVER_USERNAME.

Using the Web Interface

Once started, the web interface provides access to your CoDev Code sessions.

Sessions

View and manage your sessions from the homepage. You can see active sessions and start new ones.

CoDev Code Web - Active Session

Server Status

Click "See Servers" to view connected servers and their status.

CoDev Code Web - See Servers

Attaching a Terminal

You can attach a terminal TUI to a running web server:

# Start the web server
codev web --port 4096
 
# In another terminal, attach the TUI
codev attach http://localhost:4096

This allows you to use both the web interface and terminal simultaneously, sharing the same sessions and state.

Config File

You can also configure server settings in your codev.json config file:

{
  "server": {
    "port": 4096,
    "hostname": "0.0.0.0",
    "mdns": true,
    "cors": ["https://example.com"]
  }
}

Command line flags take precedence over config file settings.