dcorner
v0.1.2
Published
Connect OpenCode to DoneCorner (dc-llm) in one command.
Maintainers
Readme
dcorner
Connect OpenCode to DoneCorner. Requires Node.js 18+ and an existing OpenCode 1.x or 2.x installation on PATH. Get a key at donecorner.ai/account.
npx dcorner setup
# Paste your DoneCorner key at the hidden prompt.
opencodeSetup checks /models for dc-llm, preserves existing JSON/JSONC settings and
comments, stores the credential privately, and selects donecorner/dc-llm as
the default model. The key is never placed in the provider configuration.
Commands
| Command | Purpose |
|---|---|
| dcorner setup | Configure the provider using a hidden key prompt. |
| pbpaste \| dcorner setup --stdin | Read the key from stdin on macOS. |
| dcorner setup --url https://host/v1 | Configure a different gateway. |
| dcorner status | Check the saved endpoint and selected credential. |
| dcorner --version | Print the canonical CLI version. |
Use npx dcorner instead of dcorner if you have not installed the package.
DC_API_KEY is also supported for controlled environments. Avoid passing keys
as command-line arguments, which can expose them in history and process lists.
Remote endpoints require HTTPS; HTTP is supported for loopback testing.
Existing OpenCode installations
Setup detects the OpenCode major version:
- 1.x: uses
provider/npm/optionsand updates only thedonecornerentry in OpenCode'sauth.json, preserving other credentials. - 2.x: uses
providers/package/settingsand imports the key through stdin withopencode auth import --standalone. It activates the new key before removing old DoneCorner credentials. Standalone mode keeps your running OpenCode service separate from setup.
If multiple OpenCode installations are present, select the one you actually run:
DC_OPENCODE_BIN=/absolute/path/to/opencode npx dcorner setup
DC_OPENCODE_BIN=/absolute/path/to/opencode npx dcorner statusUse the same installation for setup and normal operation. The two major versions have different configuration formats; sharing a configuration between them can require a separate OpenCode migration.
The configuration directory is ~/.config/opencode unless XDG_CONFIG_HOME or
OPENCODE_CONFIG_DIR overrides it. An explicit OPENCODE_CONFIG file is honored.
An existing opencode.jsonc takes precedence over opencode.json. The previous
configuration is saved as .bak; configuration and backup files use mode 0600
on POSIX. The original config is restored if credential setup fails. Failed
network/key checks do not change configuration or credentials.
DC_URL overrides the saved endpoint. status otherwise uses the endpoint in
configuration. Gateway response bodies and credential export errors are not
printed, because either can contain secrets. POSIX file modes do not replace
Windows ACLs; keep your OpenCode data directory private on Windows.
Python distribution
The source under packages/python provides the same CLI as a Python console
command, bundling this JavaScript implementation. Python still needs Node.js 18+
and OpenCode. It does not download or install runtimes.
PyPI dcorner==0.0.1 was only a name reservation and has no command. npm 0.1.2 and the Python 0.0.2 distribution provide the setup CLI.
Upgrade an older installation before running setup.
Development and release
cd packages/cli
npm ci
npm test
DC_TEST_REQUIRE_REAL=1 DC_TEST_OPENCODE=/path/to/opencode-v2 \
DC_TEST_OPENCODE_V1=/path/to/opencode-v1 npm test
npm run build:python
npm packThe integration tests use temporary HOME/XDG directories and a loopback gateway,
with test credentials only. Set DC_TEST_TMP to choose the scratch directory.
The Python bundle is generated from index.js with esbuild; rebuild it whenever
the canonical CLI changes. Build the wheel with python -m build packages/python
from the repository root. Review and publish the npm and Python artifacts through
the respective release accounts after tests pass; builds do not publish them.
The compatibility suite also deletes its disposable config, credentials, state and cache between successful setup runs, verifies setup is missing, and repeats setup for both versions. It never deletes your real OpenCode configuration. For a release, rerun this suite through each installed package console command using DC_TEST_LAUNCHER=/absolute/path/to/dcorner.
