physicscode is an open source agentic AI coding environment for physics-focused software, simulations, analysis, and research engineering, built by PAI Dynamics.
Install dependencies from the repository root:
bun installRun the CLI/TUI locally:
bun run devRun the desktop app locally (Tauri, the primary desktop shell):
bun run dev:desktopThis requires the Rust toolchain and platform Tauri prerequisites — see packages/desktop/README.md and the Tauri prerequisites guide.
Build the downloadable desktop app:
cd packages/desktop
bun run tauri buildPackaged desktop artifacts are written under
packages/desktop/src-tauri/target/release/bundle/ (per-platform
subdirectories, e.g. dmg/, deb/, rpm/, nsis/).
An Electron build of the same UI also exists in packages/desktop-electron
(bun run dev:desktop:electron) but is being phased out in favor of Tauri —
see that package's README for status.
Build the CLI executable:
cd packages/physicscode
bun run buildThe build outputs platform-specific executables under
packages/physicscode/dist/. Those binaries are the artifacts to publish for
users who want to download and run physicscode directly.
physicscode doesn't ship with any API keys — you connect your own. It supports 75+ providers (Anthropic, OpenAI, Google, Azure, Bedrock, local models, and more) via Models.dev.
Interactive (recommended): run physicscode, then inside the TUI run:
/connect
Pick a provider and paste your API key. It's written to
~/.local/share/physicscode/auth.json on your machine — this file is never
part of the repo and should never be committed anywhere.
Environment variables: each provider also reads its standard env var, e.g.
export ANTHROPIC_API_KEY=sk-ant-...
export OPENAI_API_KEY=sk-...Config file: provider behavior (base URL, proxies, model allowlists) can
be set in physicscode.json — but never put a live API key in this file:
{
"provider": {
"anthropic": {
"options": { "baseURL": "https://api.anthropic.com/v1" }
}
}
}Full reference: Providers docs.
physicscode-science (provenance-aware retrieval for scientific software) is
already wired into physicscode itself once you're logged in — no setup
needed. To use it from Claude Code or Codex instead — on this machine or
any other — see
physicscode-science/docs/mcp-clients.md
for the exact claude mcp add / codex mcp add commands, covering both the
hosted endpoint (works from any machine with a PhysicsCode API key) and
running your own local index.
The VS Code extension lives in sdks/vscode. Before publishing a new extension
build, bump the version field in sdks/vscode/package.json; the Visual Studio
Marketplace rejects uploads that reuse an existing version.
Build the VSIX:
cd sdks/vscode
bunx @vscode/vsce package --no-dependencies -o dist/physicscode.vsixPublish to the Visual Studio Marketplace:
bunx @vscode/vsce publish --packagePath dist/physicscode.vsixThe extension publisher id is paidynamicsch, so the Marketplace extension id
is paidynamicsch.physicscode. If publishing from a new machine, first run
bunx @vscode/vsce login paidynamicsch and provide a Personal Access Token with
Marketplace > Manage permission.
PhysicsCode started as a fork of OpenCode and has since diverged
significantly for physics-focused workflows. Notices for OpenCode and other
third-party materials are preserved in Licenses.
