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

    Gitloops

    v0.3.4Git 与版本控制
    opencode-gitloops

    GitHub repo explorer agent and plugin for OpenCode. Clone and explore any public GitHub repo locally.

    GitHub 星标

    0

    月装机量

    126

    近 7 天 17

    综合评分SCORE

    9.8

    生态多维模型

    最近提交

    3 个月前

    2026-05-15

    快速安装与配置

    opencode.json

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

    opencode.json

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

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

    Gitloops

    A plugin for OpenCode that lets you clone and explore GitHub repositories locally. Ask questions about a repo's code, structure, and patterns — all without leaving your terminal.

    Gitloops provides three custom tools (gitloops_clone, gitloops_refresh, gitloops_list) restricted to read operations — no file modifications, no shell access. You can use these tools from any agent, or optionally enable a dedicated gitloops agent via config.

    Installation

    Add the plugin to your opencode.json config file:

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

    OpenCode will automatically install the package.

    Alternatively, you can install it as a local plugin by placing it in your plugin directory:

    • Project-level: .opencode/plugins/
    • Global: ~/.config/opencode/plugins/

    Configuration

    Gitloops auto-creates a config file on first load at:

    ~/.config/opencode/plugin/gitloops.json
    
    {
      "$schema": "https://raw.githubusercontent.com/maharshi365/opencode-gitloops/master/schema/config.schema.json",
      "max_repos": 10,
      "cache_loc": "~/.cache/gitloops/repos",
      "eviction_strategy": "lru",
      "agent": {
        "enabled": false,
        "model": "anthropic/claude-sonnet-4-5",
        "temperature": 0.1,
        "color": "#ed5f00",
        "mode": "all"
      }
    }
    
    Option Type Default Description
    max_repos integer 10 Maximum number of cached repos. When exceeded, repos are evicted automatically.
    cache_loc string ~/.cache/gitloops/repos Directory where cloned repos are stored (<cache_loc>/<owner>/<repo>/). Supports ~.
    eviction_strategy string "lru" Strategy for removing repos when max_repos is exceeded.
    agent object see below Controls the optional dedicated gitloops agent.

    Eviction strategies

    Strategy Behavior
    lru Remove the least recently used repo (oldest modification time)
    fifo Remove the oldest cloned repo (oldest creation time)
    largest Remove the largest repo by disk size

    Agent configuration

    The agent object controls the optional dedicated gitloops agent entry in OpenCode. By default (enabled: false) only the plugin tools are registered — you can call them from any agent or the default assistant.

    Field Type Default Description
    enabled boolean false Set to true to add a gitloops entry to the OpenCode agent picker.
    model string (session) Model to use, e.g. "anthropic/claude-sonnet-4-5". Falls back to the session model if omitted.
    temperature number 0.1 Sampling temperature (0–2).
    color string "#ed5f00" Hex color (e.g. "#FF5733") or theme color name ("primary", "accent", etc.) shown in the UI.
    mode string "all" "primary" — main picker only. "subagent"@mention only. "all" — both.

    The $schema field enables autocompletion and validation in editors that support JSON Schema.

    Private repositories

    Private repositories are supported as long as your local git credentials or SSH keys grant access — the same way git clone works in your terminal. No additional configuration is needed.

    If a clone fails due to missing credentials, Gitloops will surface a specific error message directing you to configure your git credentials or SSH keys.