packages/core Shared, host-independent code (@cortexkit/openai-auth-core, not published)
packages/opencode OpenCode plugin (@cortexkit/opencode-openai-auth)
packages/pi Pi extension (@cortexkit/pi-openai-auth)
scripts Release and development tooling
STRUCTURE.md maps the files in more detail, and ARCHITECTURE.md describes how the pieces fit together.
Install dependencies:
bun installRun the checks (the build refuses dependencies that resolve outside the repository):
bun run typecheck
bun run test
bun run build
bun run lint
bun run format:checkInspect package contents before publishing:
The Node bundles keep jsonc-parser as a declared runtime dependency: its UMD entry uses relative require calls that Bun's bundler leaves unresolved when inlined. The packed-package tests check the external dependency allowlist and load the installed package with plain Node.
bun run pack:opencode:dry
bun run pack:pi:drybun run devThis builds the OpenCode plugin, symlinks the output into .opencode/plugins/, and starts tsc --watch. Restart OpenCode after starting the dev script and after rebuilds. Remove the local dev symlink with:
bun run dev:cleanTo inspect a cache cliff, a sudden drop in prompt-cache reuse between turns, enable request dumps and run:
bun run analyze:cache -- --session ses_... --no-timelineTo print previous and current request-body text around the first differing byte, add --wire-context with the number of surrounding bytes:
bun run analyze:cache -- --session ses_... --no-timeline --wire-context 180