revive/dsh-git-credentials1

dsh-git-credentials

DSH 外部插件:安全存储 GitHub、GitLab 等 Token(AES-256-GCM 加密),模型按需调用 API 工具,不污染上下文。

AI 分析

核心用途是安全管理 Git 托管平台的访问凭证。适合需要让 AI 操作 Git 仓库(如读取、提交代码),同时要求 Token 保持加密、不暴露给模型上下文的用户。

套件
dsh-git-credentials
版本
0.1.0
授權
MIT
最近更新
2026年8月14日

安裝

$npx -p @deepseek-ai/dsh dsh plugin --profile web add github:revive/dsh-git-credentials

Usage

Manage sites and tokens in Settings → Git Credentials:

  • Add a site: provider (GitLab / GitHub / Gitee / Gitea / Bitbucket), site id, API base URL (defaults per provider: https://api.github.com, https://gitee.com/api/v5, https://api.bitbucket.org/2.0; GitLab and Gitea are self-hosted and need their own address, e.g. https://gitlab.example.com / https://gitea.example.com/api/v1), token reference name (defaults to GITLAB_TOKEN / GITHUB_TOKEN / GITEE_TOKEN / GITEA_TOKEN / BITBUCKET_TOKEN), optional token value (write it with the dedicated Save Token button, or together with Add Site), optional default project
  • Each existing site: read-only by default (provider, base URL, token ref, default project, configured state) with an Edit button; edit mode reveals the inputs plus Save / Cancel, and lets you store or clear the token value, or delete the site
  • The panel talks to same-origin /git-credentials-admin/* JSON endpoints; token values never appear in any response
  • All changes take effect immediately — every tool call reads a fresh decrypted snapshot

Tools

ToolArgumentsReturns
gitlab_projectssite?, search?, membership?, perPage?project summary array
gitlab_filesite?, project, path, ref?{ path, ref, content, truncated }
gitlab_merge_requestssite?, project?, state?, perPage?MR summary array
gitlab_issuessite?, project?, state?, perPage?issue summary array
github_repossite?, search?, perPage?repository summary array
github_filesite?, project (owner/repo), path, ref?{ path, ref, content, truncated }
github_issuessite?, project?, state?, perPage?issue summary array (PRs excluded)
github_pull_requestssite?, project?, state?, perPage?PR summary array
gitee_repossite?, search?, perPage?repository summary array
gitee_filesite?, project (owner/repo), path, ref?{ path, ref, content, truncated }
gitee_issuessite?, project?, state?, perPage?issue summary array
gitee_pull_requestssite?, project?, state?, perPage?PR summary array
gitea_repossite?, search?, perPage?repository summary array
gitea_filesite?, project (owner/repo), path, ref?{ path, ref, content, truncated }
gitea_issuessite?, project?, state?, perPage?issue summary array
gitea_pull_requestssite?, project?, state?, perPage?PR summary array
bitbucket_repossite?, search?, perPage?repository summary array
bitbucket_filesite?, project (workspace/repo), path, ref?{ path, ref, content, truncated }
bitbucket_issuessite?, project?, state?, perPage?issue summary array
bitbucket_pull_requestssite?, project?, state?, perPage?PR summary array
  • Token reference names are POSIX identifiers (GITLAB_TOKEN, GITHUB_TOKEN, GITEE_TOKEN, GITEA_TOKEN, BITBUCKET_TOKEN, …); multiple sites can share one reference or use their own
  • GitLab authenticates with the PRIVATE-TOKEN header; GitHub, Gitee, and Bitbucket with Authorization: Bearer (Gitee additionally falls back to the access_token URL parameter when the header form is rejected); Gitea with Authorization: token
  • HTTP goes through Node's built-in fetch directly — ctx.web.fetch is deliberately not used (URL-only, no header support)