Import the copied connection information from the new API site with a single click.
Install
# from npm (prebuilt)
dsh plugin --profile web add dsh-import-newapi
# from GitHub (first run asks for allowBuilds approval — follow the hint, retry)
dsh plugin --profile web add github:Deanyu148/dsh-import-newapi
Any plugin you install runs third-party code with your own permissions — it can read your files, use your credentials, and reach the network, and tool approvals don’t sandbox it. GitHub-sourced plugins also run build scripts at install time — pnpm blocks those until you allow them, so an install can stop with ERR_PNPM_GIT_DEP_PREPARE_NOT_ALLOWED or ERR_PNPM_IGNORED_BUILDS; dsh prints the exact key to add under allowBuilds in your profile’s pnpm-workspace.yaml, and the install works on the next run. Allowing a build is a trust decision: only install sources you trust, and pin a commit (github:owner/repo#sha).
README
English · 简体中文
dsh-import-newapi
Import the connection info copied from New API as a new
provider of the @deepseek-ai/dsh-llm-pi-ai adapter in the current profile, and store the API key
in the DSH credentials file.
Repository: https://github.com/Deanyu148/dsh-import-newapi
- Where it lives: DSH settings panel → "New API Import" (right below "Models").
- Connection info is written to the current profile's
cordis.patch.yml, underconfig.providers.<provider id>of thellm-pi-aientry. Only new keys are added; no existing key or parent key is ever touched. - The API key is written to
refs:in$DSH_HOME/.credentials.yaml, with the ref name derived from the provider id. - To hook up a second New API instance, just import again — it creates another provider.
Installation
dsh plugin --profile desktop add dsh-import-newapi
Refresh the page afterwards and "New API Import" shows up in the settings sidebar.
Usage
- Connection info: paste the JSON copied from New API into the first box, for example
{"_type":"newapi_channel_conn","key":"sk-…","url":"https://…"}. Once it is recognized, the site URL and the key are filled in for you; you can also type them by hand. - Provider: fill in the provider id (a candidate is suggested from the site URL), an optional
display name, and the protocol.
baseURLis derived from the protocol and can be overridden:- OpenAI Chat Completions / OpenAI Responses →
<site URL>/v1 - Anthropic Messages →
<site URL>(the SDK appends/v1/messagesitself)
- OpenAI Chat Completions / OpenAI Responses →
- Models: click "Fetch model list", filter with the search box, tick models one by one, or use "Select all / Invert / Select none" (those three buttons only apply to the current search results).
- Name and capacities: every ticked model gets a row — the model id on the left (read-only),
then the name, the context window, and the max output.
- The name is the display name of that model (
models[].name, not the id). It defaults to the name reported by the catalogue and can be edited per model. Leaving it empty, blank, or identical to the id means the key is not written at all. - Capacities accept forms like
256K/1M(K/Mare decimal, i.e. 1K = 1000, 1M = 1000000, fractions allowed), or plain numbers. Leaving them empty means the key is not written, and the adapter or the built-in catalogue decides. Verified:272K→272000,1.05M→1050000,384K→384000.
- The name is the display name of that model (
- Input modalities and reasoning effort (both optional): each ticked model gets one row that
shows the current selection; clicking that row opens a centred popup for that model, and
only one model is open at a time. Close it with "Done", by clicking the backdrop, or with
Esc; closing plays a short fade-out, and the row keeps showing the result afterwards (for example "Text · Reasoning Low, High"). Clicking the currently open row again also fades it out; clicking again mid-fade cancels the close and keeps it open. The popup is mounted at the page root, so the narrow settings column and its scroll container can neither clip it nor hide levels — all six levels are visible at once.- Input modalities: tick
Text/Image. Text is ticked by default, and Image is ticked by default when the catalogue reports that the model accepts images. Text only equals the adapter default, so noinputkey is written; ticking Image writesinput: [text, image]; ticking nothing writes nothing. - Reasoning effort: this is
reasoningEffortsfrom the template. Each model offers six levelsoff / low / medium / high / xhigh / max(the UI shows the level names in the current language). Once a level is ticked: the middle input is the config key (the level name by default, editable) and the right input is the value sent to the gateway for that level (same as the level name by default, editable).offmay have a key with no value: leaving it empty means "do not send this parameter when not thinking" (rendered asoff: null; in YAMLoff:andoff: nullare the same empty value). Givingoffa value sends that value.- Every ticked level other than
offmust have a value, and the key name must be one of the levels the adapter allows (off / minimal / low / medium / high / xhigh / max), so to useminimaljust rename the key of one row. - Ticking only
off, duplicate key names, an empty key name, or a non-offlevel without a value are all blocked before the import runs, with the reason shown. - Ticking no level at all means
reasoningEffortsis not written, and the adapter plus the built-in catalogue decide what the model supports.
- Input modalities: tick
- Click "Import". The expandable preview shows the provider object that is about to be written.
Rules
Provider id: starts with a lowercase ASCII letter and may only contain lowercase letters, digits and hyphens (
-); a hyphen may not lead, trail, or repeat. An id that already exists is always refused — this plugin only adds, never overwrites.Credential ref name: the provider id uppercased,
-replaced with_, plus a trailing_API_KEY. For exampleexample-api→EXAMPLE_API_API_KEY,example-api-2→EXAMPLE_API_2_API_KEY.How it writes: everything is submitted through DSH's own remotes (
settings.mutate/credentials.set), so validation, locking, atomic writes and hot reload are the host's job. The plugin never edits files by itself (with the single textual exception described below).When the key is already supplied by the environment (
describereportswritable: false), the import skips writing.credentials.yaml, says so, and still writes the provider.An empty
refs: {}is removed before anything is written: the credentials provider works by parsing the file into a YAML document, changing one key in place, and rendering it back, so the existing formatting is mostly preserved. When the file contains nothing but an empty flow mapping, a new key can only be squeezed onto the same line (refs: { EXAMPLE_API_API_KEY: sk-… }). The host half deletes that line on mount and watches the file, so the provider creates a block mapping instead:refs: EXAMPLE_API_API_KEY: sk-…Both forms are completely equivalent as far as the provider is concerned, so this is a pure textual tidy-up: the plugin only deletes an empty
refs: {}line, never parses or generates YAML, and never reads or writes any key material (values are always written bycredentials.set). The location is probed three times, most trustworthy first: the path the live credentials service reports →$DSH_HOME/.credentials.yaml→<home>/.credentials.yamlderived from the load base directory, finally falling back to~/.dsh; and only a file that really is aversion: 1credentials document is ever touched.Model entries only carry keys that have information: no
namewhen it is empty or identical to the id, no capacities when they are empty, noinputwhen only Text is ticked, noreasoningEffortswhen no level is ticked. The key order follows the template:id,name,contextWindow,maxTokens,input,reasoningEfforts.The reasoning values follow the adapter's
resolveModelReasoningrules (every level exceptoffneeds a value, and a declared map needs at least one non-offlevel). Generated entries were checked against the profile's real@deepseek-ai/schemasterywith the adapter's own schema (lib/index.js:1001-1013):off: nulland the custom keyminimalboth validate, while unknown level keys and non-string values are rejected.Note: when config-editor writes, it re-renders the whole
configblock of that entry, so comments inside thellm-pi-aientry'sconfig:are lost. Comments of other entries are not affected.
Development
node test/run.mjs
The offline test loads the real client bundle, hands it a mini React and a fake cordis context,
runs the whole import flow (paste → derive → fetch models → tick → fill names/capacities → open the
popup to tick modalities and reasoning levels → close it → submit) and asserts the payload handed to the host. The
__internals export at the end of lib/client.js exists for that purpose. The host half is covered
too: the empty refs: {} rewrite (including reproducing the provider's real write with the
profile's own yaml), the guard that only touches credentials documents, candidate path priority,
and mount-time normalization plus file watching.
After editing lib/client.js a page refresh is enough; after editing lib/index.js (the host
half) you must restart DSH — disabling and re-enabling the plugin with plugin_manager does not
re-import a host module (Node's ESM cache), whereas the browser half picks up a new bundle on every
refresh.
Releasing (maintainers)
npm run release # checks → tests → publish latest (always the official registry)
npm run release -- --dry-run # checks only, then prints the files that would be published
npm run release -- --tag beta # publish under another dist-tag
npm run release -- --otp 123456 # one-time password for a 2FA account
scripts/publish.mjs runs these steps in order and stops with a clear reason as soon as one of them
is not satisfied:
- checks the name, version and registry — the registry is hard-coded to
https://registry.npmjs.org/, no mirror configuration is followed; - requires a clean Git working tree (
--skip-git-checkoverrides it) and reports unpushed commits; - runs
node test/run.mjs(--skip-testsoverrides it, not recommended); - asks the registry API whether that version was already published — if it was, it only tells you
to
npm version patchand never overwrites; - runs
npm publish --registry https://registry.npmjs.org/.
With a 2FA account you can pass --otp straight away, or run
npm login --auth-type=web first and then npm run release.
Files
| File | Purpose |
|---|---|
lib/index.js |
Host half: mount-time self-check, normalizes an empty refs: {} into a block refs: section, and watches that file |
lib/client.js |
Browser half: the settings page and the import flow |
cordis.patch.yml |
Inserts this plugin's entry into the profile |
test/run.mjs |
Offline self-test: mini React + fake cordis context, runs the full import flow and asserts the payload |
scripts/publish.mjs |
Release script: tests → registry and version checks → npm publish |
Links
More in this category
Tencent/WeKnora#dsh-weknora★ 38526
Four read-only tools over a WeKnora knowledge base: list knowledge bases, hybrid passage search, reassemble one document's chunks in order, and WeKnora's own cited RAG or ReAct-agent answer with a resumable session id.
DayuanJiang/next-ai-draw-io#dsh-plugin★ 37266
Draws draw.io diagrams in DeepSeek Harness through the next-ai-drawio MCP server: the link in the reply opens a live preview in the right sidebar, you can edit the diagram by hand, and each AI change is a version you can restore. Node.js 18+; npx downloads the MCP server on first use.
yikart/AiToEarn#dsh-plugin-aitoearn★ 28921
Generate copy, images and short videos, and publish with one click to Douyin, Kuaishou, Xiaohongshu, WeChat Official, Bilibili, Facebook, TikTok and more, covering the full content lifecycle from creation to publishing and monetization.
superdesigndev/treg★ 9983
Tool catalog for agents: search ~2,600 external endpoints (SEO and SERP, backlinks, social, people and company enrichment, ad libraries, scraping) by the task you want done, read each one's parameters and per-call price, then call it with the credential injected server-side. Ships the skill plus an MCP row that stays disabled until TREG_TOKEN is set.
T-Auto/dsh-ops★ 6095
Provides bash, PowerShell 7, and high-performance Rust tools for DSH on Windows to reduce token usage.
Hithink-Tech-Org/Financial-API#hithink-finance★ 4745
Query Hithink Finance data in DeepSeek Harness, view charts in chat, and save refreshable dashboards.
Community comments
Comments are public GitHub Discussions. Loading them connects to GitHub and Giscus; a GitHub account is required to post.