Skip to content

Commit c677b33

Browse files
authored
Vendor the integrations CLI and serve the agent skill (#47)
* Serve integrations skill markdown * Skill teaches the CLI first * Vendor integrations CLI * Rename npm package to integrations * Credit Zachary Kirby for the package name * Point CLI repository field at renamed repo
1 parent 159d9ef commit c677b33

16 files changed

Lines changed: 1819 additions & 0 deletions

File tree

‎.github/workflows/cli.yml‎

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: CLI
2+
3+
on:
4+
pull_request:
5+
paths:
6+
- "cli/**"
7+
- ".github/workflows/cli.yml"
8+
push:
9+
branches:
10+
- main
11+
paths:
12+
- "cli/**"
13+
- ".github/workflows/cli.yml"
14+
15+
jobs:
16+
test:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout
20+
uses: actions/checkout@v4
21+
22+
- name: Setup Bun
23+
uses: oven-sh/setup-bun@v2
24+
25+
- name: Test CLI
26+
run: cd cli && bun install && bun run typecheck && bun run build && INTEGRATIONS_LIVE=0 bun test

‎.gitignore‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ dist/
66
.dev.vars
77
.wrangler/
88
.reference/
9+
cli/dist/
10+
cli/node_modules/
911
scripts/batch/scrape-cache/
1012
scripts/batch/kv-bulk.json
1113

‎cli/.gitignore‎

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
node_modules/
2+
dist/
3+
*.log
4+
.DS_Store
5+
.npmrc

‎cli/.npmrc‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
//registry.npmjs.org/:_authToken=${NPM_TOKEN}

‎cli/README.md‎

Lines changed: 127 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,127 @@
1+
# integrations
2+
3+
CLI for [integrations.sh](https://integrations.sh).
4+
5+
```sh
6+
npx integrations search stripe
7+
```
8+
9+
Install globally with `npm i -g integrations`; the command is `integrations`.
10+
11+
## Quickstart
12+
13+
```sh
14+
integrations search stripe
15+
integrations stripe.com
16+
integrations detect resend.com
17+
integrations help surface
18+
```
19+
20+
`search` accepts a service name. A bare domain such as `stripe.com` is treated
21+
as a surface lookup.
22+
23+
## Agent Output
24+
25+
For API-backed commands, stdout is human-readable only when attached to a TTY.
26+
When stdout is piped or `--json` is passed, stdout is exactly one JSON document.
27+
Diagnostics go to stderr. Errors in JSON mode print this shape to stdout and
28+
exit non-zero:
29+
30+
```json
31+
{"error":"unknown flag --example"}
32+
```
33+
34+
Examples:
35+
36+
```sh
37+
integrations search stripe | jq .
38+
integrations stripe.com --json
39+
```
40+
41+
`integrations skill` is the exception: it prints markdown by default so it can
42+
be redirected into an agent skill file. Use `integrations skill --json` for the
43+
structured form.
44+
45+
## Skill
46+
47+
Print the bundled integrations.sh agent skill:
48+
49+
```sh
50+
integrations skill
51+
integrations skill --json
52+
```
53+
54+
Install it for Claude-style skill loaders:
55+
56+
```sh
57+
mkdir -p ~/.claude/skills/integrations-sh
58+
integrations skill > ~/.claude/skills/integrations-sh/SKILL.md
59+
```
60+
61+
## MCP
62+
63+
Print connection details for the hosted public MCP server:
64+
65+
```sh
66+
integrations mcp
67+
integrations mcp --json
68+
```
69+
70+
Claude Code:
71+
72+
```sh
73+
claude mcp add --transport http integrations https://integrations.sh/mcp
74+
```
75+
76+
The JSON form is:
77+
78+
```json
79+
{"url":"https://integrations.sh/mcp","transport":"streamable-http","tools":["detect","discover"]}
80+
```
81+
82+
## Commands
83+
84+
The API command surface is derived from `https://integrations.sh/openapi.json`
85+
at runtime. Operation IDs become kebab-case commands, path parameters become
86+
positional arguments, query parameters become flags, and enum/boolean parameters
87+
are validated locally.
88+
89+
```sh
90+
integrations help
91+
integrations help search
92+
integrations help discover
93+
```
94+
95+
Current public operations include `search`, `detect`, `discover`, and `surface`.
96+
As the OpenAPI spec adds operations, the CLI picks them up without a release.
97+
98+
`discover` can take up to a minute and is rate-limited by the hosted API to 3
99+
requests per 60 seconds per IP.
100+
101+
## Base URL and Cache
102+
103+
Set `INTEGRATIONS_BASE` to target another compatible host:
104+
105+
```sh
106+
INTEGRATIONS_BASE=http://localhost:4321 integrations help
107+
```
108+
109+
The OpenAPI spec is cached in the system temp directory using the server TTL and
110+
ETag. Use `--no-cache` to bypass the cache for one invocation:
111+
112+
```sh
113+
integrations search stripe --no-cache
114+
```
115+
116+
## Build
117+
118+
```sh
119+
bun run typecheck
120+
bun run build
121+
bun test
122+
```
123+
124+
## Credits
125+
126+
Thanks to [Zachary Kirby](https://www.zkirby.com/) for the `integrations`
127+
package name on npm.

‎cli/bun.lock‎

Lines changed: 20 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

‎cli/package.json‎

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
{
2+
"name": "integrations",
3+
"version": "0.0.1-beta.3",
4+
"description": "CLI for integrations.sh — search the registry of agent integrations and read a domain's surface.",
5+
"type": "module",
6+
"bin": {
7+
"integrations": "dist/cli.js"
8+
},
9+
"repository": {
10+
"type": "git",
11+
"url": "git+https://github.com/UsefulSoftwareCo/integrations.git",
12+
"directory": "cli"
13+
},
14+
"files": [
15+
"dist"
16+
],
17+
"engines": {
18+
"node": ">=18"
19+
},
20+
"scripts": {
21+
"build": "bun build src/cli.ts --target node --outdir dist && chmod +x dist/cli.js",
22+
"dev": "bun run src/cli.ts",
23+
"test": "bun test",
24+
"typecheck": "tsc --noEmit",
25+
"prepublishOnly": "bun run build"
26+
},
27+
"keywords": [
28+
"integrations",
29+
"mcp",
30+
"openapi",
31+
"graphql",
32+
"agents",
33+
"registry",
34+
"cli"
35+
],
36+
"license": "MIT",
37+
"devDependencies": {
38+
"@types/node": "^22.0.0",
39+
"typescript": "^5.6.0"
40+
}
41+
}

0 commit comments

Comments
 (0)