opencode-plugin-lispOpenCode plugin that runs a persistent SBCL (Steel Bank Common Lisp) sidecar for evaluating Common Lisp expressions.
0
123
近 7 天 123
32.9
生态多维模型
1 天前
2026-08-18
快速安装与配置
opencode.json写入当前项目的 opencode.json,只对这个仓库生效。
opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-lisp@1.0.0"]
}写入 ~/.config/opencode/opencode.json,对所有项目生效。
~/.config/opencode/opencode.json
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-lisp@1.0.0"]
}若你要在本地改造这个插件,先装到项目里再从本地路径引用。
shell
pnpm add -D opencode-plugin-lispopencode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。
OpenCode plugin that runs a persistent SBCL (Steel Bank Common Lisp) sidecar for evaluating Common Lisp expressions.
State, packages, and defvars persist across evaluations for the lifetime of the sidecar process.
Prerequisites
You need SBCL installed on your system:
# macOS
brew install sbcl
# Ubuntu / Debian
sudo apt install sbcl
# Fedora
sudo dnf install sbcl
# Windows — download from https://www.sbcl.org
Installation
Add the plugin to your opencode.json:
{
"$schema": "https://opencode.ai/config.json",
"plugin": ["opencode-plugin-lisp"]
}
OpenCode will automatically install the plugin via Bun on startup.
Usage
The plugin provides two tools:
lisp_eval
Evaluate a Common Lisp expression in the persistent SBCL sidecar. The expression must be a single line.
lisp_eval code="(let ((x 40)) (+ x 2))"
Returns the printed value, its type, and any output the expression wrote.
lisp_reset
Clear the sidecar's observation history.
lisp_reset
Configuration
| Environment Variable | Default | Description |
|---|---|---|
OPL_SBCL |
sbcl |
Path to the SBCL binary |
OPL_DEBUG |
0 |
Set to 1 to enable debug logging |
How It Works
The plugin spawns a persistent SBCL subprocess that communicates over stdin/stdout using a simple line-based, tab-separated protocol. The sidecar maintains state between evaluations — variables, packages, and definitions persist until the process is restarted.
The plugin also observes chat messages and tool calls via OpenCode hooks, feeding context to the sidecar's history buffer.
License
MIT