dsh-tool-github

August 26, 2026 · View on GitHub

English | 中文

A Cordis tool plugin that gives DeepSeek Harness (dsh) GitHub capabilities. Agents can look up repositories, search code, list issues, and create draft pull requests in natural language.

Built on the official "everything is a plugin" architecture via ctx.tools.register(defineTool(...)), following the official adding-a-tool contract.

Install

Install directly from GitHub (no npm publish needed):

npm install github:LJH-snow/dsh-tool-github
# or a specific branch/tag
npm install github:LJH-snow/dsh-tool-github#main

Or from a local checkout:

git clone https://github.com/LJH-snow/dsh-tool-github
cd dsh-tool-github
npm install && npm run build   # builds to lib/
npm install /path/to/dsh-tool-github

Once published to npm, it will also be installable as npm install @libai168/dsh-tool-github.

Requires @deepseek-ai/cordis (^4.0.1) and @deepseek-ai/dsh-tools (^0.1.0-rc.6) as peer dependencies, provided by the host dsh runtime.

Configuration

Load the plugin in a dsh composition config (cordis.yml):

- name: 'dsh-tool-github'
  config:
    token: 'ghp_xxx'        # GitHub PAT (optional; required for code search and PR creation)
    baseUrl: 'https://api.github.com'   # optional, override for GitHub Enterprise
    timeoutMs: 15000        # optional, request timeout in ms (default 15000)

Full example: examples/cordis.yml.

Security: read-only tools need no token. github_search_code and github_create_pr_draft require a token. Prefer a minimal-scope fine-grained token and never commit it.

Tools

