---
title: Knock CLI
description: Use the Knock CLI as the local-first surface for AI coding agents to read and write Knock resources from your codebase.
section: AI
---

The [Knock CLI](/developer-tools/knock-cli) is the local-first AI agent surface for Knock. It's fast, lightweight, and leans on tooling already available in your code editor. Reach for the CLI when you're working in Cursor, Claude, or another IDE on a Knock-aware codebase and you want the agent to manage workflows, templates, and other resources alongside your application code.

## What an agent can do with the CLI

When the Knock CLI is installed and authenticated, an AI coding agent can use it to:

- Pull workflows, templates, email layouts, partials, guides, message types, goals, and reusable requests into your repo.
- Scaffold new resources locally, including new partials, guides, goals, and reusable requests.
- Edit resources as code, then validate them before pushing.
- Push changes back to Knock and commit them. If you've enabled [environments](/version-control/environments), promote them between environments.
- Wire Knock into your CI/CD pipeline.

The CLI exposes the full set of Knock resource operations. The [MCP server](/ai/mcp-server) exposes a curated subset focused on managing resources, manipulating data, and inspecting environments — it does not currently support local file scaffolding, local validation, or deletion. Use the CLI when you need any of those.

## Install the Knock CLI

Install the CLI with `npm`:

```bash title="Installing the Knock CLI"
npm install -g @knocklabs/cli
```

Then authenticate with `knock login`. See the [Knock CLI docs](/developer-tools/knock-cli) for full installation, authentication, and command reference.

## Pair with the `knock-cli` skill

The CLI gives an agent the tools to manage Knock resources. The [`knock-cli` skill](/ai/skills) gives the agent the procedural knowledge to use those tools well — which commands exist, when to reach for each one, and how to structure the resource files the CLI expects.

Install the skill alongside the CLI:

```bash title="Installing the knock-cli skill"
npx skills add knocklabs/skills --skill knock-cli
```

When you ask "add a comment-created workflow to this repo," the agent reads the skill, runs the right `knock` commands, and writes the resulting files into your project.

You can pair this setup with the [MCP server](/ai/mcp-server) when you also want the agent to perform live API operations against your Knock account from outside the IDE.

## See also

- [Knock AI overview](/ai/overview). See how the CLI fits alongside the dashboard agent, agent function, MCP server, and skills.
- [Knock CLI reference](/developer-tools/knock-cli). Full installation, authentication, and command reference.
- [Skills](/ai/skills). Procedural knowledge that complements the CLI and MCP server.
- [MCP server](/ai/mcp-server). Connect external clients and your own apps to Knock as tools.
