@director.run/cli 0.3.0 → 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +263 -111
- package/dist/cli.js +375 -477
- package/dist/studio/assets/claude-icon-CCYRFsZn.png +0 -0
- package/dist/studio/assets/code-icon-Da0Eua6W.png +0 -0
- package/dist/studio/assets/cursor-icon-DfqPZkLG.png +0 -0
- package/dist/studio/assets/index-CLEEd5Hk.js +149 -0
- package/dist/studio/assets/index-lfvkoXq-.css +1 -0
- package/dist/studio/index.html +2 -2
- package/package.json +15 -7
- package/dist/studio/assets/claude-icon-C3oFA7Zy.png +0 -0
- package/dist/studio/assets/code-icon-BlGhXKkY.png +0 -0
- package/dist/studio/assets/cursor-icon-BKdzddOD.png +0 -0
- package/dist/studio/assets/goose-icon-CLHAMlFc.png +0 -0
- package/dist/studio/assets/index-B0ZcfEDy.css +0 -1
- package/dist/studio/assets/index-EXqzvMfZ.js +0 -154
- package/dist/studio/assets/raycast-icon-CDiKLAih.png +0 -0
package/README.md
CHANGED
|
@@ -1,151 +1,303 @@
|
|
|
1
1
|
<h1 align="center">Director</h1>
|
|
2
|
-
<p align="center">
|
|
2
|
+
<p align="center">Playbooks for AI agents</p>
|
|
3
3
|
|
|
4
4
|
<p align="center"><code>curl -LsSf https://director.run/install.sh | sh</code></p>
|
|
5
5
|
|
|
6
6
|
---
|
|
7
7
|
|
|
8
|
-
|
|
8
|
+
<div align="center">
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
[](https://www.gnu.org/licenses/agpl-3.0)
|
|
11
|
+
[](https://github.com/director-run/director/actions/workflows/ci.yml)
|
|
12
|
+
[](https://github.com/director-run/director/actions/workflows/release.yml)
|
|
13
|
+
[](https://www.npmjs.com/package/@director.run/cli)
|
|
11
14
|
|
|
12
|
-
|
|
15
|
+
</div>
|
|
13
16
|
|
|
14
|
-
|
|
15
|
-
- [Node.js](https://nodejs.org/en/download) (tested on v23.7.0)
|
|
16
|
-
- [UV](https://docs.astral.sh/uv/getting-started/installation/) for many Stdio servers
|
|
17
|
-
- [Claude](https://claude.ai/download), [Cursor](https://www.cursor.com/downloads) or [VSCode](https://code.visualstudio.com/download) installed. (if you'd like director to configure them automatically).
|
|
17
|
+
# Overview
|
|
18
18
|
|
|
19
|
+
Director helps you provide **playbooks** to your AI Agents. Playbooks are set of tools, prompts and configuration, that enable a specific task (like [Claude Skills](https://www.anthropic.com/news/skills)) and can be used by any agent through a single, unified MCP endpoint.
|
|
19
20
|
|
|
20
|
-
|
|
21
|
+
Playbooks are portable, declarative YAML files that can easily be shared (or committed to version control). Director is local-first - installation and client integration takes 30 seconds. In addition, Director provides all of the MCP management functionality that you'd expect: tool filtering, logging, strong isolation, and unified OAuth.
|
|
21
22
|
|
|
22
|
-
|
|
23
|
+
<br />
|
|
24
|
+
<img src="https://github.com/director-run/director/blob/main/apps/docs/images/demo.gif" width="100%" alt="director demo">
|
|
23
25
|
|
|
24
|
-
|
|
25
|
-
curl -LsSf https://director.run/install.sh | sh
|
|
26
|
-
director quickstart
|
|
27
|
-
```
|
|
26
|
+
## Key Features
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
- 📚 **Playbooks** - Maintain sets of tools, prompts and config for different tasks or environments.
|
|
29
|
+
- 🚀 **1-Click Integration** - Switch playbooks with a single click. Currently supports Claude Code, Claude Desktop, Cursor, VSCode
|
|
30
|
+
- 🔗 **Shareable** - Playbooks are flat files which can be shared or committed to version control easily.
|
|
31
|
+
- 🏠 **Local-First** - Director is local-first, designed to easily run on your own machine or infrastructure.
|
|
32
|
+
- 🔑 **Unified OAuth** - Connect to OAuth MCPs centrally, and use them across all of your agents.
|
|
33
|
+
- 🎯 **Tool Filtering** - Select only the MCP tools that are required for the specific task, preserving context.
|
|
34
|
+
- 📋 **Declarative** - Like terraform for AI agents, Director will enforce playbook to client mapping on startup.
|
|
35
|
+
- 🔧 **Flexibility** - You can configure director through the UI, by editing the config file, through the CLI or even using the Typescript SDK.
|
|
36
|
+
- 📊 **Observability** - Centralised JSON logging, that allows you to understand exactly what your agent is doing.
|
|
37
|
+
- 🔌 **MCP Compliant** - Just works with any MCP server or client. Up to date with the latest MCP spec.
|
|
30
38
|
|
|
31
|
-
|
|
39
|
+
# Quickstart
|
|
32
40
|
|
|
33
41
|
```bash
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
42
|
+
# Install Director
|
|
43
|
+
$ curl -LsSf https://director.run/install.sh | sh
|
|
44
|
+
|
|
45
|
+
# Start the onboarding flow
|
|
46
|
+
$ director quickstart
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
# Core Concepts
|
|
50
|
+
|
|
51
|
+
## Playbooks
|
|
52
|
+
|
|
53
|
+
A playbook is a set of tools, prompts and configuration, used to provide specific capabilities to your agent. Under the hood, playbooks are built on top of the MCP tools & prompts primitives.
|
|
54
|
+
|
|
55
|
+
The easiest way to author a playbook is via the UI (`director studio`). But you can also use the CLI or write the config manually (see below). You can have many playbooks, typically one per task or per environment. Connecting them is one click in the UI (or one CLI command / config entry), connections are enforced on startup.
|
|
56
|
+
|
|
57
|
+
```yaml
|
|
58
|
+
#
|
|
59
|
+
# Client <> Playbook mappings (enforced on startup)
|
|
60
|
+
#
|
|
61
|
+
clients:
|
|
62
|
+
claude-code: [ production-support ]
|
|
63
|
+
cursor: [ production-support ]
|
|
64
|
+
|
|
65
|
+
#
|
|
66
|
+
# Playbooks
|
|
67
|
+
#
|
|
68
|
+
playbooks:
|
|
69
|
+
- id: production-support
|
|
70
|
+
name: Production Support
|
|
71
|
+
description: Investigate and resolve production issues
|
|
72
|
+
#
|
|
73
|
+
# MCP Servers / Tools
|
|
74
|
+
#
|
|
75
|
+
servers:
|
|
76
|
+
# Get alerts
|
|
77
|
+
- name: sentry
|
|
78
|
+
type: http
|
|
79
|
+
url: https://mcp.sentry.dev/mcp
|
|
80
|
+
|
|
81
|
+
# Read the logs
|
|
82
|
+
- name: cloudwatch
|
|
83
|
+
type: stdio
|
|
84
|
+
command: uvx
|
|
85
|
+
args: ["awslabs.cloudwatch-mcp-server@latest"]
|
|
86
|
+
env:
|
|
87
|
+
AWS_PROFILE: "[The AWS Profile Name to use for AWS access]",
|
|
88
|
+
include: [search_logs, get_metrics] # No write access
|
|
89
|
+
|
|
90
|
+
# Write back to the repository
|
|
91
|
+
- name: github
|
|
92
|
+
type: http
|
|
93
|
+
url: https://api.githubcopilot.com/mcp/
|
|
94
|
+
tools:
|
|
95
|
+
include: [ create_pr, search_code ]
|
|
96
|
+
#
|
|
97
|
+
# Prompts
|
|
98
|
+
#
|
|
99
|
+
prompts:
|
|
100
|
+
- name: investigate
|
|
101
|
+
content: |
|
|
102
|
+
Check recent alerts, correlate with deployment times,
|
|
103
|
+
search logs for errors, identify root cause
|
|
37
104
|
```
|
|
38
105
|
|
|
39
|
-
|
|
106
|
+
## Architechture
|
|
107
|
+
|
|
108
|
+
At a high level, Director is a service that sits between your agents and MCP servers. It's transparent to clients, requiring no additional tokens. It models playbooks, which can be thought of as standalone, portable skills that enhance your AI agent with new capabilities.
|
|
40
109
|
|
|
41
|
-
|
|
110
|
+
<img src="https://github.com/director-run/director/blob/main/apps/docs/images/director-highlevel-overview.webp" width="100%" alt="director demo">
|
|
42
111
|
|
|
112
|
+
# Usage
|
|
113
|
+
|
|
114
|
+
## Installation
|
|
43
115
|
```bash
|
|
44
|
-
#
|
|
45
|
-
|
|
46
|
-
docker run \
|
|
47
|
-
-d -p 8080:8080 \
|
|
48
|
-
-v ./data:/root/.director \
|
|
49
|
-
--name director \
|
|
50
|
-
barnaby/director:latest
|
|
51
|
-
|
|
52
|
-
# Tail the logs
|
|
53
|
-
docker logs -f director
|
|
54
|
-
|
|
55
|
-
# Interact with the gateway using the CLI, on the host machine
|
|
56
|
-
npm install -g @director.run/cli
|
|
57
|
-
GATEWAY_URL=http://localhost:8080 director create my-proxy
|
|
58
|
-
GATEWAY_URL=http://localhost:8080 director add my-proxy --entry fetch
|
|
59
|
-
```
|
|
116
|
+
# Install the director CLI + dependencies (node, npm & uvx) via the 1-liner:
|
|
117
|
+
$ curl -LsSf https://director.run/install.sh | sh
|
|
60
118
|
|
|
61
|
-
|
|
119
|
+
# Alternatively, install through npm:
|
|
120
|
+
$ npm install -g @director.run/cli
|
|
62
121
|
|
|
122
|
+
# Start director & open the UI
|
|
123
|
+
$ director quickstart
|
|
124
|
+
```
|
|
63
125
|
|
|
126
|
+
## The Studio (Web UI)
|
|
64
127
|
|
|
65
|
-
|
|
128
|
+
The simplest way to interact with director is via the admin interface:
|
|
66
129
|
|
|
67
130
|
```bash
|
|
68
|
-
|
|
131
|
+
# Open studio in your browser
|
|
132
|
+
$ director studio
|
|
133
|
+
```
|
|
69
134
|
|
|
70
|
-
|
|
71
|
-
| (_) | |
|
|
72
|
-
__| |_ _ __ ___ ___| |_ ___ _ __
|
|
73
|
-
/ _' | | '__/ _ \/ __| __/ _ \| '__|
|
|
74
|
-
| (_| | | | | __/ (__| || (_) | |
|
|
75
|
-
\__,_|_|_| \___|\___|\__\___/|_|
|
|
135
|
+
## CLI Reference
|
|
76
136
|
|
|
137
|
+
```bash
|
|
138
|
+
Playbooks for your AI agent
|
|
139
|
+
|
|
140
|
+
USAGE
|
|
141
|
+
director <command> [subcommand] [flags]
|
|
142
|
+
|
|
143
|
+
CORE COMMANDS
|
|
144
|
+
quickstart Start the gateway and open the studio in your browser
|
|
145
|
+
serve Start the web service
|
|
146
|
+
studio Open the UI in your browser
|
|
147
|
+
ls List playbooks
|
|
148
|
+
get <playbookId> [serverName] Show playbook details
|
|
149
|
+
auth <playbookId> <server> Authenticate a server
|
|
150
|
+
create <name> Create a new playbook
|
|
151
|
+
destroy <playbookId> Delete a playbook
|
|
152
|
+
connect <playbookId> [options] Connect a playbook to a MCP client
|
|
153
|
+
disconnect <playbookId> [options] Disconnect a playbook from an MCP client
|
|
154
|
+
add <playbookId> [options] Add a server to a playbook.
|
|
155
|
+
remove <playbookId> <serverName> Remove a server from a playbook
|
|
156
|
+
update <playbookId> [serverName] [options] Update playbook attributes
|
|
157
|
+
http2stdio <url> Proxy an HTTP connection (sse or streamable) to a stdio stream
|
|
158
|
+
env [options] Print environment variables
|
|
159
|
+
status Get the status of the director
|
|
160
|
+
|
|
161
|
+
REGISTRY
|
|
162
|
+
registry ls List all available servers in the registry
|
|
163
|
+
registry get <entryName> Get detailed information about a registry item
|
|
164
|
+
registry readme <entryName> Print the readme for a registry item
|
|
165
|
+
|
|
166
|
+
MCP
|
|
167
|
+
mcp list-tools <playbookId> List tools on a playbook
|
|
168
|
+
mcp get-tool <playbookId> <toolName> Get the details of a tool
|
|
169
|
+
mcp call-tool <playbookId> <toolName> [options] Call a tool on a playbook
|
|
170
|
+
|
|
171
|
+
PROMPTS
|
|
172
|
+
prompts ls <playbookId> List all prompts for a playbook
|
|
173
|
+
prompts add <playbookId> Add a new prompt to a playbook
|
|
174
|
+
prompts edit <playbookId> <promptName> Edit an existing prompt
|
|
175
|
+
prompts remove <playbookId> <promptName> Remove a prompt from a playbook
|
|
176
|
+
prompts get <playbookId> <promptName> Show the details of a specific prompt
|
|
177
|
+
|
|
178
|
+
FLAGS
|
|
179
|
+
-V, --version output the version number
|
|
180
|
+
|
|
181
|
+
EXAMPLES
|
|
182
|
+
$ director create my-playbook # Create a new playbook
|
|
183
|
+
$ director add my-playbook --entry fetch # Add a server to a playbook
|
|
184
|
+
$ director connect my-playbook --target claude # Connect my-playbook to claude
|
|
77
185
|
|
|
78
|
-
[18:16:21] INFO (Gateway): starting director gateway
|
|
79
|
-
[18:16:21] INFO (Gateway): director gateway running on port 3673
|
|
80
186
|
```
|
|
81
187
|
|
|
82
|
-
##
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
188
|
+
## Configuration File Reference
|
|
189
|
+
|
|
190
|
+
```yaml
|
|
191
|
+
#
|
|
192
|
+
# Server config
|
|
193
|
+
#
|
|
194
|
+
server:
|
|
195
|
+
port: 1234
|
|
196
|
+
|
|
197
|
+
#
|
|
198
|
+
# Client Connections
|
|
199
|
+
#
|
|
200
|
+
clients:
|
|
201
|
+
claude-code: [ code_review ] # connect claude code to the code_review playbook
|
|
202
|
+
|
|
203
|
+
#
|
|
204
|
+
# Playbooks
|
|
205
|
+
#
|
|
206
|
+
playbooks:
|
|
207
|
+
- name: code_review
|
|
208
|
+
description: Automates code reviews
|
|
209
|
+
servers:
|
|
210
|
+
- name: filesystem
|
|
211
|
+
type: stdio
|
|
212
|
+
command: npx
|
|
213
|
+
args: [ "@modelcontextprotocol/server-filesystem", "./src" ]
|
|
214
|
+
|
|
215
|
+
- name: github
|
|
216
|
+
type: http
|
|
217
|
+
url: https://api.githubcopilot.com/mcp/
|
|
218
|
+
tools:
|
|
219
|
+
# include only these tools
|
|
220
|
+
include: [ create_issue, search_code ]
|
|
221
|
+
|
|
222
|
+
# invoke with slash commands
|
|
223
|
+
prompts:
|
|
224
|
+
- name: code_review
|
|
225
|
+
content: "Review this code for security vulnerabilities and performance issues"
|
|
226
|
+
|
|
227
|
+
- name: write_tests
|
|
228
|
+
content: "Write comprehensive unit tests including edge cases"
|
|
86
229
|
```
|
|
87
230
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
231
|
+
### TypeScript SDK
|
|
232
|
+
|
|
233
|
+
Programmatic control for advanced use cases:
|
|
234
|
+
|
|
235
|
+
```typescript
|
|
236
|
+
import { Director } from '@director.run/sdk';
|
|
237
|
+
|
|
238
|
+
const director = new Director();
|
|
239
|
+
|
|
240
|
+
// Create playbook programmatically
|
|
241
|
+
const playbook = await director.playbooks.create({
|
|
242
|
+
name: 'ci-environment',
|
|
243
|
+
servers: [{
|
|
244
|
+
name: 'github',
|
|
245
|
+
command: 'mcp-server-github',
|
|
246
|
+
env: { GITHUB_TOKEN: process.env.GITHUB_TOKEN }
|
|
247
|
+
}]
|
|
248
|
+
});
|
|
249
|
+
|
|
250
|
+
// Execute tools
|
|
251
|
+
const result = await playbook.callTool('github.create_issue', {
|
|
252
|
+
title: 'Automated issue from CI',
|
|
253
|
+
body: 'This issue was created by Director'
|
|
254
|
+
});
|
|
94
255
|
```
|
|
95
256
|
|
|
96
|
-
|
|
257
|
+
# Repository Structure
|
|
258
|
+
|
|
259
|
+
### External Apps
|
|
260
|
+
|
|
261
|
+
- [`apps/cli`](./apps/cli/README.md) - The command-line interface, the primary way to interact with Director. Available on [npm](https://www.npmjs.com/package/@director.run/cli).
|
|
262
|
+
- [`apps/sdk`](./apps/sdk/README.md) - The Typescript SDK, available on [npm](https://www.npmjs.com/package/@director.run/sdk).
|
|
263
|
+
- [`apps/docker`](./apps/docker/README.md) - The Director docker image, which allows you to run Director (and all MCP servers) securly inside a container. Available on [Docker Hub](https://hub.docker.com/r/barnaby/director).
|
|
264
|
+
- [`apps/docs`](./apps/docs/README.md) - Project documentation hosted at [https://docs.director.run](https://docs.director.run)
|
|
265
|
+
- [`apps/registry`](./apps/registry/README.md) - Backend for the registry hosted at [https://registry.director.run](https://registry.director.run)
|
|
266
|
+
- [`apps/sandbox`](./apps/sandbox/README.md) - A tool for running Director (and all MCP servers) securely inside a VM. Apple Silicon only.
|
|
267
|
+
- [`apps/studio`](./apps/studio/README.md) - Director frontend application
|
|
268
|
+
|
|
269
|
+
### Internal Packages
|
|
270
|
+
|
|
271
|
+
- [`packages/client-configurator`](./packages/client-configurator/README.md) - Library for managing MCP client configuration files
|
|
272
|
+
- [`packages/gateway`](./packages/gateway/README.md) - Core gateway and playbook logic
|
|
273
|
+
- [`packages/mcp`](./packages/mcp/README.md) - Extensions to MCP SDK that add middleware functionality
|
|
274
|
+
- [`packages/utilities`](./packages/utilities/README.md) - Shared utilities used across all packages and apps
|
|
275
|
+
- [`packages/design`](./packages/design/README.md) - Design system: reusable UI components, hooks, and styles for all Director apps
|
|
276
|
+
|
|
277
|
+
*This is a monorepo managed by [Turborepo](https://turbo.build/).*
|
|
278
|
+
|
|
279
|
+
# Community
|
|
280
|
+
|
|
281
|
+
If you're using director, have any ideas, or just want to chat about MCP, we'd love to chat:
|
|
282
|
+
- 💬 Join our [Discord](https://discord.gg/kWZGvWks)
|
|
283
|
+
- 📧 Send us an [Email](mailto:hello@director.run)
|
|
284
|
+
- 🐛 Report a [Bug](https://github.com/director-run/director/issues)
|
|
285
|
+
- 🐦 Follow us on [X / Twitter](https://x.com/barnabymalet)
|
|
286
|
+
|
|
287
|
+
# Contributing
|
|
288
|
+
|
|
289
|
+
We welcome contributions! See [CONTRIBUTING.mdx](./apps/docs/project/contributing.mdx) for guidelines.
|
|
290
|
+
|
|
291
|
+
## Setting up Development Environment
|
|
292
|
+
|
|
97
293
|
```bash
|
|
98
|
-
#
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
[18:19:06] INFO (client-configurator/claude): restarting claude
|
|
104
|
-
[18:19:06] INFO (restartApp): restarting Claude...
|
|
105
|
-
[18:19:08] INFO (restartApp): Claude has been restarted
|
|
106
|
-
undefined
|
|
107
|
-
|
|
108
|
-
# print the manual connection details
|
|
109
|
-
$ director connect my-first-proxy
|
|
110
|
-
|
|
111
|
-
--------------------------------
|
|
112
|
-
Connection Details for 'my-first-proxy'
|
|
113
|
-
--------------------------------
|
|
114
|
-
|
|
115
|
-
Note: if you'd like to connect to a client automatically, run:
|
|
116
|
-
director connect my-first-proxy --target <target>
|
|
117
|
-
|
|
118
|
-
HTTP Streamable: http://localhost:3673/my-first-proxy/mcp
|
|
119
|
-
HTTP SSE: http://localhost:3673/my-first-proxy/sse
|
|
120
|
-
Stdio: {
|
|
121
|
-
"command": "npx",
|
|
122
|
-
"args": [
|
|
123
|
-
"-y",
|
|
124
|
-
"@director.run/cli",
|
|
125
|
-
"http2stdio",
|
|
126
|
-
"http://localhost:3673/my-first-proxy/mcp"
|
|
127
|
-
],
|
|
128
|
-
"env": {
|
|
129
|
-
"LOG_LEVEL": "silent"
|
|
130
|
-
}
|
|
131
|
-
}
|
|
294
|
+
# Fork and clone
|
|
295
|
+
git clone https://github.com/director_run/director
|
|
296
|
+
cd director
|
|
297
|
+
./scripts/setup-development.sh
|
|
298
|
+
bun run test
|
|
132
299
|
```
|
|
133
300
|
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
$ director ls
|
|
138
|
-
┌────────────────┬────────────────┬──────────────────────────────────────────┐
|
|
139
|
-
│ id │ name │ path │
|
|
140
|
-
│ my-first-proxy │ my-first-proxy │ http://localhost:3673/my-first-proxy/mcp │
|
|
141
|
-
└────────────────┴────────────────┴──────────────────────────────────────────┘
|
|
142
|
-
|
|
143
|
-
# get the details of a single proxy
|
|
144
|
-
$ director get my-first-proxy
|
|
145
|
-
id=my-first-proxy
|
|
146
|
-
name=my-first-proxy
|
|
147
|
-
┌───────┬───────────┬──────────────────────┐
|
|
148
|
-
│ name │ transport │ url/command │
|
|
149
|
-
│ fetch │ stdio │ uvx mcp-server-fetch │
|
|
150
|
-
└───────┴───────────┴──────────────────────┘
|
|
151
|
-
```
|
|
301
|
+
# License
|
|
302
|
+
|
|
303
|
+
AGPL v3 - See [LICENSE](./LICENSE) for details.
|