跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    中文English
    kalkidanyishakz

    Lisp

    v1.0.0其他
    opencode-plugin-lisp

    OpenCode plugin that runs a persistent SBCL (Steel Bank Common Lisp) sidecar for evaluating Common Lisp expressions.

    GitHub 星标

    0

    月装机量

    123

    近 7 天 123

    综合评分SCORE

    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"]
    }

    opencode 启动时会通过内嵌运行时自动加载 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