@neural-tools/cli 0.1.5 → 0.1.7
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/LICENSE.md +21 -80
- package/README.md +331 -0
- package/dist/cli.js +47 -18
- package/dist/cli.mjs +47 -18
- package/dist/index.d.mts +21 -1
- package/dist/index.d.ts +21 -1
- package/dist/index.js +47 -18
- package/dist/index.mjs +43 -14
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import d from"path";import u from"fs-extra";import{logger as m,requireFeature as L}from"@neural-tools/core";import M from"inquirer";async function N(e,t){m.header(`Generating MCP: ${e}`),t.deployment!=="none"&&await L("cloud-deployment","Cloud Deployment");let r=t.description;r||(r=(await M.prompt([{type:"input",name:"description",message:"Description of your MCP:",default:`${e} MCP server`}])).description);let i=d.resolve(t.output||"./apps",e);if(t.dryRun){m.info("Dry run mode - no files will be created"),m.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${i}`,`Template: ${t.fastmcp?"FastMCP":"Standard"}`,`CI/CD: ${t.cicd}`,`Deployment: ${t.deployment}`]);return}if(await u.pathExists(i)){let{overwrite:n}=await M.prompt([{type:"confirm",name:"overwrite",message:`Directory ${i} already exists. Overwrite?`,default:!1}]);if(!n){m.warn("Cancelled");return}await u.remove(i)}m.startSpinner("Creating MCP structure...");try{await u.ensureDir(i);let n=`[project]
|
|
2
2
|
name = "mcp-${e}"
|
|
3
3
|
version = "0.1.0"
|
|
4
4
|
description = "${r}"
|
|
@@ -23,7 +23,7 @@ line-length = 100
|
|
|
23
23
|
|
|
24
24
|
[tool.ruff]
|
|
25
25
|
line-length = 100
|
|
26
|
-
`;await u.writeFile(
|
|
26
|
+
`;await u.writeFile(d.join(i,"pyproject.toml"),n,"utf-8");let o=`"""
|
|
27
27
|
${e} MCP Server
|
|
28
28
|
|
|
29
29
|
${r}
|
|
@@ -82,7 +82,7 @@ def brainstorm_topic(topic: str) -> str:
|
|
|
82
82
|
|
|
83
83
|
if __name__ == "__main__":
|
|
84
84
|
mcp.run()
|
|
85
|
-
`;await u.writeFile(
|
|
85
|
+
`;await u.writeFile(d.join(i,"server.py"),o,"utf-8");let s=`# ${e} MCP Server
|
|
86
86
|
|
|
87
87
|
${r}
|
|
88
88
|
|
|
@@ -189,7 +189,7 @@ ruff check .
|
|
|
189
189
|
## License
|
|
190
190
|
|
|
191
191
|
MIT
|
|
192
|
-
`;await u.writeFile(
|
|
192
|
+
`;await u.writeFile(d.join(i,"README.md"),s,"utf-8"),await u.writeFile(d.join(i,"Dockerfile"),`FROM python:3.11-slim
|
|
193
193
|
|
|
194
194
|
WORKDIR /app
|
|
195
195
|
|
|
@@ -205,7 +205,7 @@ RUN uv pip install --system --no-cache .
|
|
|
205
205
|
|
|
206
206
|
# Run the MCP server
|
|
207
207
|
CMD ["python", "server.py"]
|
|
208
|
-
`,"utf-8");let
|
|
208
|
+
`,"utf-8");let c=`version: '3.8'
|
|
209
209
|
|
|
210
210
|
services:
|
|
211
211
|
mcp:
|
|
@@ -218,7 +218,7 @@ services:
|
|
|
218
218
|
- .:/app
|
|
219
219
|
environment:
|
|
220
220
|
- PYTHONUNBUFFERED=1
|
|
221
|
-
`;if(await u.writeFile(
|
|
221
|
+
`;if(await u.writeFile(d.join(i,"docker-compose.yml"),c,"utf-8"),await u.writeFile(d.join(i,".dockerignore"),`__pycache__
|
|
222
222
|
*.pyc
|
|
223
223
|
*.pyo
|
|
224
224
|
*.pyd
|
|
@@ -235,7 +235,7 @@ venv
|
|
|
235
235
|
.git
|
|
236
236
|
.github
|
|
237
237
|
README.md
|
|
238
|
-
`,"utf-8"),t.cicd==="github"){await u.ensureDir(
|
|
238
|
+
`,"utf-8"),t.cicd==="github"){await u.ensureDir(d.join(i,".github","workflows"));let C=`name: Deploy MCP
|
|
239
239
|
|
|
240
240
|
on:
|
|
241
241
|
push:
|
|
@@ -319,19 +319,19 @@ jobs:
|
|
|
319
319
|
run: |
|
|
320
320
|
gcloud builds submit --tag gcr.io/\${{ secrets.GCP_PROJECT_ID }}/mcp-${e}:latest
|
|
321
321
|
`:""}
|
|
322
|
-
`;await u.writeFile(
|
|
322
|
+
`;await u.writeFile(d.join(i,".github","workflows","deploy.yml"),C,"utf-8")}m.succeedSpinner("MCP created successfully!"),m.section("Next steps",[`1. cd ${i}`,"2. docker-compose up # Start with Docker","","Or for local development:","2. uv pip install -e .","3. python server.py","","Or use MCP Inspector:","2. uv pip install -e .","3. fastmcp dev server.py","","Add to Claude Code settings to use this MCP"]),m.success(`\u2728 MCP "${e}" ready to use!`)}catch(n){throw m.failSpinner("Failed to create MCP"),n}}import E from"path";import Y from"os";import A from"fs-extra";import{logger as g}from"@neural-tools/core";import _ from"inquirer";async function q(e,t){g.header(`Generating Claude Command: /${e}`);let r=t.description;r||(r=(await _.prompt([{type:"input",name:"description",message:"Description of your command:",default:`Execute ${e}`}])).description);let i;t.global?i=E.join(Y.homedir(),".claude","commands"):i=E.resolve(t.output||"./claude/commands");let n=E.join(i,`${e}.md`);if(t.dryRun){g.info("Dry run mode - no files will be created"),g.section("Configuration",[`Name: /${e}`,`Description: ${r}`,`Output: ${n}`,`Arguments: ${t.args?.join(", ")||"none"}`,`Allowed Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await A.pathExists(n)){let{overwrite:o}=await _.prompt([{type:"confirm",name:"overwrite",message:`Command /${e} already exists. Overwrite?`,default:!1}]);if(!o){g.warn("Cancelled");return}}g.startSpinner("Creating Claude command...");try{await A.ensureDir(i);let o=["---"];t.args&&t.args.length>0&&o.push(`argument-hint: ${t.args.join(" ")}`),o.push(`description: ${r}`),t.tools&&t.tools.length>0&&(o.push("allowed-tools:"),t.tools.forEach(C=>{o.push(` - ${C}`)})),o.push("---"),o.push("");let s=t.args||[],l=s.map((C,D)=>`$${D+1}`).join(" "),c=s.length>0?`
|
|
323
323
|
|
|
324
324
|
Arguments:
|
|
325
|
-
${s.map((
|
|
326
|
-
`)}`:"",
|
|
325
|
+
${s.map((C,D)=>`- $${D+1}: ${C}`).join(`
|
|
326
|
+
`)}`:"",P=`${o.join(`
|
|
327
327
|
`)}# ${e} Command
|
|
328
328
|
|
|
329
|
-
Execute the ${e} operation${
|
|
329
|
+
Execute the ${e} operation${c?":"+c:"."}
|
|
330
330
|
|
|
331
|
-
${
|
|
331
|
+
${l?`Using arguments: ${l}`:""}
|
|
332
332
|
|
|
333
333
|
Please proceed with the ${e} operation.
|
|
334
|
-
`;await
|
|
334
|
+
`;await A.writeFile(n,P,"utf-8"),g.succeedSpinner("Claude command created successfully!"),g.section("Next steps",[t.global?`Command /${e} is now available globally in Claude Code`:`Add the command to your project by copying ${n}`,"","Usage:",s.length>0?` /${e} ${s.join(" ")}`:` /${e}`]),g.success(`\u2728 Command "/${e}" ready to use!`)}catch(o){throw g.failSpinner("Failed to create command"),o}}import O from"path";import U from"os";import G from"fs-extra";import{logger as f}from"@neural-tools/core";import j from"inquirer";async function K(e,t){f.header(`Generating Claude Agent: ${e}`);let r=t.description;r||(r=(await j.prompt([{type:"input",name:"description",message:"Description of your agent:",default:`${e} specialized agent`}])).description);let i;t.global?i=O.join(U.homedir(),".claude","agents"):i=O.resolve(t.output||"./claude/agents");let n=O.join(i,`${e}.md`),o=t.model||"sonnet";if(t.dryRun){f.info("Dry run mode - no files will be created"),f.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${n}`,`Model: ${o}`,`Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await G.pathExists(n)){let{overwrite:s}=await j.prompt([{type:"confirm",name:"overwrite",message:`Agent ${e} already exists. Overwrite?`,default:!1}]);if(!s){f.warn("Cancelled");return}}f.startSpinner("Creating Claude agent...");try{await G.ensureDir(i);let s=["---"];s.push(`model: claude-${o}-4-5`),t.tools&&t.tools.length>0&&(s.push("tools:"),t.tools.forEach(c=>{s.push(` - ${c}`)})),s.push("---"),s.push("");let l=`${s.join(`
|
|
335
335
|
`)}# ${e} Agent
|
|
336
336
|
|
|
337
337
|
${r}
|
|
@@ -360,4 +360,33 @@ Provide clear, structured responses that:
|
|
|
360
360
|
- [Output requirement 3]
|
|
361
361
|
|
|
362
362
|
Focus on ${e} and deliver actionable results.
|
|
363
|
-
`;await
|
|
363
|
+
`;await G.writeFile(n,l,"utf-8"),f.succeedSpinner("Claude agent created successfully!"),f.section("Next steps",[t.global?`Agent ${e} is now available globally in Claude Code`:`Add the agent to your project by copying ${n}`,"","Customize the agent by editing:",` ${n}`,"","Use the agent via the Task tool in Claude Code"]),f.success(`\u2728 Agent "${e}" ready to use!`)}catch(s){throw f.failSpinner("Failed to create agent"),s}}import k from"path";import W from"os";import R from"fs-extra";import x from"inquirer";import{logger as y}from"@neural-tools/core";async function B(e,t){y.header(`Generating Claude Skill: ${e}`);let r=t.description;r||(r=(await x.prompt([{type:"input",name:"description",message:"Description of your skill:",default:`${e} skill for Claude Code`}])).description);let i=z(t),n=k.join(i,e),o=k.join(n,"SKILL.md"),s=k.join(n,"references");if(t.dryRun){y.info("Dry run mode - no files will be created"),y.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${o}`,`Plugin: ${t.plugin||"none"}`,`References: ${t.references?"Yes":"No"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await R.pathExists(o)){let{overwrite:l}=await x.prompt([{type:"confirm",name:"overwrite",message:`Skill ${e} already exists. Overwrite?`,default:!1}]);if(!l){y.warn("Cancelled");return}}y.startSpinner("Creating Claude skill...");try{await R.ensureDir(n),t.references&&await R.ensureDir(s);let l=`---
|
|
364
|
+
name: ${e}
|
|
365
|
+
description: ${r}
|
|
366
|
+
---
|
|
367
|
+
|
|
368
|
+
# ${e}
|
|
369
|
+
|
|
370
|
+
${r}
|
|
371
|
+
|
|
372
|
+
## When to use this skill
|
|
373
|
+
|
|
374
|
+
Use this skill when the request matches ${e} workflows.
|
|
375
|
+
|
|
376
|
+
## Workflow
|
|
377
|
+
|
|
378
|
+
1. Gather the relevant project context.
|
|
379
|
+
2. Apply ${e} specific checks and implementation steps.
|
|
380
|
+
3. Return concrete output and next actions.
|
|
381
|
+
`;if(await R.writeFile(o,l,"utf-8"),t.references){let c=`# References
|
|
382
|
+
|
|
383
|
+
Store focused reference material for the ${e} skill in this folder.
|
|
384
|
+
`;await R.writeFile(k.join(s,"README.md"),c,"utf-8")}y.succeedSpinner("Claude skill created successfully!"),y.section("Next steps",[`Edit the skill definition: ${o}`,t.references?`Add reference docs in: ${s}`:"Use --references to scaffold a references folder"]),y.success(`\u2728 Skill "${e}" ready to use!`)}catch(l){throw y.failSpinner("Failed to create skill"),l}}function z(e){return e.plugin?k.resolve(e.plugin,"skills"):e.global?k.join(W.homedir(),".claude","skills"):k.resolve(e.output||"./claude/skills")}import b from"path";import S from"fs-extra";import F from"inquirer";import{logger as h}from"@neural-tools/core";async function V(e,t){h.header(`Generating Claude Plugin: ${e}`);let r=t.description;r||(r=(await F.prompt([{type:"input",name:"description",message:"Description of your plugin:",default:`${e} Claude Code plugin`}])).description);let i=r||`${e} Claude Code plugin`,n=b.resolve(t.output||"./claude/plugins",e),o=b.join(n,".claude-plugin"),s=b.join(o,"plugin.json"),l=b.join(n,"skills");if(t.dryRun){h.info("Dry run mode - no files will be created"),h.section("Configuration",[`Name: ${e}`,`Description: ${i}`,`Output: ${n}`,`Plugin config: ${s}`,`Version: ${t.version||"0.1.0"}`,`Author: ${t.author||"none"}`,`Starter skill: ${t.withSkill||"none"}`]);return}if(await S.pathExists(s)){let{overwrite:c}=await F.prompt([{type:"confirm",name:"overwrite",message:`Plugin ${e} already exists. Overwrite config?`,default:!1}]);if(!c){h.warn("Cancelled");return}}h.startSpinner("Creating Claude plugin...");try{await S.ensureDir(o),await S.ensureDir(l);let c={name:e,version:t.version||"0.1.0",description:i};if(t.author&&(c.author=t.author),await S.writeJSON(s,c,{spaces:2}),t.withSkill){let P=b.join(l,t.withSkill),C=b.join(P,"SKILL.md");await S.ensureDir(P);let D=`---
|
|
385
|
+
name: ${t.withSkill}
|
|
386
|
+
description: Starter skill for ${e}
|
|
387
|
+
---
|
|
388
|
+
|
|
389
|
+
# ${t.withSkill}
|
|
390
|
+
|
|
391
|
+
Starter skill scaffolded with the plugin.
|
|
392
|
+
`;await S.writeFile(C,D,"utf-8")}h.succeedSpinner("Claude plugin created successfully!"),h.section("Next steps",[`Review plugin manifest: ${s}`,t.withSkill?`Customize skill: ${b.join(l,t.withSkill,"SKILL.md")}`:"Use `generate skill <name> --plugin <plugin-dir>` to add skills",`Install with Claude Code using the plugin path: ${n}`]),h.success(`\u2728 Plugin "${e}" ready to use!`)}catch(c){throw h.failSpinner("Failed to create plugin"),c}}import{logger as a,requireFeature as H}from"@neural-tools/core";import{execa as J}from"execa";import Q from"path";import X from"fs-extra";async function Z(e,t){a.header(`Deploying MCP: ${e}`),await H("cloud-deployment","Cloud Deployment");let r=t.platform||"aws",i=t.env||"dev";a.info(`Platform: ${r}`),a.info(`Environment: ${i}`);let n=Q.resolve("./apps",e);if(!await X.pathExists(n))throw new Error(`MCP "${e}" not found at ${n}`);a.startSpinner("Building MCP...");try{await J("npm",["run","build"],{cwd:n,stdio:"pipe"}),a.succeedSpinner("MCP built successfully"),r==="aws"?await ee(e,n,t):r==="gcp"&&await te(e,n,t),a.success(`\u2728 MCP "${e}" deployed successfully!`)}catch(o){throw a.failSpinner("Deployment failed"),o}}async function ee(e,t,r){a.startSpinner("Deploying to AWS Lambda..."),a.updateSpinner("Packaging Lambda function..."),await new Promise(i=>setTimeout(i,1e3)),a.updateSpinner("Uploading to S3..."),await new Promise(i=>setTimeout(i,1e3)),a.updateSpinner("Creating/updating Lambda function..."),await new Promise(i=>setTimeout(i,1e3)),a.succeedSpinner("Deployed to AWS Lambda"),a.section("Deployment Info",[`Function: ${e}-${r.env}`,`Region: ${r.region||"us-east-1"}`,`Environment: ${r.env}`,"","Configure in Claude Code:",JSON.stringify({mcpServers:{[e]:{command:"aws",args:["lambda","invoke","--function-name",`${e}-${r.env}`,"--payload","stdin","--output","stdout"]}}},null,2)])}async function te(e,t,r){a.startSpinner("Deploying to Google Cloud Functions..."),a.updateSpinner("Packaging function..."),await new Promise(i=>setTimeout(i,1e3)),a.updateSpinner("Uploading to Cloud Storage..."),await new Promise(i=>setTimeout(i,1e3)),a.updateSpinner("Deploying Cloud Function..."),await new Promise(i=>setTimeout(i,1e3)),a.succeedSpinner("Deployed to Google Cloud Functions"),a.section("Deployment Info",[`Function: ${e}-${r.env}`,`Region: ${r.region||"us-central1"}`,`Environment: ${r.env}`])}import{logger as p,licenseManager as I,LicenseTier as ie}from"@neural-tools/core";import re from"inquirer";async function ne(e){p.header("AI Toolkit License Management");let t=e.key;if(t||(t=(await re.prompt([{type:"input",name:"licenseKey",message:"Enter your license key:",validate:i=>!i||i.trim().length===0?"License key is required":!0}])).licenseKey),!t){p.error("License key is required");return}p.startSpinner("Validating license...");try{let r=t.split("-");if(r.length<2)throw new Error("Invalid license key format");let i=r[0],n=r[1];if(!Object.values(ie).includes(i))throw new Error("Invalid license tier");await I.saveLicense({tier:i,email:n,key:t,features:[]}),p.succeedSpinner("License activated successfully!");let o=await I.loadLicense();p.section("License Details",[`Tier: ${o.tier.toUpperCase()}`,`Email: ${o.email||"N/A"}`,"Status: Active"]);let s=oe();p.section("Available Features",s),p.success("\u2728 Ready to build!")}catch(r){p.failSpinner("License validation failed"),p.error(r.message||"Invalid license key"),p.newline(),p.info("All features are available for free - no license required!")}}function oe(){return["\u2713 MCP generation","\u2713 Claude commands","\u2713 Claude agents","\u2713 Vector database integration","\u2713 Semantic caching","\u2713 Fine-tuning workflows","\u2713 Cloud deployment (AWS/GCP)","\u2713 GitHub automation","\u2713 All templates"]}import{logger as w,licenseManager as T}from"@neural-tools/core";async function se(){w.header("AI Toolkit Status");try{let e=await T.loadLicense();w.section("License Information",[`Tier: ${e.tier.toUpperCase()}`,`Email: ${e.email||"N/A"}`,`Status: ${e.expiresAt?ae(e.expiresAt):"Active"}`]);let t=[{name:"MCP Generation",key:"mcp-generation"},{name:"Claude Commands",key:"claude-commands"},{name:"Vector Database",key:"vector-db"},{name:"Semantic Cache",key:"semantic-cache"},{name:"Fine-tuning",key:"fine-tuning"},{name:"Cloud Deployment",key:"cloud-deployment"},{name:"GitHub Automation",key:"github-automation"}],r=await Promise.all(t.map(async i=>`${await T.checkFeature(i.key)?"\u2713":"\u2717"} ${i.name}`));w.section("Feature Availability",r),w.newline(),w.section("Quick Start",["Generate an MCP server:"," ai-toolkit generate mcp github","","Generate a Claude command:"," ai-toolkit generate command search-kb","","View all commands:"," ai-toolkit --help"])}catch{w.error("Failed to load license information"),w.newline(),w.info("All features are available - no license required!"),w.info('Run "ai-toolkit --help" to get started')}}function ae(e){let t=new Date(e),r=new Date;if(t<r)return"Expired";let i=Math.ceil((t.getTime()-r.getTime())/(1e3*60*60*24));return i<=30?`Active (expires in ${i} days)`:"Active"}export{Z as deployMCP,K as generateAgent,q as generateCommand,N as generateMCP,V as generatePlugin,B as generateSkill,ne as loginCommand,se as statusCommand};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@neural-tools/cli",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "CLI for Neural Tools - Generate MCPs, Claude commands, and AI workflows",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"fs-extra": "^11.2.0",
|
|
37
37
|
"globby": "^14.0.0",
|
|
38
38
|
"picocolors": "^1.0.0",
|
|
39
|
-
"@neural-tools/core": "0.1.
|
|
39
|
+
"@neural-tools/core": "0.1.7"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/fs-extra": "^11.0.4",
|