Introduction¶
A common pain point when calling APIs for GitLab, GitHub, Gitee, Gitea, or Bitbucket in DSH agents is that tools need to access remote repository resources, but the token values are not suitable for entering the model context.
dsh-git-credentials is a DeepSeek Harness plugin used to manage API tokens for GitLab, GitHub, Gitee, Gitea, and Bitbucket. It prevents token values from entering the model context; instead, they are decrypted from the plugin’s own encrypted storage during tool invocation and used in the outgoing Authorization header.
What is this¶
- Plugin Name:
dsh-git-credentials - Maintainer Repository:
https://github.com/revive/dsh-git-credentials - License:
MIT - Position: DeepSeek Harness plugin for managing Git platform API tokens, ensuring token values do not enter the model context.
The core issue it solves is: reusing DSH tool invocation capabilities across multiple Git hosting sites while avoiding passing real token values to the model context.
Core Capabilities¶
Token values do not enter the model context¶
The plugin manages API tokens for GitLab, GitHub, Gitee, Gitea, and Bitbucket. On the model side, only business parameters such as site, project, and path are handled; token values do not enter the model context.
During invocation, token values are decrypted from the plugin’s AES-256-GCM encrypted storage and used in the outgoing Authorization header.
Encrypted Storage¶
The plugin uses two files to save credential-related data:
- An AES-256-GCM encrypted data file
- A separate 32-byte random key file located at
~/.dsh/git-credentials.key
Both files have permissions set to 0600 and use atomic writes during writing.
Limit tool scope by provider¶
Tools are divided by platform namespaces:
gitlab_*
github_*
gitee_*
gitea_*
bitbucket_*
gitlab_* only accesses the corresponding GitLab site, github_* only accesses the corresponding GitHub site, and gitee_*, gitea_*, and bitbucket_* follow the same logic.
Web Settings Panel¶
The plugin provides a Web settings panel, accessible via:
Settings → Git Credentials
The panel allows the following operations:
- Add site
- Edit site
- Delete site
- Save token value
- Clear token value
Panel responses do not carry token values; they only return the configuration status.
Hot Loading and Immediate Effect¶
The plugin supports mounting or unmounting on a running GUI without requiring a GUI restart.
Every tool invocation reads a newly decrypted snapshot, so changes take effect on the next call after editing a site or rotating a token.
Installation and Activation¶
Installing the release tarball¶
First, download the corresponding version’s tarball from the repository releases, for example:
dsh-git-credentials-0.2.2.tgz
Then execute the installation:
dsh plugin --profile <name> add ./dsh-git-credentials-0.2.2.tgz
After installation, you can verify the configuration layer:
dsh --profile <name> --dump-config
Find the following in the output:
# == dsh-git-credentials
Note: When installing a bundle via dsh plugin add, it will not hot-mount to the currently running GUI. You need to restart the GUI process after installation. After restarting, the plugin will appear at:
Settings → Git Credentials
Installing from source¶
Before installing from source, you need to build the browser artifacts first:
lib/client.js
The release tarball already contains the build artifacts, whereas installing from source requires building them first.
Then, create a soft link for the plugin directory to a node_modules path resolvable by the profile:
mkdir -p ~/.dsh/profiles/node_modules
ln -s /path/to/dsh-git-credentials ~/.dsh/profiles/node_modules/dsh-git-credentials
Next, add an insert line with id: git-credentials to ~/.dsh/cordis.patch.yml. The minimal example is:
- insert:
- id: git-credentials
Typical Usage¶
Adding a site¶
Open:
Settings → Git Credentials
When adding a site, you need to fill in:
- provider: GitLab, GitHub, Gitee, Gitea, or Bitbucket
- site id
- API base URL
- token reference name
- optional token value
- optional default project
Token values can be written using the dedicated Save Token button, or saved together when adding the site.
Editing an existing site¶
Existing sites are read-only by default. You can view:
- provider
- base URL
- token reference name
- default project
- configuration status
After clicking Edit, you enter edit mode, which allows you to:
- Modify site configuration
- Save a new token
- Clear a token
- Delete the site
Confirming before calling write operations¶
The tools provided by the plugin access remote Git platform resources. Write operations will actually modify remote resources; therefore, the model should confirm with the user before calling.
Suitable Scenarios and Precautions¶
Suitable scenarios include:
- Need to manage API tokens for multiple Git hosting sites simultaneously
- Want token values to not enter the model context
- Want to add, edit, and delete sites via the Web settings page
- Want changes to take effect immediately on subsequent tool calls after rotating a token
Precautions to note before use:
- The plugin runs with the permissions of the current
dshprocess. You should check the source code, license, and dependencies before installing. - The license is
MIT. - PeerDependencies requirements:
@deepseek-ai/cordis ^4.0.1-rc.1@deepseek-ai/dsh-tools ^0.0.1-rc.1@deepseek-ai/schemastery ^3.18.1-rc.1- If
~/.dsh/git-credentials.keyis lost, the encrypted data cannot be recovered. - It is safe to only copy the encrypted data file; without the key file, decryption is impossible.
- Processes with the same UID reading both the data and key files simultaneously are not protected by this encryption scheme.
- The key and data are stored with the same permissions, which falls under “discretion, not a boundary”.
- When a user intentionally requests the model to read these files, it falls outside the scope that this threat model can prevent.
- Write operations will actually modify remote resources; confirmation with the user is required before calling.
Conclusion¶
The value of dsh-git-credentials lies in: it moves the management of Git platform API tokens out of the model context, keeping token values only within the plugin’s encrypted storage and outgoing request headers. For scenarios requiring access to multiple Git hosting sites within DSH, it is a credential management companion plugin.
The directory page URL was not confirmed in the verified materials for this article, so no specific URL is provided here. The repository address is:
https://github.com/revive/dsh-git-credentials