Skip to content

Commit 8dff017

Browse files
committed
feat: add CLI emitter + self-as-skills — v0.4.0
Two new features for the agent-native vision: 1. CLI Emitter (-f cli): generates a standalone Commander.js CLI tool from any OpenAPI spec. Each endpoint becomes a command with proper positional args, flags, and type coercion. 2. Self-as-Skills: Agentify now ships self-description files (self/skills.json, self/CLAUDE.md, self/AGENTS.md) so agents can discover and use Agentify autonomously. New `self-describe` CLI command copies these files to any directory. - 9 output formats total (8 default + cli opt-in) - 133 tests passing across 9 test files - npm: agentify-cli@0.4.0 published with self/ included
1 parent 3b7f240 commit 8dff017

12 files changed

Lines changed: 946 additions & 7 deletions

File tree

README.md

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
---
1616

17-
Agentify compiles any OpenAPI specification into **8 agent interface formats** — MCP Server, CLAUDE.md, AGENTS.md, .cursorrules, Skills, llms.txt, GEMINI.md, and A2A Card. Instead of hand-building each format separately, generate them all from a single source of truth.
17+
Agentify compiles any OpenAPI specification into **9 agent interface formats** — MCP Server, CLAUDE.md, AGENTS.md, .cursorrules, Skills, llms.txt, GEMINI.md, A2A Card, and CLI. Instead of hand-building each format separately, generate them all from a single source of truth.
1818

1919
```bash
2020
npx agentify-cli transform https://petstore.swagger.io/v2/swagger.json
@@ -38,8 +38,9 @@ AI agents are the new users of your API. But making your product agent-accessibl
3838
| llms.txt | LLM search engines | Manual authoring |
3939
| GEMINI.md | Gemini CLI | Write from scratch |
4040
| A2A Card | Google Agent-to-Agent protocol | JSON schema work |
41+
| CLI | Developers, scripts, CI/CD | Build from scratch |
4142

42-
**That's 8+ formats to build, test, and keep in sync.** Every API change means updating all of them.
43+
**That's 9+ formats to build, test, and keep in sync.** Every API change means updating all of them.
4344

4445
## The Solution
4546

@@ -61,6 +62,8 @@ OpenAPI Spec -----> +---> .cursorrules
6162
+---> GEMINI.md
6263
|
6364
+---> A2A Card
65+
|
66+
+---> CLI (standalone command-line tool)
6467
```
6568

6669
## Quick Start
@@ -77,12 +80,18 @@ npx agentify-cli transform https://api.example.com/openapi.json -n my-project
7780

7881
# Generate only specific formats
7982
npx agentify-cli transform ./my-api.yaml -f mcp claude.md
83+
84+
# Generate a standalone CLI tool from your API
85+
npx agentify-cli transform ./my-api.yaml -f cli -o my-api-cli
86+
87+
# Get Agentify's own agent interface files (self-describe)
88+
npx agentify-cli self-describe -o .
8089
```
8190

8291
**Output:**
8392

8493
```
85-
Agentify v0.3.0
94+
Agentify v0.4.0
8695
Agent Interface Compiler
8796
8897
+-- 20 endpoints detected -> SMALL API strategy
@@ -129,6 +138,7 @@ npx agentify-cli transform ./my-api.yaml -f mcp claude.md
129138
| llms.txt | Available | LLM-readable condensed documentation |
130139
| GEMINI.md | Available | Gemini CLI project context |
131140
| A2A Card | Available | Google Agent-to-Agent discovery card |
141+
| CLI | Available | Standalone command-line tool (opt-in: `-f cli`) |
132142

133143
## How It Works
134144

@@ -205,6 +215,8 @@ See [CONTRIBUTING.md](CONTRIBUTING.md) for the full guide.
205215
| llms.txt | Yes | Yes | No | No |
206216
| GEMINI.md | Yes | No | No | No |
207217
| A2A Card | Yes | No | No | No |
218+
| CLI generation | Yes | No | No | No |
219+
| Self-as-Skills | Yes | No | No | No |
208220
| Context-aware strategy | Yes | No | Yes | No |
209221
| Security scanning | Yes | Unknown | Unknown | No |
210222
| Open source | MIT | No | No | MIT |

docs/demo.gif

6.17 KB
Loading

docs/demo.tape

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Type "# Transform any OpenAPI spec into 8 agent interface formats"
2020
Enter
2121
Sleep 600ms
2222

