Skip to main content
Qoder Agent SDK lets you call Qoder AI capabilities from TypeScript — read/write files, search code, execute commands, and more — embedding an AI Agent into your application or script with just a few lines of code.

Prerequisites

  • Node.js 18+

Install

Authentication

The SDK authenticates via a Personal Access Token (PAT), ideal for scripts, CI pipelines, and third-party integration scenarios. Generate a PAT at qoder.com/account/integrations (copy it immediately — the value cannot be retrieved again after the page is closed). For full steps, custom environment variables, and reusing local qodercli credentials, see SDK Authentication. Once you have a PAT, set the environment variable first:
Then configure authentication using accessTokenFromEnv():
The SDK reads this environment variable before starting qodercli and writes the parsed access token into a one-time auth payload. You typically don’t need to pass the PAT via the env option; if options.env is explicitly provided, the SDK reads the same-named variable from it first.
Security Note: Do not hard-code PATs in your code repository. Inject them via environment variables or a secrets management service.

Example

Create agent.mjs:
The Agent will autonomously browse the project, find functions lacking test coverage, generate test files, and run them for verification.

Next Steps