> ## Documentation Index
> Fetch the complete documentation index at: https://developers.telnyx.com/llms.txt
> Use this file to discover all available pages before exploring further.

# export

```bash theme={null}
telnyx-acp export support-agent
```

```text theme={null}
✓ support-agent is now code kind
  wrote package.json, src/agent.ts: SupportAgent is the managed loop bound to this agent, yours to change
  instructions.md is inlined in the class; agent.json no longer reads it (delete it when ready)
  next: `telnyx-acp dev` or `telnyx-acp deploy` — nothing changes until you edit the class
  (package.json pins @telnyx/acp <version>; deploy bundles it from this CLI, so npm install is for your own dependencies)
```

Export refuses a project that is already code-based and never overwrites existing files.

## What Export Writes

`src/agent.ts`, with the file's header comment omitted:

```ts theme={null}
import { defineManagedAgent } from "@telnyx/acp/managed";

/** What the loop runs on. Edit the instructions here; agent.json no longer reads instructions.md. */
const spec = {
  "name": "support-agent",
  "model": "zai-org/GLM-5.3-Flash",
  "instructions": "You are the phone assistant for Acme Plumbing. …",
  "memory": {
    "type": "agent_memory",
    "namespace": "default",
    "profile": "{{conversation}}"
  }
} as const;

export class SupportAgent extends defineManagedAgent(spec) {
  // Override what you need. For example, where a reply goes out (ReplyVia is
  // exported by "@telnyx/acp/managed": `import type { ReplyVia } from "@telnyx/acp/managed";`):
  //
  //   protected override async deliver(text: string, via: ReplyVia): Promise<void> {
  //     await super.deliver(text, via);
  //   }
  //
  // To hand the loop tools or an approvals policy, extend ManagedAgent from
  // "@telnyx/acp/managed" instead and pass a host to super(ctx, env, spec, host).
}
```

`package.json` pins `@telnyx/acp` and `@telnyx/edge-runtime`. `agent.json` flips to `"kind": "code"` with `"entry": "src/agent.ts"`; its `phone`, `email`, `web`, `channels`, `secrets` and `deployed` keep working as before, and the `instructions` key is removed (the file stays until you delete it).

The spec in the class carries `name`, `model`, `instructions`, `tools`, `limits`, `approvals` and `memory`. A project that answers calls, with a phone number or a Call Control or TeXML application among its channels, gets `defineManagedVoiceAgent(spec)` as the base, with the `voice` block in the spec when `agent.json` has one, so the exported class answers calls as before.

## Then

* `npm install` for the project's own dependencies.
* `telnyx-acp dev` now runs the local actor stack in Docker; `telnyx-acp deploy` ships the class. Both keep reading `agent.json` for numbers, channels and secrets.
* [Extending the agent](/docs/agent-sdk/extending) is what to do with the class.

> [!WARNING]
>
> **Beta.** `deploy` bundles the CLI's own managed packages. See [Beta Limitations](/docs/agents/deploy-and-operate#beta-limitations).
