跳到主要内容
    ↑↓ 选择↵ 打开esc 关闭
    landstrip

    Landstrip

    opencode-landstrip·v0.19.20·工具与命令

    OS-level AI command sandboxing for OpenCode with Landstrip

    GitHub 星标

    87

    近 30 天 +11

    月装机量

    2,783

    近 7 天 649

    综合评分

    63.0

    生态多维模型

    最近提交

    5 小时前

    2026-10-21

    快速安装与配置

    opencode.json

    写入当前项目的 opencode.json,只对这个仓库生效。

    opencode.json

    {
      "$schema": "https://opencode.ai/config.json",
      "plugin": ["opencode-landstrip@0.19.20"]
    }

    OpenCode 启动时会通过内嵌运行时自动加载 npm 依赖并缓存至本地目录,无需手动在全局环境执行安装。

    landstrip runs commands in an OS-level sandbox using Landlock on Linux, Seatbelt on macOS, and AppContainer or restricted users on Windows.

    Quick start

    Install:

    npm install --save-dev @landstrip/landstrip-api
    

    On Linux/macOS, save this as policy.json. Windows also needs explicit read grants for the executable and its dependencies.

    {
      "filesystem": {
        "allowWrite": ["."],
        "denyWrite": ["**/.env", "**/*.pem"],
        "denyRead": ["~/.ssh"],
        "allowRead": ["~/.ssh/config"]
      },
      "network": {
        "allowNetwork": false,
        "allowLocalBinding": false
      }
    }
    
    npx landstrip run -p policy.json -- cargo test
    npx landstrip check -p policy.json
    npx landstrip capabilities
    npx landstrip doctor
    

    See landstrip(1) for CLI options, policy rules, and platform limits.

    On Linux, commands always run in new user, PID, and mount namespaces with a private /proc. Landlock and seccomp still enforce filesystem and network policy. Execution fails closed when namespaces are unavailable; check, doctor and capabilities report the kernel error.

    Integrations

    License

    • Native sandbox: LGPL-2.1-or-later.
    • Node.js API and agent extensions: Apache-2.0; see each package's LICENSE.

    同类生态推荐