@agentneeds/need 0.1.1 → 0.1.2
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 +14 -2
- package/dist/commands/init.d.ts +1 -0
- package/dist/commands/init.js +82 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -1
- package/dist/postinstall.d.ts +1 -0
- package/dist/postinstall.js +8 -0
- package/dist/postinstall.js.map +1 -0
- package/package.json +14 -4
package/README.md
CHANGED
|
@@ -12,6 +12,8 @@ Semantic search across 6,000+ CLI tools. Works standalone or as an MCP server fo
|
|
|
12
12
|
npm install -g @agentneeds/need
|
|
13
13
|
```
|
|
14
14
|
|
|
15
|
+
That's it. MCP servers are automatically configured for **Claude Code**, **Cursor**, and **Claude Desktop** on install. Your AI tools can immediately discover and install CLI tools.
|
|
16
|
+
|
|
15
17
|
Or run directly: `npx @agentneeds/need "compress png images"`
|
|
16
18
|
|
|
17
19
|
## Commands
|
|
@@ -41,15 +43,25 @@ need report jq --success
|
|
|
41
43
|
need report sometool --fail
|
|
42
44
|
```
|
|
43
45
|
|
|
46
|
+
### Project integration
|
|
47
|
+
|
|
48
|
+
Add `need` instructions to your project so AI tools use it automatically:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
need init
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Generates config files for Claude Code, Cursor, GitHub Copilot, and Windsurf.
|
|
55
|
+
|
|
44
56
|
### MCP setup
|
|
45
57
|
|
|
46
|
-
|
|
58
|
+
Manually configure MCP servers (already done automatically on install):
|
|
47
59
|
|
|
48
60
|
```bash
|
|
49
61
|
need setup
|
|
50
62
|
```
|
|
51
63
|
|
|
52
|
-
Supports **Claude Code
|
|
64
|
+
Supports **Claude Code**, **Cursor**, and **Claude Desktop**.
|
|
53
65
|
|
|
54
66
|
### MCP server
|
|
55
67
|
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function initCommand(): Promise<void>;
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import * as fs from 'node:fs';
|
|
2
|
+
import * as path from 'node:path';
|
|
3
|
+
function ensureDir(dirPath) {
|
|
4
|
+
if (!fs.existsSync(dirPath)) {
|
|
5
|
+
fs.mkdirSync(dirPath, { recursive: true });
|
|
6
|
+
}
|
|
7
|
+
}
|
|
8
|
+
function getToolConfigs(cwd) {
|
|
9
|
+
const mcpInstructions = `When you need a CLI tool for a task, use \`need\` to find and install it:
|
|
10
|
+
|
|
11
|
+
1. **Search** — \`need <query>\` (e.g. \`need json formatter\`)
|
|
12
|
+
2. **Install** — follow the install command from the results
|
|
13
|
+
3. **Report** — \`need report <tool> --success\` or \`--fail\`
|
|
14
|
+
|
|
15
|
+
If you have access to MCP tools, prefer using \`search_tools\`, \`install_tool\`, and \`report_tool_usage\` from the \`need\` MCP server.`;
|
|
16
|
+
return [
|
|
17
|
+
{
|
|
18
|
+
name: 'Claude Code',
|
|
19
|
+
filePath: path.join(cwd, '.claude', 'commands', 'need.md'),
|
|
20
|
+
content: `---
|
|
21
|
+
description: Find and install CLI tools using need
|
|
22
|
+
---
|
|
23
|
+
|
|
24
|
+
${mcpInstructions}
|
|
25
|
+
`,
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
name: 'Cursor',
|
|
29
|
+
filePath: path.join(cwd, '.cursor', 'rules', 'need.mdc'),
|
|
30
|
+
content: `---
|
|
31
|
+
description: Find and install CLI tools using need
|
|
32
|
+
globs:
|
|
33
|
+
alwaysApply: true
|
|
34
|
+
---
|
|
35
|
+
|
|
36
|
+
${mcpInstructions}
|
|
37
|
+
`,
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: 'GitHub Copilot',
|
|
41
|
+
filePath: path.join(cwd, '.github', 'copilot-instructions.md'),
|
|
42
|
+
content: `# need — CLI Tool Discovery
|
|
43
|
+
|
|
44
|
+
${mcpInstructions}
|
|
45
|
+
`,
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Windsurf',
|
|
49
|
+
filePath: path.join(cwd, '.windsurf', 'rules', 'need.md'),
|
|
50
|
+
content: `---
|
|
51
|
+
description: Find and install CLI tools using need
|
|
52
|
+
---
|
|
53
|
+
|
|
54
|
+
${mcpInstructions}
|
|
55
|
+
`,
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
}
|
|
59
|
+
export async function initCommand() {
|
|
60
|
+
const cwd = process.cwd();
|
|
61
|
+
const results = [];
|
|
62
|
+
for (const tool of getToolConfigs(cwd)) {
|
|
63
|
+
if (fs.existsSync(tool.filePath)) {
|
|
64
|
+
results.push({ name: tool.name, result: 'already exists', filePath: tool.filePath });
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
ensureDir(path.dirname(tool.filePath));
|
|
68
|
+
fs.writeFileSync(tool.filePath, tool.content, 'utf-8');
|
|
69
|
+
results.push({ name: tool.name, result: 'created', filePath: tool.filePath });
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
for (const { name, result, filePath } of results) {
|
|
73
|
+
const rel = path.relative(cwd, filePath);
|
|
74
|
+
if (result === 'already exists') {
|
|
75
|
+
console.log(`\u2013 ${name} \u2014 already exists (${rel})`);
|
|
76
|
+
}
|
|
77
|
+
else {
|
|
78
|
+
console.log(`\u2713 ${name} \u2014 created (${rel})`);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
//# sourceMappingURL=init.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"init.js","sourceRoot":"","sources":["../../src/commands/init.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,SAAS,CAAC;AAC9B,OAAO,KAAK,IAAI,MAAM,WAAW,CAAC;AAUlC,SAAS,SAAS,CAAC,OAAe;IAChC,IAAI,CAAC,EAAE,CAAC,UAAU,CAAC,OAAO,CAAC,EAAE,CAAC;QAC5B,EAAE,CAAC,SAAS,CAAC,OA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,EAAE,CAAC,CAAC;QACvF,CAAC;aAAM,CAAC;YACN,SAAS,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC;YACvC,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,QAAQ,EAAE,IAAI,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;YACvD,OAAO,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,QAAQ,EAAE,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC;QAChF,CAAC;IACH,CAAC;IAED,KAAK,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,OAAO,EAAE,CAAC;QACjD,MAAM,GAAG,GAAG,IAAI,CAAC,QAAQ,CAAC,GAAG,EAAE,QAAQ,CAAC,CAAC;QACzC,IAAI,MAAM,KAAK,gBAAgB,EAAE,CAAC;YAChC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,2BAA2B,GAAG,GAAG,CAAC,CAAC;QAC/D,CAAC;aAAM,CAAC;YACN,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,oBAAoB,GAAG,GAAG,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;AACH,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -45,5 +45,12 @@ program
|
|
|
45
45
|
const query = queryParts.join(' ');
|
|
46
46
|
await installCommand(query);
|
|
47
47
|
});
|
|
48
|
+
program
|
|
49
|
+
.command('init')
|
|
50
|
+
.description('Add need integration files to current project for AI coding tools')
|
|
51
|
+
.action(async () => {
|
|
52
|
+
const { initCommand } = await import('./commands/init.js');
|
|
53
|
+
await initCommand();
|
|
54
|
+
});
|
|
48
55
|
program.parse();
|
|
49
56
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts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,EAAE,GAAG,MAAM,MAAM,CAAC,oBAAoB,CAAC,CAAC;IAC3D,MAAM,WAAW,EAAE,CAAC;AACtB,CAAC,CAAC,CAAC;AAEL,OAAO,CAAC,KAAK,EAAE,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"postinstall.js","sourceRoot":"","sources":["../src/postinstall.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,qBAAqB,CAAC;AAEnD,IAAI,CAAC;IACH,MAAM,YAAY,EAAE,CAAC;AACvB,CAAC;AAAC,MAAM,CAAC;IACP,wCAAwC;AAC1C,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@agentneeds/need",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.2",
|
|
4
4
|
"description": "Discover the right CLI tool for any task using plain English",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
7
|
-
"keywords": [
|
|
7
|
+
"keywords": [
|
|
8
|
+
"cli",
|
|
9
|
+
"tools",
|
|
10
|
+
"mcp",
|
|
11
|
+
"ai",
|
|
12
|
+
"discovery"
|
|
13
|
+
],
|
|
8
14
|
"engines": {
|
|
9
15
|
"node": ">=18"
|
|
10
16
|
},
|
|
11
|
-
"files": [
|
|
17
|
+
"files": [
|
|
18
|
+
"dist",
|
|
19
|
+
"README.md"
|
|
20
|
+
],
|
|
12
21
|
"repository": {
|
|
13
22
|
"type": "git",
|
|
14
23
|
"url": "https://github.com/tuckerschreiber/need.git",
|
|
@@ -22,7 +31,8 @@
|
|
|
22
31
|
"dev": "tsc --watch",
|
|
23
32
|
"test": "vitest run",
|
|
24
33
|
"test:watch": "vitest",
|
|
25
|
-
"prepublishOnly": "npm run build"
|
|
34
|
+
"prepublishOnly": "npm run build",
|
|
35
|
+
"postinstall": "node ./dist/postinstall.js"
|
|
26
36
|
},
|
|
27
37
|
"dependencies": {
|
|
28
38
|
"@modelcontextprotocol/sdk": "^1.27.1",
|