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

> ## Agent Instructions
> These docs describe the Ancha CLI, npm package @ancha-labs/cli version 0.1.4, and the hosted workspace at app.ancha.io. Coding agents should start at https://docs.ancha.io/coding-agents. Run the CLI as `ancha` after `npm install -g @ancha-labs/cli`, or as `npx -y @ancha-labs/cli@0.1.4` without installing. Pass --json for machine-readable output, or set ANCHA_JSON=1. Every command ends with a `next:` line naming the next command. Exit codes: 0 pass, 1 a check failed or a comparison regressed, 2 usage, config or authentication error, 3 infrastructure error, 4 unimplemented endpoint with --strict.

# ancha connect

> Print the environment variables Ancha sets for a tool and an SDK snippet that points the official client at the replica. Makes no calls and installs nothing.

`ancha connect` prints how to point your agent's client for a tool at its replica: the variables Ancha sets and a short snippet using the official SDK or `fetch`.

```bash theme={null}
ancha connect [options] <twin>
```

| Argument | Description |
| - | - |
| `twin` | Tool name; see ancha twins list |

| Option | Description |
| - | - |
| `--lang <language>` | Ts or py (default: detected language, else ts) |

The language defaults to Python when `ancha init`'s detection finds a Python project, otherwise TypeScript.

## Example

```bash theme={null}
ancha connect slack --lang ts
```

```text Output theme={null}
Ancha supplies SLACK_API_URL, SLACK_BOT_TOKEN, SLACK_SIGNING_SECRET, SLACK_APP_TOKEN for the selected sandbox or trial.

import { WebClient } from '@slack/web-api';
const slack = new WebClient(process.env.SLACK_BOT_TOKEN, { slackApiUrl: process.env.SLACK_API_URL });
await slack.conversations.list();
```

`--json` prints `{"twin", "language", "env", "snippet"}`.

## Supported snippets

Every tool has a `--lang ts` snippet. Three also have a `--lang py` snippet.

| Tool | `--lang ts` | `--lang py` |
| - | - | - |
| `slack` | `@slack/web-api` | `slack_sdk` |
| `github` | `@octokit/rest` | PyGithub |
| `google-ads` | `fetch` (REST) | `google-ads` client over gRPC |
| `datadog` | `@datadog/datadog-api-client` | No |
| `pagerduty` | `@pagerduty/pdjs` | No |
| `gmail`, `google-drive` | `@googleapis/gmail`, `@googleapis/drive` | No |
| `amazon-s3` | `@aws-sdk/client-s3` | No |
| `linear` | `@linear/sdk` | No |
| `okta` | `@okta/okta-sdk-nodejs` | No |
| `stripe` | `stripe` with a custom fetch client | No |
| `clerk` | `@clerk/backend` | No |
| `notion` | `@notionhq/client` | No |
| `dropbox` | `dropbox` with a custom fetch | No |
| `resend` | `resend` | No |
| `microsoft-word` | `@microsoft/microsoft-graph-client` | No |
| `shopify` | `@shopify/admin-api-client` with a custom fetch | No |
| `lob` | `@lob/lob-typescript-sdk` | No |
| `paypal` | `@paypal/paypal-server-sdk` with an adapter | No |
| `kalshi` | `kalshi-typescript` | No |
| `hubspot`, `salesforce`, `gong`, `ga4`, `linkedin-ads`, `chatgpt-ads`, `open-meteo`, `better-stack`, `attio`, `jira` | `fetch` | No |

A combination without a snippet exits `2`:

```text Output theme={null}
error[USAGE]: py datadog client setup is not supported by this kit
hint: use --lang ts for the verified native client settings
docs: ancha docs integrations
```

Each tool page shows its snippet and the variables. See [Tools](https://docs.ancha.io/tools/overview.md).

## Exit codes

`0`. `2` for an unknown tool or an unsupported language.


## Related topics

- [Datadog](https://docs.ancha.io/tools/datadog.md)
- [PagerDuty](https://docs.ancha.io/tools/pagerduty.md)
- [Tools](https://docs.ancha.io/tools/overview.md)
- [Attio](https://docs.ancha.io/tools/attio.md)
- [Clerk](https://docs.ancha.io/tools/clerk.md)


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.