ToolDescriptionToken
github_get_repoRepository metadata (description, stars, language, license, homepage, updated)no
github_search_reposSearch repositories (sort stars/forks/updated, up to 10 results)no
github_list_issuesList issues (state/label filters, up to 20 results)no
github_search_codeCode search; clear hint when no token is configuredyes
github_list_prsList pull requests (state filter, up to 20)no
github_get_fileRead a repository file (branch/ref support, base64-decoded)no
github_list_commitsList recent commits (branch/author filters, up to 30)no
github_create_issueCreate an issue (title required; body/labels optional)yes
github_comment_issueComment on an issue or PRyes
github_update_issueOpen or close an issueyes
github_merge_prMerge a PR (merge/squash/rebase; requires token)yes
github_list_releasesList releases (tag, draft/prerelease, author)no
github_list_branchesList branches with latest SHAsno
github_get_issueGet issue details (title, state, author, labels, body)no
github_list_issue_commentsList issue comments (author, time, body)no
github_list_milestonesList repository milestones (state filter, due dates, issue counts)no
github_list_pr_commentsList PR review comments (author, time, body)no
github_set_issue_labelsReplace all labels on an issue or PRyes
github_add_issue_assigneesAssign GitHub users to an issue or PRyes
github_set_issue_milestoneSet or clear the milestone on an issue or PRyes
github_reply_pr_commentReply to an existing PR review commentyes
github_get_pull_requestGet PR details (branches, merge state, review decision, diff stats)no
github_list_pull_request_reviewsList PR reviews (reviewer, state, body, time)no
github_request_pr_reviewersRequest user or team reviewers on a PRyes
github_submit_pr_reviewApprove, request changes, or comment on a PRyes
github_get_userGet user/org info (name, bio, followers, repos)no
github_get_orgGet organization profile and repo countsno
github_list_org_reposList organization repositories with visibility metadatano
github_list_org_membersList organization membersyes
github_list_org_teamsList organization teamsyes
github_get_teamGet one organization team by slugyes
github_list_team_membersList members of an organization teamyes
github_list_team_reposList repositories accessible to an organization teamyes
github_update_team_membershipAdd a team member or change their roleyes
github_remove_team_membershipRemove a user from an organization teamyes
github_list_collaboratorsList repository collaborators and effective permissionsyes
github_get_collaborator_permissionGet one collaborator permission and role sourceyes
github_add_collaboratorInvite or add a repository collaborator with a permission levelyes
github_update_collaborator_permissionUpdate an existing collaborator's permissionyes
github_remove_collaboratorRemove a direct collaborator from a repositoryyes
github_add_team_repoGrant an organization team access to a repositoryyes
github_remove_team_repoRemove an organization team's repository accessyes
github_list_repo_webhooksList repository webhooks with events, payload config, and delivery endpointsyes
github_get_repo_webhookGet one repository webhook configurationyes
github_create_repo_webhookCreate a repository webhook (events, secret, content type, active state)yes
github_update_repo_webhookUpdate webhook URL, events, secret, or active stateyes
github_delete_repo_webhookDelete a repository webhookyes
github_ping_repo_webhookSend a ping to a repository webhookyes
github_list_release_assetsList Release assets with size, downloads, and download URLsyes
github_get_release_assetGet one Release asset metadatayes
github_update_release_assetRename a Release asset or update its labelyes
github_delete_release_assetDelete a Release assetyes
github_list_workflow_runsList Actions runs (workflow, branch, status)no*
github_list_workflowsList Actions workflows (name, path, state)no*
github_get_workflowGet a workflow detailno*
github_get_workflow_runGet a workflow run detailno*
github_list_workflow_jobsList jobs and steps for a workflow runno*
github_get_workflow_run_logsDownload and decode workflow run logs (200k char cap)no*
github_list_repo_artifactsList all repository Actions artifacts with expiry/download metadatayes
github_list_run_artifactsList Actions artifacts produced by a workflow runyes
github_get_artifactGet one Actions artifact and its archive download URLyes
github_delete_artifactDelete an Actions artifactyes
github_rerun_workflow_runRerun a workflow runyes
github_cancel_workflow_runCancel an in-progress workflow runyes
github_dispatch_workflowDispatch a workflow_dispatch run with a ref and string inputsyes
github_create_branchCreate a branch from a refyes
github_write_fileCreate/update a file (creates a commit)yes
github_list_environmentsList deployment environments, protection rules, and branch policyyes
github_get_environmentGet one deployment environment and its policyyes
github_update_environmentCreate/update wait timer, reviewers, and branch policyyes
github_delete_environmentDelete a deployment environmentyes
github_get_readmeRead the repository README (markdown)no
github_list_tagsList version tagsno
github_star_repoStar a repositoryyes
github_unstar_repoRemove a staryes
github_create_releaseCreate a release for a tagyes
github_create_repositoryCreate a user or organization repositoryyes
github_set_repo_topicsSet the complete topic list for a repositoryyes
github_list_gistsList user or public gistsno
github_create_gistCreate a public or secret gistyes
github_list_repo_variablesList Actions repository variablesyes
github_set_repo_variableCreate or update an Actions repository variableyes
github_delete_repo_variableDelete an Actions repository variableyes
github_list_repo_secretsList Actions repository secret metadatayes
github_set_repo_secretCreate/update a repository secret with local encryptionyes
github_delete_repo_secretDelete an Actions repository secretyes
github_get_branch_protectionRead branch protection rulesno
github_set_branch_protectionUpdate branch protection rulesyes
github_delete_branch_protectionDelete branch protection rulesyes
github_create_pr_draftCreate a draft PR (head/base/title/body)yes

Behavior contract (per the official execute contract)

  • Business failures are canonical values: missing repo → { found: false }; PR creation failure (branch missing / PR exists) → { created: false, reason }.
  • Only infrastructure errors throw: invalid token (401), rate limit (403), etc.
  • Cancellable: every request forwards exec.signal, with a default 15s timeout.

Development

npm install
npm run typecheck   # type check
npm test            # unit tests (vitest)
npm run build       # build to lib/

See DEVELOPMENT.md for plans and decisions.

Publishing

  1. The package is published under your npm scope: @libai168/dsh-tool-github (npm publishing requires a granular access token with 2FA bypass enabled, or trusted publishing).
  2. npm run build, then npm publish --access public.
  3. Add the dsh-plugin topic to your GitHub repo for ecosystem discovery.

License

MIT