Skip to main content

About

The Auggie TypeScript SDK provides a programmatic interface to Auggie for building custom integrations and agents in Node.js and TypeScript applications. The SDK offers two main interfaces:
  1. Agent Interaction (ACP) - Launch and communicate with a local Auggie agent process
  2. AI SDK Provider - Use Augment as a language model provider with Vercel’s AI SDK (API-only, no local installation required)

Installation

Agent Interaction (ACP)

⚠️ Requires Local Auggie Installation The Agent Interaction interface allows you to launch Auggie in ACP mode and communicate bidirectionally. This requires a local Auggie installation.

Usage

Basic Initialization

Full Configuration

Advanced CLI Arguments

The cliArgs option allows you to pass additional command-line arguments directly to the Auggie CLI process. These arguments are appended after all SDK-generated flags, allowing you to use advanced configurations or experimental flags not exposed through standard SDK options.
Note: Since cliArgs are appended after SDK-generated flags, they can override default values when the CLI uses a last-value-wins strategy. Refer to auggie --help for available CLI flags.

Output Modes

The TypeScript SDK supports multiple output modes to fit different use cases:

String Response (Default)

By default, the SDK returns the complete agent response as a string:

Answer-Only Mode

Get only the final answer after all tool calls complete, excluding intermediate reasoning:

Streaming Mode

Listen to real-time updates as the agent processes your request:

Custom Tools

The TypeScript SDK supports ai-sdk compatible tools, allowing you to extend Auggie with custom functionality. You can provide tools that the agent can call during execution.

Creating a Custom Tool

Here’s an example of a custom weather tool:

Key Points

  • ai-sdk Compatible: Tools follow the Vercel AI SDK tool format
  • Zod Schemas: Use Zod for input validation and type safety
  • Automatic Discovery: The agent automatically discovers and uses available tools when relevant
  • Multiple Tools: Pass multiple tools in the tools object

Tool Structure

Each tool requires:
  • name - Unique identifier for the tool
  • description - Clear description of what the tool does (helps the agent decide when to use it)
  • inputSchema - Zod schema defining the tool’s input parameters
  • execute - Function that implements the tool’s logic

AI SDK Provider (Vercel AI SDK)

✅ No Local Auggie Required - API Only The AI SDK Provider allows you to use Augment as a language model provider with Vercel’s AI SDK. This interface only requires API credentials and works without a local Auggie installation.

Features

  • Compatible with generateText, streamText, and other AI SDK functions
  • Full support for tool calling (function calling) with automatic execution
  • Multi-turn conversations with context retention
  • Streaming responses for real-time output
  • Works with API credentials only (no local Auggie installation needed)

Quick Start

Streaming Responses

Tool Calling

Multi-turn Conversations

Authentication

The AI SDK Provider uses the same authentication methods as the rest of the SDK:
  1. Session File (Recommended) - Use credentials from ~/.augment/session.json (created by auggie login)
  2. Environment Variable - Set AUGMENT_SESSION_AUTH to the session JSON from auggie token print
  3. Direct Credentials - Pass credentials directly to AugmentLanguageModel