> For the complete documentation index, see [llms.txt](/llms.txt).
> A full single-fetch corpus is available at [llms-full.txt](/llms-full.txt).
---
last_verified: 2026-10-09
title: Getting started
description: Create a TypeScript AGNT5 project, run it locally with agnt5 dev, and deploy it
category: SDK
hideRightSidebar: true
---

This page takes you from an empty directory to a running TypeScript workflow. You need Node.js 22 or later and the [AGNT5 CLI](/docs/install-cli.md), signed in with `agnt5 auth login`.

## Create a project

```bash
agnt5 create my-agent --language typescript
cd my-agent
npm install
```

`agnt5 create` scaffolds the TypeScript quickstart, a workflow that summarizes the top Hacker News stories, and links the directory to a new AGNT5 project. The project contains:

| File | Contents |
|---|---|
| `app.ts` | The worker entry point |
| `src/functions.ts` | The functions the workflow runs as steps |
| `src/workflows.ts` | The `digest` workflow |
| `agnt5.yaml` | The project manifest, including the command that starts the worker |
| `.env.example` | The environment variables the project reads |

## The worker

`app.ts` imports the modules that define components, then starts a worker. Importing a module registers the functions and workflows it defines:

```typescript
import { Worker } from '@agnt5/sdk';

import './src/functions.js';
import './src/workflows.js';

async function main() {
  const worker = new Worker('quickstart', {
    serviceVersion: '0.1.0',
    coordinatorEndpoint: process.env.AGNT5_COORDINATOR_ENDPOINT || 'http://localhost:34186',
  });
  await worker.run();
}

main().catch((error) => {
  console.error('Worker error:', error);
  process.exit(1);
});
```

`agnt5.yaml` tells the CLI how to start it:

```yaml
name: my-agent
language: typescript
worker:
  command: "npx tsx app.ts"
```

## Run it locally

Copy `.env.example` to `.env` and add your `OPENAI_API_KEY`; the workflow's summary step calls a model. Then start the worker:

```bash
agnt5 dev
```

In another terminal, list what the worker registered and run the workflow:

```bash
agnt5 components --dev
agnt5 run digest --type workflow --input '{"limit": 2}'
```

```json
{
  "count": 2,
  "digest": "# Hacker News digest\n\n1. **...**"
}
```

Open the `studio` link that `agnt5 dev` prints to see the run's trace: one step per story fetch and summary, then the final assembly. See [Local development](/docs/build/local-development.md) for hot reload, background mode, and the API.

## Deploy

```bash
agnt5 secrets set --name OPENAI_API_KEY --type api_key
agnt5 deploy
agnt5 run digest --type workflow --input '{"limit": 2}' --env preview
```

See [Deploying](/docs/run/deploying.md) for environments, promotion, and observing runs.

## Next steps

* [Functions](/docs/build/functions.md) and [Workflows](/docs/build/workflows.md): define your own steps and checkpoints.
* [Agents](/docs/build/agents.md): run a model with tools inside a workflow.