23-
Type "npx -y agentify-cli@0.3.0 transform https://petstore.swagger.io/v2/swagger.json"
23+
Type "npx -y agentify-cli@0.4.0 transform https://petstore.swagger.io/v2/swagger.json"
2424
Sleep 300ms
2525
Enter
2626
Sleep 35s

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "agentify-cli",
3-
"version": "0.3.0",
3+
"version": "0.4.0",
44
"description": "Agent Interface Compiler — One command. Every agent speaks your product.",
55
"type": "module",
66
"bin": {
@@ -54,7 +54,8 @@
5454
"node": ">=18.0.0"
5555
},
5656
"files": [
57-
"dist"
57+
"dist",
58+
"self"
5859
],
5960
"dependencies": {
6061
"@apidevtools/swagger-parser": "^12.1.0",

self/AGENTS.md

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# AGENTS.md — Agentify
2+
3+
## Identity
4+
5+
Agentify is an Agent Interface Compiler. It transforms OpenAPI specifications into 9 agent interface formats from a single source of truth.
6+
7+
Install: `npm install -g agentify-cli` or use via `npx agentify-cli`.
8+
9+
## Capabilities
10+
11+
### transform
12+
13+
Convert an OpenAPI specification into agent interface formats.
14+
15+
```bash
16+
npx agentify-cli transform <input> [-o dir] [-n name] [-f format1 format2 ...]
17+
```
18+
19+
- **Input**: URL or file path to an OpenAPI spec (Swagger 2.0, OAS 3.x)
20+
- **Output**: Generated project with selected formats (default: all 9)
21+
- **Formats**: mcp, claude.md, agents.md, cursorrules, skills, llms.txt, gemini.md, a2a, cli
22+
- **Side effects**: Creates files in the output directory
23+
24+
### self-describe
25+
26+
Output Agentify's own agent interface files.
27+
28+
```bash
29+
npx agentify-cli self-describe [-o dir]
30+
```
31+
32+
- **Output**: skills.json, CLAUDE.md, AGENTS.md describing Agentify itself
33+
34+
## Authentication
35+
36+
No authentication required.
37+
38+
## Protocols
39+
40+
- **Interface**: Command-line (CLI)
41+
- **Input**: OpenAPI/Swagger specifications (URL or local file)
42+
- **Output**: File system (generated project directory)
43+
44+
## Constraints
45+
46+
- Requires Node.js 18+
47+
- Internet access needed for remote OpenAPI spec URLs
48+
- Generated MCP servers require their own setup (`npm install`, env config)
49+
- CLI format (`-f cli`) generates a separate project; avoid combining with `mcp` in the same output directory
50+
51+
## Context
52+
53+
- Repository: https://github.com/koriyoshi2041/agentify
54+
- npm: https://www.npmjs.com/package/agentify-cli
55+
- License: MIT

self/CLAUDE.md

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
# Agentify — Agent Interface Compiler
2+
3+
When a user wants to make their API accessible to AI agents, use Agentify to transform their OpenAPI specification into agent interface formats.
4+
5+
## Usage
6+
7+
```bash
8+
npx agentify-cli transform <openapi-spec-url-or-path> [options]
9+
```
10+
11+
### Options
12+
13+
- `-o, --output <dir>` — Output directory (default: `<product-name>-mcp-server`)
14+
- `-n, --name <name>` — Override project name
15+
- `-f, --format <formats...>` — Output formats (default: all 9 formats)
16+
17+
### Available Formats
18+
19+
| Format | Flag | Output |
20+
|--------|------|--------|
21+
| MCP Server | `mcp` | Full server with tools, handlers, Dockerfile |
22+
| CLAUDE.md | `claude.md` | Project context for Claude Code |
23+
| AGENTS.md | `agents.md` | Universal agent instructions |
24+
| .cursorrules | `cursorrules` | Cursor IDE agent rules |
25+
| Skills | `skills` | Structured capability file (skills.json) |
26+
| llms.txt | `llms.txt` | LLM-readable condensed documentation |
27+
| GEMINI.md | `gemini.md` | Gemini CLI project context |
28+
| A2A Card | `a2a` | Google Agent-to-Agent discovery card |
29+
| CLI | `cli` | Standalone command-line tool |
30+
31+
## When to Use
32+
33+
- User has an OpenAPI/Swagger specification and wants agents to use their API
34+
- User asks to "make my API agent-accessible" or "generate MCP server"
35+
- User needs to convert a REST API for use with Claude, Cursor, Gemini, or other AI tools
36+
- User wants a CLI tool generated from their API specification
37+
- User mentions "agent interfaces", "MCP", "skills", or "A2A"
38+
39+
## Examples
40+
41+
```bash
42+
# Transform Petstore API into all agent formats
43+
npx agentify-cli transform https://petstore.swagger.io/v2/swagger.json
44+
45+
# Generate only MCP server
46+
npx agentify-cli transform ./api-spec.yaml -f mcp -o my-mcp-server
47+
48+
# Generate CLI tool from API
49+
npx agentify-cli transform https://api.example.com/openapi.json -f cli
50+
51+
# Generate specific formats
52+
npx agentify-cli transform ./spec.json -f mcp skills a2a
53+
```
54+
55+
## Supported Inputs
56+
57+
- Swagger 2.0 (JSON/YAML)
58+
- OpenAPI 3.0.x (JSON/YAML)
59+
- OpenAPI 3.1.x (JSON/YAML)
60+
- URL or local file path
61+
62+
## Self-Describe
63+
64+
To get Agentify's own agent interface files:
65+
66+
```bash
67+
npx agentify-cli self-describe [-o output-dir]
68+
```
69+
70+
This outputs `skills.json`, `CLAUDE.md`, and `AGENTS.md` describing Agentify itself.

self/skills.json

Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
{
2+
"name": "Agentify",
3+
"description": "Agent Interface Compiler — transforms OpenAPI specs into 9 agent interface formats (MCP Server, CLAUDE.md, AGENTS.md, .cursorrules, Skills, llms.txt, GEMINI.md, A2A Card, CLI)",
4+
"version": "0.4.0",
5+
"baseUrl": "https://github.com/koriyoshi2041/agentify",
6+
"auth": {
7+
"type": "none",
8+
"envVariable": ""
9+
},
10+
"skills": [
11+
{
12+
"id": "transform",
13+
"name": "transform",
14+
"description": "Transform an OpenAPI specification into agent interface formats. Run: npx agentify-cli transform <input> [-o dir] [-n name] [-f formats...]",
15+
"domain": "compilation",
16+
"operation": "execute",
17+
"method": "cli",
18+
"path": "npx agentify-cli transform",
19+
"sideEffects": true,
20+
"parameters": [
21+
{
22+
"name": "input",
23+
"type": "string",
24+
"required": true,
25+
"description": "URL or file path to an OpenAPI spec (Swagger 2.0 or OAS 3.x)",
26+
"in": "positional"
27+
},
28+
{
29+
"name": "output",
30+
"type": "string",
31+
"required": false,
32+
"description": "-o, --output <dir> — Output directory",
33+
"in": "flag"
34+
},
35+
{
36+
"name": "name",
37+
"type": "string",
38+
"required": false,
39+
"description": "-n, --name <name> — Project name override",
40+
"in": "flag"
41+
},
42+
{
43+
"name": "format",
44+
"type": "array",
45+
"required": false,
46+
"description": "-f, --format <formats...> — Output formats: mcp, claude.md, agents.md, cursorrules, skills, llms.txt, gemini.md, a2a, cli",
47+
"in": "flag"
48+
}
49+
]
50+
},
51+
{
52+
"id": "self-describe",
53+
"name": "self-describe",
54+
"description": "Output Agentify's own agent interface files (skills.json, CLAUDE.md, AGENTS.md). Run: npx agentify-cli self-describe [-o dir]",
55+
"domain": "compilation",
56+
"operation": "read",
57+
"method": "cli",
58+
"path": "npx agentify-cli self-describe",
59+
"sideEffects": true,
60+
"parameters": [
61+
{
62+
"name": "output",
63+
"type": "string",
64+
"required": false,
65+
"description": "-o, --output <dir> — Output directory (default: current directory)",
66+
"in": "flag"
67+
}
68+
]
69+
}
70+
],
71+
"domains": [
72+
{
73+
"name": "compilation",
74+
"skillCount": 2
75+
}
76+
],
77+
"meta": {
78+
"generator": "agentify (self-description)",
79+
"strategy": "manual"
80+
}
81+
}

src/cli.ts

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ program
3535
.description("Transform an OpenAPI spec into agent interfaces")
3636
.option("-o, --output <dir>", "Output directory")
3737
.option("-n, --name <name>", "Project name override")
38-
.option("-f, --format <formats...>", "Output formats (mcp, claude.md, agents.md, cursorrules, llms.txt, gemini.md, skills, a2a)", ["mcp", "claude.md", "agents.md", "cursorrules", "llms.txt", "gemini.md", "skills", "a2a"])
38+
.option("-f, --format <formats...>", "Output formats (mcp, claude.md, agents.md, cursorrules, llms.txt, gemini.md, skills, a2a, cli)", ["mcp", "claude.md", "agents.md", "cursorrules", "llms.txt", "gemini.md", "skills", "a2a"])
3939
.action(async (input: string, opts: TransformOptions) => {
4040
await runTransform(input, opts);
4141
});
@@ -147,4 +147,35 @@ function toKebabCase(str: string): string {
147147
.toLowerCase();
148148
}
149149

150+
program
151+
.command("self-describe")
152+
.description("Output Agentify's own agent interface files (skills.json, CLAUDE.md, AGENTS.md)")
153+
.option("-o, --output <dir>", "Output directory", ".")
154+
.action(async (opts: { output: string }) => {
155+
const selfDir = resolveSelfDir();
156+
const outputDir = path.resolve(opts.output);
157+
fs.mkdirSync(outputDir, { recursive: true });
158+
159+
const files = ["skills.json", "CLAUDE.md", "AGENTS.md"];
160+
for (const file of files) {
161+
const src = path.join(selfDir, file);
162+
const dest = path.join(outputDir, file);
163+
fs.copyFileSync(src, dest);
164+
console.log(` ${chalk.green("\u2713")} ${file}`);
165+
}
166+
167+
console.log("");
168+
console.log(chalk.dim(" Agent interface files for Agentify itself."));
169+
console.log(chalk.dim(" Add these to your project so agents know how to use Agentify."));
170+
console.log("");
171+
});
172+
173+
function resolveSelfDir(): string {
174+
for (const rel of ["../self", "../../self"]) {
175+
const p = path.resolve(__dirname, rel);
176+
if (fs.existsSync(p)) return p;
177+
}
178+
throw new Error("Could not locate self-description files. Are you running from the npm package?");
179+
}
180+
150181
program.parse();

0 commit comments

Comments
 (0)