Skip to main content
Getting Started

Overview

Qoder Agent SDK is officially open, letting you build production-grade agents quickly.

Qoder Agent SDK opens the Harness behind the Qoder product family in SDK form. Task planning, tool invocation, context and session management, permission control, and long- and short-term memory — this whole runtime is now embeddable directly in a TypeScript or Python application.

What you can build

Qoder Agent SDK provides a mature agent runtime and flexible integration points. Through SDK integration you can wire your own tools, internal data, and business systems into an agent's execution path, and get a production-grade agent that completes tasks end to end inside your own product.
Agent shapeTypical use
Coding agentEmbedded in an IDE or an in-house dev tool: the agent reads the whole repository, then writes code, fixes bugs, and runs tests while developers review the result
Terminal agentDiagnosing production incidents on a server, bulk-editing configuration, running ops scripts, with dangerous commands escalated for human approval
Workplace agentPulling data from several internal systems to compile weekly reports, clean up spreadsheets, and produce documents from company templates, delivered as ready-to-use files
Pipeline integrationFixing failing tests, completing documentation, and reviewing every commit inside CI, running read-only and exiting when done
Vertical agentA domain assistant for finance, healthcare, and similar fields, connected to industry systems and proprietary data, working inside a compliance boundary

Qoder Agent SDK and QoderCN CLI responsibilities

Qoder Agent SDK is the application-facing API. QoderCN CLI is the agent runtime that plans the task, communicates with the model, and executes tools in the target environment.
TypeScript or Python application
                 |
                 |  Qoder Agent SDK
                 |  prompts, options, events, controls
                 v
             qoderclicn
                 |
                 +-- Qoder model service
                 +-- files, commands, MCP tools, and subagents
Published Qoder Agent SDK packages include a compatible QoderCN CLI runtime, so a separate QoderCN CLI setup is normally not required. If you manage the runtime yourself, you can point to a specific qoderclicn executable. For the detailed startup, communication, and agent loop, see How it works.

Choose an SDK

Use the same language as the application hosting the agent.
TypeScriptPython
Package@qodercn-ai/qodercn-agent-sdkqodercn-agent-sdk
Runtime requirementNode.js 18+Python 3.10+
One-off tasksquery()query()
Multi-turn sessionsAsync message input to query()QoderSDKClient
OutputAsync stream of typed messagesAsync stream of typed message objects
npm install @qodercn-ai/qodercn-agent-sdk
See Quick Start for complete, runnable examples in both languages.

Integration flow

A typical integration has four parts:
  1. Describe the task. Send a prompt, and set the working directory, model, system prompt, and turn limit as needed.
  2. Set boundaries. Pick the allowed tools and permission mode; for actions that need application-side approval, hand the decision back through a callback.
  3. Consume the message stream. Handle model replies, tool activity, progress events, and the final result message.
  4. Control the session when needed. Long-lived integrations can send follow-up messages, interrupt the run, adjust selected runtime settings, or query session state.
For a one-off task, pass a string prompt to query(). When the next input depends on the previous output, use the language-specific multi-turn form in Multi-turn Conversation.

Configurable capabilities

Capability areaWhat it covers
Input and outputOne-off or multi-turn input, image input, structured messages, and partial streaming events
ToolsBuilt-in file and command tools, custom tools, and external or in-process MCP servers
Agent behaviorSystem prompts and output styles, models, skills, plugins, reusable agent definitions, and subagents
Safety and controlTool allowlists, permission modes, approval callbacks, hooks, interruption, and turn limits
Code securityStatic checks on the agent's own edits, plus lightweight and deep repository scans
MemoryNative user and project memory, or application-owned generation and consumption (TypeScript only)
Session managementWorking directory, persistent sessions, resume and fork, checkpoints, external session storage, usage, and context information
Task executionBackground tasks, task listing and cancellation, and per-task interruption
ConfigurationInline settings, filesystem setting sources, and resolved-settings inspection
The SDK References page maps concepts across languages. A few capabilities exist in only one language; they are marked inline and listed together in Language differences.

Execution boundaries

An agent produces real changes to its environment. Its working directory, tools, credentials, and permission policy are part of the application's security boundary.
  • The SDK-to-QoderCN CLI channel is local by default, but QoderCN CLI talks to the Qoder model service; prompts and the context needed for inference are sent there.
  • File writes and commands run in the environment where QoderCN CLI is running. Set cwd explicitly, and tighten what can execute with Permissions.
  • The model does not read or write files or run commands directly. It only requests tool calls, which QoderCN CLI validates and executes under the configured policy.
  • Permission-bypass modes are only appropriate in environments that already provide an external isolation boundary.

Next steps

  • Quick Start — install, authenticate, and run your first task
  • How it works — understand the SDK communication channel and the QoderCN CLI agent loop
  • Permissions — tighten tool access and approvals
  • SDK References — look up TypeScript and Python APIs