Sharing
OpenCode allows you to share conversations with your team through publicly accessible URLs. This is useful for collaboration, code reviews, and sharing solutions.
How Sharing Works
The /share command creates a share link for the current conversation:
/share
OpenCode responds with a URL like:
https://opncd.ai/s/a1b2c3d4e5f6
Anyone with this link can view the full conversation, including all messages, tool calls, and outputs.
Configuration
Sharing behavior is configured in opencode.json under the share key:
{
"share": "manual"
}
Three modes are available:
| Mode | Behavior |
|---|---|
"manual" | (Default) Share only when explicitly requested via /share |
"auto" | Automatically share every new conversation |
"disabled" | Sharing is not available; /share returns an error |
Manual Mode (Default)
{ "share": "manual" }
Conversations are private by default. Use /share to create a share link when needed. This gives you full control over what is shared and when.
Auto Mode
{ "share": "auto" }
Every new conversation is automatically shared. This is useful for teams that want all collaboration to be visible by default. Be aware that conversations become publicly accessible as soon as they start.
Disabled Mode
{ "share": "disabled" }
Sharing is completely disabled. The /share and /unshare commands return errors. Use this in environments where conversation data must never leave the local machine, such as:
- Regulated industries (finance, healthcare, government)
- Projects with proprietary code or trade secrets
- Air-gapped or offline environments
Unsharing
To stop sharing a conversation and delete it from the server:
/unshare
This removes the share link immediately and deletes all conversation data from the sharing service. The local copy of the conversation is unaffected.
Privacy Considerations
Who Can Access Shared Conversations
- Anyone with the share URL can view the full conversation
- Share URLs use random, unguessable identifiers
- There is no authentication required to view a shared conversation
- Shared conversations are not indexed by search engines
What Data Is Shared
When you share a conversation, the following data is uploaded:
- All messages (user prompts and assistant responses)
- Tool calls and their results
- File references and contents (when included in messages)
- Session metadata (timestamp, model used, agent used)
Credentials, API keys, and sensitive configuration values are never included in shared conversations.
Data Retention
Shared conversations remain accessible until:
- You explicitly run
/unshare - The share endpoint removes the data (automatic expiration may apply)
After unsharing, the data is deleted from the sharing service and the URL becomes invalid.
Recommendations
Do Share
- Solutions to common problems that might help teammates
- Example workflows and demonstrations
- Bug reproduction steps with tool outputs
- Configuration patterns
Don't Share
- Conversations containing API keys, passwords, or tokens
- Proprietary source code from closed-source projects
- Personal identifiable information (PII)
- Internal architecture details of sensitive systems
- Security vulnerability discussions
Best Practices
- Review before sharing: Scan the conversation for any sensitive content before running
/share. - Share purposefully: Only share conversations that provide value to others.
- Unshare when done: Remove the share link after the intended audience has seen it.
- Use disabled mode for sensitive projects: Set
"share": "disabled"in project-levelopencode.jsonto prevent accidental sharing.
Enterprise Considerations
Disabling Sharing
For enterprise deployments, sharing can be completely disabled:
{
"share": "disabled"
}
This ensures no conversation data ever leaves the local environment.
SSO-Only Access
When using OpenCode Zen or Go with enterprise SSO, share links can be restricted to authenticated users within your organization. Contact OpenCode support to enable this feature.
Self-Hosted Sharing
Enterprises can self-host the sharing service to keep data within their infrastructure:
{
"share": {
"endpoint": "https://sharing.internal.example.com"
}
}
Sharing and the CLI
Sharing also works from the command line:
# Run a command and share the result
opencode run "Explain this code" --share
# Share via server API
curl -X POST http://localhost:4096/api/share \
-H "Content-Type: application/json" \
-d '{"sessionId": "abc123"}'
Limitations
- Shared conversations are read-only for viewers — they cannot continue the conversation
- Media and file attachments may not render in the shared view depending on size
- There is a maximum conversation size limit for sharing (very long sessions may fail)
- Share URLs are permanent until explicitly unshared — there is no automatic expiration