Overview
The/share command creates a public URL for your OpenCode session that others can view. This allows you to:
- Share conversations with teammates
- Get help by showing your session
- Document problem-solving workflows
- Create tutorials and examples
- Collaborate on code reviews
Usage
What Gets Shared
Shared sessions include:- Full conversation - All messages and responses
- Tool executions - Commands run and outputs
- File contexts - Code and files referenced
- Metadata - Model, agent, timestamps
Viewing Shared Sessions
Recipients can:- Open in browser - View the conversation
- Copy messages - Extract code or content
- See tool outputs - Understand what was executed
- Import session - Load into their OpenCode
Import a Shared Session
Anyone can import a shared session:Automatic Sharing
Enable automatic sharing for all sessions:Via Environment Variable
Via Configuration
Inopencode.json:
Via CLI Flag
With therun command:
Disabling Sharing
To prevent sharing in your organization or workspace:Via Configuration
Per-Session Control
Sharing can be controlled per session:"auto"- Share all sessions automatically"manual"- Share only when/shareis used (default)"disabled"- Prevent all sharing
Privacy Considerations
What NOT to Share
Avoid sharing sessions containing:- API keys or credentials
- Private code or intellectual property
- Personal information (PII)
- Internal URLs or infrastructure details
- Confidential business logic
- Security vulnerabilities (before they’re fixed)
Redacting Sensitive Data
Before sharing:- Review the full conversation
- Undo messages with sensitive content
- Fork the session and remove sensitive parts
- Use environment variables instead of hardcoded secrets
Revoking Shared Sessions
Currently, shared sessions cannot be deleted after creation. Be cautious about what you share.Future versions may support revoking or editing shared sessions.
Use Cases
Getting Help
Share your session when asking for help:Code Review
Share a session showing your problem-solving process:Documentation
Create tutorials by sharing instructional sessions:Bug Reports
Include session links in bug reports:Team Collaboration
Share sessions for pair programming:Programmatic Sharing
Share sessions via the API:Share URL Format
Share URLs follow this pattern:- Unique per session
- URL-safe (alphanumeric + hyphens)
- Permanent (doesn’t expire)
Import Command
Import shared sessions locally:- Downloads the session data
- Creates a local session
- Preserves all messages and context
- Allows you to continue the conversation
Import Options
You can also import from files:Export vs Share
| Feature | /share | export |
|---|---|---|
| Creates public URL | ✓ | ✗ |
| Exports to file | ✗ | ✓ |
| Requires internet | ✓ | ✗ |
| Public access | ✓ | ✗ |
| Local backup | ✗ | ✓ |
/share for collaboration, export for backups.
Troubleshooting
Sharing Failed
Problem: Cannot create share link Solutions:- Check internet connectivity
- Verify sharing isn’t disabled in config
- Ensure OpenCode can reach
opncd.ai - Check firewall/proxy settings
Sharing Disabled
Problem:Sharing is disabled error
Solutions:
- Check
opencode.jsonfor"share": "disabled" - Remove or change to
"manual"or"auto" - Contact workspace admin if in enterprise
Cannot Access Shared Link
Problem: Link shows 404 or error Solutions:- Verify the URL is complete and correct
- Check internet connectivity
- Try opening in incognito/private mode
- The share service may be temporarily down
Import Failed
Problem: Cannot import shared session Solutions:- Verify the URL is valid
- Check internet connectivity
- Ensure you have disk space
- Try importing to a different directory
Enterprise Considerations
For organizations:Disable Public Sharing
Completely disable sharing:Self-Hosted Sharing
Set up internal sharing service:Audit Trail
Log all share events:Related Topics
import
Import shared sessions
export
Export sessions to files
Sessions
Managing sessions
Share Config
Configure sharing behavior