Share
Share
// 分享功能文档 // 允许创建公开链接分享对话会话,便于协作和获取帮助
Share your OpenCode conversations.
OpenCode’s share feature allows you to create public links to your OpenCode conversations, so you can collaborate with teammates or get help from others.
[!NOTE] Shared conversations are publicly accessible to anyone with the link.
How it works
// 分享功能的工作原理:创建公开 URL 并同步会话数据
When you share a conversation, OpenCode:
- Creates a unique public URL for your session
- Syncs your conversation history to our servers
- Makes the conversation accessible via the shareable link —
opncd.ai/s/<share-id>
Sharing
// 三种分享模式:手动(默认)、自动、禁用
OpenCode supports three sharing modes that control how conversations are shared:
Manual (default)
// 手动模式:使用 /share 命令显式分享
By default, OpenCode uses manual sharing mode. Sessions are not shared automatically, but you can manually share them using the /share command:
/share
This will generate a unique URL that’ll be copied to your clipboard.
To explicitly set manual mode in your config file:
{
"$schema": "https://opencode.ai/config.json",
"share": "manual"
}
Auto-share
// 自动模式:每个新会话自动分享
You can enable automatic sharing for all new conversations by setting the share option to "auto" in your config file:
{
"$schema": "https://opencode.ai/config.json",
"share": "auto"
}
With auto-share enabled, every new conversation will automatically be shared and a link will be generated.
Disabled
// 禁用模式:完全关闭分享功能
You can disable sharing entirely by setting the share option to "disabled" in your config file:
{
"$schema": "https://opencode.ai/config.json",
"share": "disabled"
}
To enforce this across your team for a given project, add it to the opencode.json in your project and check into Git.
Un-sharing
// 取消分享:移除公开链接并删除服务器端数据
To stop sharing a conversation and remove it from public access:
/unshare
This will remove the share link and delete the data related to the conversation.
Privacy
// 分享会话时的隐私注意事项
There are a few things to keep in mind when sharing a conversation.
Data retention
// 数据保留:分享会话持续可用直到主动取消分享
Shared conversations remain accessible until you explicitly unshare them. This includes:
- Full conversation history
- All messages and responses
- Session metadata
Recommendations
// 隐私建议:仅分享非敏感内容,协作完成后及时取消分享
- Only share conversations that don’t contain sensitive information.
- Review conversation content before sharing.
- Unshare conversations when collaboration is complete.
- Avoid sharing conversations with proprietary code or confidential data.
- For sensitive projects, disable sharing entirely.
For enterprises
// 企业部署选项:可完全禁用、限制 SSO 用户或自托管
For enterprise deployments, the share feature can be:
- Disabled entirely for security compliance
- Restricted to users authenticated through SSO only
- Self-hosted on your own infrastructure
Learn more about using opencode in your organization.