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

# Introduction

> Cargo is a framework for GTM. Define your entire workspace — connectors, models, tools, agents, and plays — as TypeScript files and deploy it with one command.

Cargo helps revenue teams automate their go-to-market motions with AI: enrich and score records, research accounts, run outbound, and keep the CRM clean.

You build all of it **as code**. A Cargo workspace is a folder of TypeScript files — one `define*` call per resource. The CLI (`cargo-ai`) deploys that folder declaratively, so your connectors, data models, tools, agents, and plays are versioned, diffable, and reproducible.

```bash theme={null}
npm install -g @cargo-ai/cli
cargo-ai login --token <your-api-token>
cargo-ai cdk init my-workspace
cd my-workspace && cargo-ai cdk deploy
```

## A workspace at a glance

Each resource type has a home. The `full` starter template lays out the whole surface:

```text theme={null}
my-workspace/
├── package.json
├── cargo.state.json          # created on first deploy — commit it
├── connectors/
│   ├── hubspot.ts            # defineConnector
│   └── openai.ts
├── models/
│   └── contacts.ts           # defineModel — a table sourced from a connector
├── tools/
│   └── enrich.ts             # defineWorkflow + defineTool
├── agents/
│   ├── enricher.ts           # defineAgent (sub-agent)
│   └── sdr.ts                # defineAgent (main agent)
├── plays/
│   └── onboarding.ts         # definePlay — runs a workflow as rows change
├── mcp/
│   └── crm.ts                # defineMcpServer
├── context/                  # defineContext — GTM knowledge base
├── files/                    # defineFile
├── folders/                  # defineFolder
├── workers/                  # defineWorker (hosted edge handlers)
└── apps/                     # defineApp (hosted Vite SPAs)
```

You can understand most Cargo projects by reading that tree.

## The files are the interface

Importing a `.ts` file **is** registration. There is no central manifest to keep in sync: each `define*` call registers a resource as a side effect, and you wire resources together by passing one resource's handle into another.

```ts tools/enrich.ts theme={null}
import { defineTool, defineWorkflow } from "@cargo-ai/cdk";
import { z } from "zod";
import { enricher } from "../agents/enricher";

const enrichFlow = defineWorkflow(
  "enrich-contact",
  {
    input: z.object({ email: z.string() }),
    output: z.object({ company: z.string() }),
    uses: { enricher },
  },
  ({ input, uses }) => ({
    // An agent call resolves to `{ answer, evaluation? }` — read `.answer`.
    company: uses.enricher({ prompt: `Which company owns ${input.email}?` }).answer,
  }),
);

export const enrich = defineTool("enrich", { workflow: enrichFlow });
```

Passing the `enricher` handle into `uses` is what creates the dependency edge — the dependency graph is just your variable graph. Cargo deploys the agent first and injects its real uuid into the tool.

## Deploy declaratively

The CLI reconciles your code against the live workspace. `plan` is offline; `deploy` creates or updates only what changed and records the result in `cargo.state.json`.

```bash theme={null}
cargo-ai cdk plan     # offline diff against cargo.state.json
cargo-ai cdk deploy   # create/update; write state
```

Re-deploying with no changes is a no-op. Change one resource and only it updates.

## What to read next

<CardGroup cols={2}>
  <Card title="Quickstart" icon="rocket" href="/get-started/quickstart">
    Install, authenticate, and deploy your first tool in a few minutes.
  </Card>

  <Card title="Project layout" icon="folder-tree" href="/get-started/project-layout">
    The folder-per-resource convention, the loader, and state hygiene.
  </Card>

  <Card title="Connectors" icon="plug" href="/connectors/overview">
    `defineConnector` — link CRMs, warehouses, enrichment, and AI providers.
  </Card>

  <Card title="Workflows" icon="diagram-project" href="/workflows/overview">
    `defineWorkflow` — the TypeScript DSL that backs tools and plays.
  </Card>

  <Card title="Agents" icon="robot" href="/agents/overview">
    `defineAgent` — LLM workers with tools, models, and sub-agents.
  </Card>

  <Card title="CLI" icon="terminal" href="/cli/overview">
    Day-to-day operations: run tools, trigger plays, query data.
  </Card>
</CardGroup>

## Prefer the visual builder?

Every resource can also be built in the Cargo web app, and code-first and UI-built resources run identically. The Models, Tools, Agents, and Plays sections each have a **Using the UI** page, and you can jump into the app any time at [app.getcargo.io](https://app.getcargo.io).
