Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

OpenCode Web Usage

OpenCode Web Usage (Browser Interface)

Besides the terminal (TUI), OpenCode also provides a Web interface, allowing direct use of AI programming capabilities through a browser.

Web mode is suitable for: remote access, team collaboration, visual operations.

OpenCode Web is the graphical version of TUI, upgrading AI programming from a terminal tool to a visual collaboration platform.


I. What is OpenCode Web?

OpenCode Web is a graphical interface version based on HTTP services; essentially:

Can be understood as:Visual version of TUI


II. Start Web service

1. Basic start


opencode web

By default, it will:


2. Custom port


opencode web --port 4096

3. Allow external access (important)


opencode web --hostname 0.0.0.0 --port 4096

Can be accessed on LAN or remotely


III. Access method

After starting, access in the browser:


http://localhost:4096

Or:


http://你的IP:4096

IV. Interface description

The OpenCode Web interface usually includes:

Essentially consistent with TUI, just more intuitive


V. Basic usage

1. Ask questions


帮我分析这个项目的结构

2. Reference files


这个函数是做什么的?@src/index.js

3. Execute modifications


把这个函数拆成三个函数,并增加错误处理

Explanation:

4. Sessions

View and manage your sessions on the homepage. You can view active sessions or create new ones.

5. Server status

Click See Servers to view connected servers and their status.


VI. Authentication (security settings)

If you use it on a public network or in a team environment, it is recommended to enable authentication:


export OPENCODE_SERVER_PASSWORD=123456
opencode web

Explanation:


VII. Common usage scenarios

1. Remote development

2. Team sharing

3. Demonstration / teaching


VIII. Web vs TUI

Dimension TUI (terminal) Web (browser)
Usage Command line Graphical interface
Operation efficiency High (many shortcuts) Medium
Visualization Weaker More intuitive
Remote access Relatively complex Simple
Suitable for Developers Beginners / teams

IX. Frequently Asked Questions

1. Cannot access the page

Check:

2. Cannot access remotely

Make sure to use:


--hostname 0.0.0.0

3. Port is occupied

Change the port:


opencode web --port 5000