登录 注册
其他
778
Stars
—
Forks
0
Watchers
—
Open Issues
待补全
许可证
Lua
语言
—
创建时间
最近更新

项目能做什么

面向 Neovim 的 Sourcegraph 与 Cody 实验性插件。
来源:AI 基于仓库事实生成 · 内容以仓库实际 README 为准

使用说明 查看原始 README 原仓库文档

中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)
# sg.nvim

> [!IMPORTANT]  
> This plugin is currently experimental and is not actively being maintained. 

## Table of Contents

- [Setup](#setup)
- [Installation](#installation)
- [Configuration](#configuration)

sg.nvim is a plugin focused on bringing many of the features of sourcegraph.com and Cody into Neovim.

## Setup

To login, either:

- Run `:SourcegraphLogin` after following installation instructions for `sourcegraph.com` usage.
- Run `:SourcegraphLogin!` and provide an endpoint and access token to be stored.
- Use the `SRC_ENDPOINT` and `SRC_ACCESS_TOKEN` environment variables to manage tokens for enterprise usage.
  - See [src-cli](https://github.com/sourcegraph/src-cli#log-into-your-sourcegraph-instance) for more info

See `:help sg.auth` for more information.

You can check that you're logged in by then running `:checkhealth sg`

## Autocomplete

Currently, sg.nvim only supports nvim-cmp. For setup information, see: `:help cody.complete`.

If you have other completion sources you would like added, please let me know in the issue tracker!

## Installation

### Requirements

Requires:

- nvim 0.9 or nvim nightly
- Node.js >= 18.17.0 (LTS) at runtime for [`cody-agent.js`](https://github.com/sourcegraph/cody)

(By default, sg.nvim downloads released binaries from GitHub. If you prefer to build the plugin yourself, you'll need `cargo` to build)

- Currently uses plenary.nvim and telescope.nvim for some features.
  - If you would like to use something else for search functionality, please make an issue and I can look into adding support.

### Install

Regardless of installation method, you must call `require("sg").setup { ... }` in your config.

<details>
<summary><code>lazy.nvim</code></summary>

```lua
-- Use your favorite package manager to install, for example in lazy.nvim
--  Optionally, you can also install nvim-telescope/telescope.nvim to use some search functionality.
return {
  {
    "sourcegraph/sg.nvim",
    dependencies = { "nvim-lua/plenary.nvim", --[[ "nvim-telescope/telescope.nvim ]] },

    -- If you have a recent version of lazy.nvim, you don't need to add this!
    build = "nvim -l build/init.lua",
  },
}
```
</details>

<details>
<summary><code>packer.nvim</code></summary>

```lua
-- Packer.nvim, also make sure to install nvim-lua/plenary.nvim
use { 'sourcegraph/sg.nvim', run = 'nvim -l build/init.lua' }

-- You'll also need plenary.nvim
use { 'nvim-lua/plenary.nvim' }

-- And optionally, you can install telescope for some search functionality
--  "nvim-lua/plenary.nvim", --[[ "nvim-telescope/telescope.nvim ]]
```
</details>

<details>
<summary><code>vim-plug</code></summary>

```vimrc
" Using vim-plug
Plug 'sourcegraph/sg.nvim', { 'do': 'nvim -l build/init.lua' }

" Required for various utilities
Plug 'nvim-lua/plenary.nvim'

" Required if you want to use some of the search functionality
Plug 'nvim-telescope/telescope.nvim'
```
</details>

After installation, run `:checkhealth sg`.

(Nix instructions at the end of the
阅读完整原文

项目深度分析 AI 生成

社区维护版/增强版 Cody & Sourcegraph 插件与赞助订阅

产品构想接盘该未维护项目进行 Fork 重构,修复与现代 Neovim 及最新 Sourcegraph/Cody Agent 协议的兼容性,通过 GitHub Sponsors 或 Open Collective 获取赞助,或提供专属高级功能版本(如支持 blink.cmp、本地缓存加速等)。
核心功能与最新 cody-agent 同步协议支持、现代补全引擎适配(nvim-cmp / blink.cmp)、多仓全局语义检索与引用跳转优化、离线/低延迟配置管理。
目标用户依赖 Sourcegraph 和 Cody 的 Neovim 核心开发者、极客个人用户。
难度/周期中等 · 2-4 周 · 成本:开发机器、Sourcegraph/Cody 测试账号及个人时间成本。
收费模式GitHub Sponsors 订阅、提供 Pro 增强特性插件(闭源或延期开源模式)。
竞争风险Neovim 插件社区付费意愿极低;Sourcegraph 官方随时可能变更 cody-agent 的内部通信接口,维护成本高。
依据 已验证事实

企业 Neovim 研发工作流定制集成与私网适配服务

产品构想针对购买了 Sourcegraph Enterprise 的中大型企业,提供专门适配企业内网环境、私有认证(SSO/Token)、合规审计的 Neovim 终端开发套件集成与技术支持服务。
核心功能企业私有实例一键接入与鉴权、企业级代理与离线包分发、安全审计脱敏配置、企业专属快捷键与定制提示词模板。
目标用户购买了 Sourcegraph 企业版的工程团队(含大量重度终端/Vim 极客工程师)。
难度/周期低至中等 · 1-2 个月 · 成本:商务BD时间、企业测试环境对接成本。
收费模式企业技术咨询支持费(年费订阅或按次交付)、定制插件维护服务合同。
竞争风险企业内 Neovim 用户占比较小,难以推动企业管理层单独为终端插件买单。
依据 AI推测

泛化终端智能代码上下文中间件(多后端 Neovim 增强)

产品构想基于 Rust/Lua 提取 sg.nvim 的多仓库跨定义跳转和上下文组装逻辑,打造兼容 Sourcegraph、本地 ripgrep、LSP 索引的多模型 Neovim 上下文供给工具,售卖预编译二进制包或托管上下文推理服务。
核心功能跨本地与远端仓库的代码上下文精准检索、注入 Neovim AI 对话上下文、集成常用补全框架、开箱即用的跨平台预编译二进制分发。
目标用户需要大范围代码库理解但脱离网页端 IDE 的高级全栈架构师、终端代码极客。
难度/周期高 · 2-3 个月 · 成本:预编译 CI 设施、云端模型或多仓索引测试服务器开销。
收费模式软件商业授权(针对高级多仓语义索引模块)或 SaaS Token 转发计费。
竞争风险同类竞品(如 Avante.nvim、Copilot.nvim 等)生态成熟度高且免费替代方案众多。
依据 尚需验证的假设
AI 基于仓库公开数据分析生成,含推测成分,不构成收益承诺。
报告会保存到 个人中心

竞品与相似项目 GitHub Search 真实检索

相似项目数据正在完善中,暂不展示(避免误导)

项目优势与风险

技术成熟度创建时间待补全,最近推送 ,发布过 12 个 Release
社区活跃Star 778 / Fork 0 / Issue 0(数据支持,可自行核实)
许可证未检测到(需人工确认)
主要风险上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价

安装与使用

此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。