0
30
近 7 天 9
16.6
生态多维模型
7 个月前
2025-12-30
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@madisonbullard/opencode-private-share@0.2.1"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["@madisonbullard/opencode-private-share@0.2.1"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D @madisonbullard/opencode-private-shareopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
A collection of tools and plugins to complement OpenCode.
Packages
@madisonbullard/opencode-private-share
An OpenCode plugin that enables private session sharing and ingestion. This allows you to:
- Create private shares: Save your OpenCode sessions locally for later reference or sharing
- Ingest sessions: Restore previously saved sessions, even on different machines with automatic path remapping
Installation
npm install @madisonbullard/opencode-private-share
Configuration
Add the plugin to your OpenCode configuration:
{
"plugins": {
"private-share": "@madisonbullard/opencode-private-share"
}
}
Usage
The plugin provides two tools:
private-share
Creates a private share of your current session. The session data is saved locally to ~/.opencode/private-shares/.
ingest-session
Restores a previously saved session. Use list as the shareId to see available sessions.
ingest-session shareId="list" # List available sessions
ingest-session shareId="2025-01-15-my-session" # Ingest a specific session
If the session was created on a different machine, the plugin will attempt to auto-detect the repository location. If it cannot be found automatically, you can specify the path:
ingest-session shareId="2025-01-15-my-session" projectPath="/path/to/repo"
Development
This is a monorepo managed with Bun workspaces and Turborepo.
Prerequisites
- Bun v1.3.5 or later
Setup
# Install dependencies
bun install
# Run type checking
bun typecheck
# Run linting
bun check
Scripts
| Command | Description |
|---|---|
bun check |
Run Biome linter |
bun fix |
Auto-fix linting issues |
bun typecheck |
Run TypeScript type checking |
bun publish |
Publish packages (maintainers only) |
Project Structure
opencode-tools/
├── packages/
│ └── plugins/
│ └── private-share/ # OpenCode plugin for private session sharing
├── scripts/
│ └── publish.ts # Publishing automation
├── biome.json # Linter configuration
├── turbo.json # Turborepo configuration
└── package.json # Root package configuration
License
MIT - see LICENSE for details.