Skip to main content
Getting Started

Overview

Qoder Agent SDK lets a TypeScript or Python application run Qoder as a coding agent. Instead of returning only generated text, the agent can inspect a project, use approved tools, edit files, run commands, and report a structured result. The SDK is suitable for adding agentic coding capabilities to a script, service, CI job, developer tool, or internal workflow without automating an interactive terminal.

SDK and qodercli responsibilities

The SDK is the application-facing API. qodercli 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
              qodercli
                 |
                 +-- Qoder model service
                 +-- files, commands, MCP tools, and subagents
Published SDK packages include a compatible qodercli runtime for supported platforms, so normal installations do not require a separate CLI setup. Applications can also point the SDK to a specific qodercli executable when the runtime is managed separately. 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@qoder-ai/qoder-agent-sdkqoder-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 @qoder-ai/qoder-agent-sdk
See Quick Start for complete, runnable examples in both languages.

Programming model

A typical integration has four parts:
  1. Describe the task. Send a prompt and set the working directory, model, system prompt, and turn limits as needed.
  2. Set boundaries. Select allowed tools and a permission mode, or provide a callback for decisions that need application approval.
  3. Consume the message stream. Handle assistant content, tool activity, progress events, and the final result message.
  4. Control the session when needed. Long-lived integrations can send follow-up messages, interrupt work, change selected runtime settings, or query session state.
For a one-off task, use query() with a string prompt. For a conversation in which the next input depends on earlier output, use the language-specific multi-turn form shown in Input Modes.

Configurable capabilities

AreaApplication capability
Input and outputOne-off or multi-turn 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, models, skills, plugins, reusable agent definitions, and subagents
Safety and controlTool allowlists, permission modes, approval callbacks, hooks, interruption, and turn limits
Session managementWorking directory, persistent sessions, resume, checkpoints, usage, and context information
The SDK References page maps common concepts to each language's API.

Execution boundaries

An agent can make real changes. Its working directory, tools, credentials, and permission policy are part of the application's security boundary.
  • The SDK-to-qodercli channel is local by default, but qodercli communicates with the Qoder model service. Prompts and the context needed for inference can be sent to that service.
  • File writes and commands run in the environment where qodercli is started. Set cwd deliberately and use Permissions to limit actions.
  • The model does not access files or run commands directly. It requests tool calls, and qodercli validates and executes them under the configured policy.
  • Permission-bypass modes are intended only for environments with an appropriate external isolation boundary.

Next steps