Skip to main content

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

The command generates a shareable URL:

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
Shared sessions are public. Anyone with the link can view the content. Don’t share sensitive information.

Viewing Shared Sessions

Recipients can:
  1. Open in browser - View the conversation
  2. Copy messages - Extract code or content
  3. See tool outputs - Understand what was executed
  4. Import session - Load into their OpenCode

Import a Shared Session

Anyone can import a shared session:
This creates a local copy they can continue working with.

Automatic Sharing

Enable automatic sharing for all sessions:

Via Environment Variable

Via Configuration

In opencode.json:

Via CLI Flag

With the run command:
With auto-share enabled, every session is shared automatically and the URL is displayed:

Disabling Sharing

To prevent sharing in your organization or workspace:

Via Configuration

With sharing disabled:

Per-Session Control

Sharing can be controlled per session:
Options:
  • "auto" - Share all sessions automatically
  • "manual" - Share only when /share is used (default)
  • "disabled" - Prevent all sharing

Privacy Considerations

Shared sessions are publicly accessible. Review content before sharing.

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:
  1. Review the full conversation
  2. Undo messages with sensitive content
  3. Fork the session and remove sensitive parts
  4. 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:
The slug is:
  • Unique per session
  • URL-safe (alphanumeric + hyphens)
  • Permanent (doesn’t expire)

Import Command

Import shared sessions locally:
This:
  1. Downloads the session data
  2. Creates a local session
  3. Preserves all messages and context
  4. Allows you to continue the conversation

Import Options

You can also import from files:

Export vs Share

Use /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.json for "share": "disabled"
  • Remove or change to "manual" or "auto"
  • Contact workspace admin if in enterprise
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:

import

Import shared sessions

export

Export sessions to files

Sessions

Managing sessions

Share Config

Configure sharing behavior