@neural-tools/cli 0.1.4 → 0.1.5

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/dist/cli.d.mts ADDED
@@ -0,0 +1 @@
1
+ #!/usr/bin/env node
package/dist/cli.d.ts CHANGED
@@ -1,2 +1 @@
1
1
  #!/usr/bin/env node
2
- export {};
package/dist/cli.js CHANGED
@@ -1,84 +1,364 @@
1
1
  #!/usr/bin/env node
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- const commander_1 = require("commander");
5
- const core_1 = require("@neural-tools/core");
6
- const generate_mcp_1 = require("./commands/generate-mcp");
7
- const generate_command_1 = require("./commands/generate-command");
8
- const generate_agent_1 = require("./commands/generate-agent");
9
- const deploy_1 = require("./commands/deploy");
10
- const login_1 = require("./commands/login");
11
- const status_1 = require("./commands/status");
12
- const program = new commander_1.Command();
13
- program
14
- .name('neural-tools')
15
- .description('Neural Tools - Build MCPs, Claude commands, and AI workflows')
16
- .version('0.1.0');
17
- // Generate commands
18
- const generate = program
19
- .command('generate')
20
- .alias('g')
21
- .description('Generate new components (MCP, command, agent, etc.)');
22
- generate
23
- .command('mcp')
24
- .description('Generate a new MCP server')
25
- .argument('<name>', 'Name of the MCP server')
26
- .option('-d, --description <desc>', 'Description of the MCP')
27
- .option('-o, --output <dir>', 'Output directory', './apps')
28
- .option('--fastmcp', 'Use FastMCP template', true)
29
- .option('--cicd <provider>', 'CI/CD provider (github, harness, none)', 'github')
30
- .option('--deployment <platform>', 'Deployment platform (aws, gcp, none)', 'aws')
31
- .option('--dry-run', 'Preview without creating files', false)
32
- .action(generate_mcp_1.generateMCP);
33
- generate
34
- .command('command')
35
- .description('Generate a new Claude command')
36
- .argument('<name>', 'Name of the command (without /)')
37
- .option('-d, --description <desc>', 'Description of the command')
38
- .option('-o, --output <dir>', 'Output directory', './claude/commands')
39
- .option('--args <arguments...>', 'Command arguments')
40
- .option('--tools <tools...>', 'Allowed tools')
41
- .option('--global', 'Install globally to ~/.claude/commands', false)
42
- .option('--dry-run', 'Preview without creating files', false)
43
- .action(generate_command_1.generateCommand);
44
- generate
45
- .command('agent')
46
- .description('Generate a new Claude agent')
47
- .argument('<name>', 'Name of the agent')
48
- .option('-d, --description <desc>', 'Description of the agent')
49
- .option('-o, --output <dir>', 'Output directory', './claude/agents')
50
- .option('--model <model>', 'Model to use (sonnet, opus, haiku)', 'sonnet')
51
- .option('--tools <tools...>', 'Available tools')
52
- .option('--global', 'Install globally to ~/.claude/agents', false)
53
- .option('--dry-run', 'Preview without creating files', false)
54
- .action(generate_agent_1.generateAgent);
55
- // Deploy command
56
- program
57
- .command('deploy')
58
- .description('Deploy an MCP server')
59
- .argument('<name>', 'Name of the MCP to deploy')
60
- .option('-p, --platform <platform>', 'Deployment platform (aws, gcp)', 'aws')
61
- .option('--region <region>', 'AWS/GCP region')
62
- .option('--env <env>', 'Environment (dev, staging, prod)', 'dev')
63
- .action(deploy_1.deployMCP);
64
- // License management
65
- program
66
- .command('login')
67
- .description('Authenticate and manage your license')
68
- .option('--key <key>', 'License key')
69
- .action(login_1.loginCommand);
70
- program
71
- .command('status')
72
- .description('Show license status and available features')
73
- .action(status_1.statusCommand);
74
- // Error handling
75
- program.exitOverride();
76
- try {
77
- program.parse(process.argv);
2
+ "use strict";var K=Object.create;var O=Object.defineProperty;var z=Object.getOwnPropertyDescriptor;var V=Object.getOwnPropertyNames;var H=Object.getPrototypeOf,J=Object.prototype.hasOwnProperty;var Q=(e,t,o,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let r of V(t))!J.call(e,r)&&r!==o&&O(e,r,{get:()=>t[r],enumerable:!(n=z(t,r))||n.enumerable});return e};var u=(e,t,o)=>(o=e!=null?K(H(e)):{},Q(t||!e||!e.__esModule?O(o,"default",{value:e,enumerable:!0}):o,e));var W=require("commander"),B=require("@neural-tools/core");var m=u(require("path")),p=u(require("fs-extra")),d=require("@neural-tools/core"),E=u(require("inquirer"));async function T(e,t){d.logger.header(`Generating MCP: ${e}`),t.deployment!=="none"&&await(0,d.requireFeature)("cloud-deployment","Cloud Deployment");let o=t.description;o||(o=(await E.default.prompt([{type:"input",name:"description",message:"Description of your MCP:",default:`${e} MCP server`}])).description);let n=m.default.resolve(t.output||"./apps",e);if(t.dryRun){d.logger.info("Dry run mode - no files will be created"),d.logger.section("Configuration",[`Name: ${e}`,`Description: ${o}`,`Output: ${n}`,`Template: ${t.fastmcp?"FastMCP":"Standard"}`,`CI/CD: ${t.cicd}`,`Deployment: ${t.deployment}`]);return}if(await p.default.pathExists(n)){let{overwrite:r}=await E.default.prompt([{type:"confirm",name:"overwrite",message:`Directory ${n} already exists. Overwrite?`,default:!1}]);if(!r){d.logger.warn("Cancelled");return}await p.default.remove(n)}d.logger.startSpinner("Creating MCP structure...");try{await p.default.ensureDir(n);let r=`[project]
3
+ name = "mcp-${e}"
4
+ version = "0.1.0"
5
+ description = "${o}"
6
+ requires-python = ">=3.10"
7
+ dependencies = [
8
+ "fastmcp>=2.2.0",
9
+ ]
10
+
11
+ [project.optional-dependencies]
12
+ dev = [
13
+ "pytest>=7.0.0",
14
+ "black>=23.0.0",
15
+ "ruff>=0.1.0",
16
+ ]
17
+
18
+ [build-system]
19
+ requires = ["hatchling"]
20
+ build-backend = "hatchling.build"
21
+
22
+ [tool.black]
23
+ line-length = 100
24
+
25
+ [tool.ruff]
26
+ line-length = 100
27
+ `;await p.default.writeFile(m.default.join(n,"pyproject.toml"),r,"utf-8");let a=`"""
28
+ ${e} MCP Server
29
+
30
+ ${o}
31
+ """
32
+ from fastmcp import FastMCP
33
+
34
+ mcp = FastMCP("${e}")
35
+
36
+
37
+ @mcp.tool()
38
+ def add_numbers(a: int, b: int) -> int:
39
+ """Add two numbers together"""
40
+ return a + b
41
+
42
+
43
+ @mcp.tool()
44
+ async def process_message(message: str) -> str:
45
+ """Process a message and return the result"""
46
+ return f"Processed: {message}"
47
+
48
+
49
+ @mcp.resource("config://version")
50
+ def get_version() -> str:
51
+ """Get the current version of the MCP server"""
52
+ return "0.1.0"
53
+
54
+
55
+ @mcp.resource("example://data/{item_id}")
56
+ async def get_item(item_id: str) -> str:
57
+ """Get an item by ID"""
58
+ return f"Item data for: {item_id}"
59
+
60
+
61
+ @mcp.prompt()
62
+ def review_code(code: str) -> str:
63
+ """Generate a code review prompt"""
64
+ return f"""Please review this code:
65
+
66
+ \`\`\`python
67
+ {code}
68
+ \`\`\`
69
+
70
+ Provide feedback on:
71
+ 1. Code quality
72
+ 2. Potential bugs
73
+ 3. Performance improvements
74
+ 4. Best practices
75
+ """
76
+
77
+
78
+ @mcp.prompt()
79
+ def brainstorm_topic(topic: str) -> str:
80
+ """Generate a brainstorming prompt"""
81
+ return f"Let's brainstorm ideas about: {topic}"
82
+
83
+
84
+ if __name__ == "__main__":
85
+ mcp.run()
86
+ `;await p.default.writeFile(m.default.join(n,"server.py"),a,"utf-8");let c=`# ${e} MCP Server
87
+
88
+ ${o}
89
+
90
+ ## Quick Start with Docker
91
+
92
+ \`\`\`bash
93
+ # Start the MCP server
94
+ docker-compose up
95
+
96
+ # In another terminal, test it
97
+ docker-compose exec mcp python server.py
98
+ \`\`\`
99
+
100
+ ## Local Development
101
+
102
+ ### Prerequisites
103
+
104
+ - Python 3.10+
105
+ - uv (recommended) or pip
106
+
107
+ ### Installation
108
+
109
+ \`\`\`bash
110
+ # Using uv (recommended)
111
+ uv pip install -e .
112
+
113
+ # Or using pip
114
+ pip install -e .
115
+ \`\`\`
116
+
117
+ ### Running the Server
118
+
119
+ \`\`\`bash
120
+ # Development mode with MCP Inspector
121
+ fastmcp dev server.py
122
+
123
+ # Direct execution
124
+ python server.py
125
+
126
+ # Install to Claude Desktop
127
+ fastmcp install server.py
128
+ \`\`\`
129
+
130
+ ## Usage with Claude Code
131
+
132
+ Add to your Claude Code settings (\`~/.config/claude/config.json\`):
133
+
134
+ \`\`\`json
135
+ {
136
+ "mcpServers": {
137
+ "${e}": {
138
+ "command": "python",
139
+ "args": ["/path/to/server.py"]
140
+ }
141
+ }
78
142
  }
79
- catch (error) {
80
- if (error.code !== 'commander.help' && error.code !== 'commander.version') {
81
- core_1.logger.error(error.message || 'An unexpected error occurred');
82
- process.exit(1);
143
+ \`\`\`
144
+
145
+ Or use the Docker container:
146
+
147
+ \`\`\`json
148
+ {
149
+ "mcpServers": {
150
+ "${e}": {
151
+ "command": "docker",
152
+ "args": ["run", "-i", "mcp-${e}"]
83
153
  }
154
+ }
84
155
  }
156
+ \`\`\`
157
+
158
+ ## Features
159
+
160
+ - **Tools**: Add numbers, process messages
161
+ - **Resources**: Get version, retrieve items by ID
162
+ - **Prompts**: Code review, brainstorming
163
+
164
+ ## Project Structure
165
+
166
+ \`\`\`
167
+ .
168
+ \u251C\u2500\u2500 server.py # Main MCP server
169
+ \u251C\u2500\u2500 pyproject.toml # Python project configuration
170
+ \u251C\u2500\u2500 Dockerfile # Docker image definition
171
+ \u251C\u2500\u2500 docker-compose.yml # Local development setup
172
+ \u2514\u2500\u2500 README.md # This file
173
+ \`\`\`
174
+
175
+ ## Development
176
+
177
+ ### Running Tests
178
+
179
+ \`\`\`bash
180
+ pytest
181
+ \`\`\`
182
+
183
+ ### Code Formatting
184
+
185
+ \`\`\`bash
186
+ black .
187
+ ruff check .
188
+ \`\`\`
189
+
190
+ ## License
191
+
192
+ MIT
193
+ `;await p.default.writeFile(m.default.join(n,"README.md"),c,"utf-8"),await p.default.writeFile(m.default.join(n,"Dockerfile"),`FROM python:3.11-slim
194
+
195
+ WORKDIR /app
196
+
197
+ # Install uv for faster dependency installation
198
+ RUN pip install --no-cache-dir uv
199
+
200
+ # Copy project files
201
+ COPY pyproject.toml .
202
+ COPY server.py .
203
+
204
+ # Install dependencies
205
+ RUN uv pip install --system --no-cache .
206
+
207
+ # Run the MCP server
208
+ CMD ["python", "server.py"]
209
+ `,"utf-8");let h=`version: '3.8'
210
+
211
+ services:
212
+ mcp:
213
+ build: .
214
+ image: mcp-${e}
215
+ container_name: ${e}-mcp
216
+ stdin_open: true
217
+ tty: true
218
+ volumes:
219
+ - .:/app
220
+ environment:
221
+ - PYTHONUNBUFFERED=1
222
+ `;if(await p.default.writeFile(m.default.join(n,"docker-compose.yml"),h,"utf-8"),await p.default.writeFile(m.default.join(n,".dockerignore"),`__pycache__
223
+ *.pyc
224
+ *.pyo
225
+ *.pyd
226
+ .Python
227
+ *.so
228
+ *.egg
229
+ *.egg-info
230
+ dist
231
+ build
232
+ .pytest_cache
233
+ .ruff_cache
234
+ .venv
235
+ venv
236
+ .git
237
+ .github
238
+ README.md
239
+ `,"utf-8"),t.cicd==="github"){await p.default.ensureDir(m.default.join(n,".github","workflows"));let C=`name: Deploy MCP
240
+
241
+ on:
242
+ push:
243
+ branches: [main]
244
+ pull_request:
245
+ branches: [main]
246
+
247
+ jobs:
248
+ build:
249
+ runs-on: ubuntu-latest
250
+ steps:
251
+ - uses: actions/checkout@v4
252
+ - uses: actions/setup-python@v5
253
+ with:
254
+ python-version: '3.11'
255
+
256
+ - name: Install uv
257
+ run: pip install uv
258
+
259
+ - name: Install dependencies
260
+ run: uv pip install --system -e ".[dev]"
261
+
262
+ - name: Run tests
263
+ run: pytest
264
+
265
+ - name: Check code formatting
266
+ run: |
267
+ black --check .
268
+ ruff check .
269
+
270
+ docker:
271
+ runs-on: ubuntu-latest
272
+ needs: build
273
+ steps:
274
+ - uses: actions/checkout@v4
275
+
276
+ - name: Build Docker image
277
+ run: docker build -t mcp-${e}:latest .
278
+
279
+ - name: Test Docker image
280
+ run: docker run --rm mcp-${e}:latest python -c "import fastmcp; print('OK')"
281
+
282
+ deploy:
283
+ needs: [build, docker]
284
+ runs-on: ubuntu-latest
285
+ if: github.ref == 'refs/heads/main'
286
+ steps:
287
+ - uses: actions/checkout@v4
288
+ ${t.deployment==="aws"?`
289
+ - name: Configure AWS credentials
290
+ uses: aws-actions/configure-aws-credentials@v4
291
+ with:
292
+ aws-access-key-id: \${{ secrets.AWS_ACCESS_KEY_ID }}
293
+ aws-secret-access-key: \${{ secrets.AWS_SECRET_ACCESS_KEY }}
294
+ aws-region: us-east-1
295
+
296
+ - name: Login to Amazon ECR
297
+ id: login-ecr
298
+ uses: aws-actions/amazon-ecr-login@v2
299
+
300
+ - name: Build and push Docker image
301
+ env:
302
+ ECR_REGISTRY: \${{ steps.login-ecr.outputs.registry }}
303
+ ECR_REPOSITORY: mcp-${e}
304
+ IMAGE_TAG: \${{ github.sha }}
305
+ run: |
306
+ docker build -t $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG .
307
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG
308
+ docker tag $ECR_REGISTRY/$ECR_REPOSITORY:$IMAGE_TAG $ECR_REGISTRY/$ECR_REPOSITORY:latest
309
+ docker push $ECR_REGISTRY/$ECR_REPOSITORY:latest
310
+ `:""}${t.deployment==="gcp"?`
311
+ - name: Authenticate to Google Cloud
312
+ uses: google-github-actions/auth@v2
313
+ with:
314
+ credentials_json: \${{ secrets.GCP_CREDENTIALS }}
315
+
316
+ - name: Set up Cloud SDK
317
+ uses: google-github-actions/setup-gcloud@v2
318
+
319
+ - name: Build and push Docker image
320
+ run: |
321
+ gcloud builds submit --tag gcr.io/\${{ secrets.GCP_PROJECT_ID }}/mcp-${e}:latest
322
+ `:""}
323
+ `;await p.default.writeFile(m.default.join(n,".github","workflows","deploy.yml"),C,"utf-8")}d.logger.succeedSpinner("MCP created successfully!"),d.logger.section("Next steps",[`1. cd ${n}`,"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"]),d.logger.success(`\u2728 MCP "${e}" ready to use!`)}catch(r){throw d.logger.failSpinner("Failed to create MCP"),r}}var $=u(require("path")),G=u(require("os")),b=u(require("fs-extra")),g=require("@neural-tools/core"),S=u(require("inquirer"));async function _(e,t){g.logger.header(`Generating Claude Command: /${e}`);let o=t.description;o||(o=(await S.default.prompt([{type:"input",name:"description",message:"Description of your command:",default:`Execute ${e}`}])).description);let n;t.global?n=$.default.join(G.default.homedir(),".claude","commands"):n=$.default.resolve(t.output||"./claude/commands");let r=$.default.join(n,`${e}.md`);if(t.dryRun){g.logger.info("Dry run mode - no files will be created"),g.logger.section("Configuration",[`Name: /${e}`,`Description: ${o}`,`Output: ${r}`,`Arguments: ${t.args?.join(", ")||"none"}`,`Allowed Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await b.default.pathExists(r)){let{overwrite:a}=await S.default.prompt([{type:"confirm",name:"overwrite",message:`Command /${e} already exists. Overwrite?`,default:!1}]);if(!a){g.logger.warn("Cancelled");return}}g.logger.startSpinner("Creating Claude command...");try{await b.default.ensureDir(n);let a=["---"];t.args&&t.args.length>0&&a.push(`argument-hint: ${t.args.join(" ")}`),a.push(`description: ${o}`),t.tools&&t.tools.length>0&&(a.push("allowed-tools:"),t.tools.forEach(C=>{a.push(` - ${C}`)})),a.push("---"),a.push("");let c=t.args||[],v=c.map((C,D)=>`$${D+1}`).join(" "),h=c.length>0?`
324
+
325
+ Arguments:
326
+ ${c.map((C,D)=>`- $${D+1}: ${C}`).join(`
327
+ `)}`:"",M=`${a.join(`
328
+ `)}# ${e} Command
329
+
330
+ Execute the ${e} operation${h?":"+h:"."}
331
+
332
+ ${v?`Using arguments: ${v}`:""}
333
+
334
+ Please proceed with the ${e} operation.
335
+ `;await b.default.writeFile(r,M,"utf-8"),g.logger.succeedSpinner("Claude command created successfully!"),g.logger.section("Next steps",[t.global?`Command /${e} is now available globally in Claude Code`:`Add the command to your project by copying ${r}`,"","Usage:",c.length>0?` /${e} ${c.join(" ")}`:` /${e}`]),g.logger.success(`\u2728 Command "/${e}" ready to use!`)}catch(a){throw g.logger.failSpinner("Failed to create command"),a}}var P=u(require("path")),I=u(require("os")),k=u(require("fs-extra")),f=require("@neural-tools/core"),R=u(require("inquirer"));async function F(e,t){f.logger.header(`Generating Claude Agent: ${e}`);let o=t.description;o||(o=(await R.default.prompt([{type:"input",name:"description",message:"Description of your agent:",default:`${e} specialized agent`}])).description);let n;t.global?n=P.default.join(I.default.homedir(),".claude","agents"):n=P.default.resolve(t.output||"./claude/agents");let r=P.default.join(n,`${e}.md`),a=t.model||"sonnet";if(t.dryRun){f.logger.info("Dry run mode - no files will be created"),f.logger.section("Configuration",[`Name: ${e}`,`Description: ${o}`,`Output: ${r}`,`Model: ${a}`,`Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await k.default.pathExists(r)){let{overwrite:c}=await R.default.prompt([{type:"confirm",name:"overwrite",message:`Agent ${e} already exists. Overwrite?`,default:!1}]);if(!c){f.logger.warn("Cancelled");return}}f.logger.startSpinner("Creating Claude agent...");try{await k.default.ensureDir(n);let c=["---"];c.push(`model: claude-${a}-4-5`),t.tools&&t.tools.length>0&&(c.push("tools:"),t.tools.forEach(h=>{c.push(` - ${h}`)})),c.push("---"),c.push("");let v=`${c.join(`
336
+ `)}# ${e} Agent
337
+
338
+ ${o}
339
+
340
+ ## Role
341
+
342
+ You are a specialized agent for ${e} tasks. Your primary responsibilities include:
343
+
344
+ - [Responsibility 1]
345
+ - [Responsibility 2]
346
+ - [Responsibility 3]
347
+
348
+ ## Guidelines
349
+
350
+ When performing ${e} tasks:
351
+
352
+ 1. [Guideline 1]
353
+ 2. [Guideline 2]
354
+ 3. [Guideline 3]
355
+
356
+ ## Output Format
357
+
358
+ Provide clear, structured responses that:
359
+ - [Output requirement 1]
360
+ - [Output requirement 2]
361
+ - [Output requirement 3]
362
+
363
+ Focus on ${e} and deliver actionable results.
364
+ `;await k.default.writeFile(r,v,"utf-8"),f.logger.succeedSpinner("Claude agent created successfully!"),f.logger.section("Next steps",[t.global?`Agent ${e} is now available globally in Claude Code`:`Add the agent to your project by copying ${r}`,"","Customize the agent by editing:",` ${r}`,"","Use the agent via the Task tool in Claude Code"]),f.logger.success(`\u2728 Agent "${e}" ready to use!`)}catch(c){throw f.logger.failSpinner("Failed to create agent"),c}}var s=require("@neural-tools/core"),j=require("execa"),x=u(require("path")),L=u(require("fs-extra"));async function N(e,t){s.logger.header(`Deploying MCP: ${e}`),await(0,s.requireFeature)("cloud-deployment","Cloud Deployment");let o=t.platform||"aws",n=t.env||"dev";s.logger.info(`Platform: ${o}`),s.logger.info(`Environment: ${n}`);let r=x.default.resolve("./apps",e);if(!await L.default.pathExists(r))throw new Error(`MCP "${e}" not found at ${r}`);s.logger.startSpinner("Building MCP...");try{await(0,j.execa)("npm",["run","build"],{cwd:r,stdio:"pipe"}),s.logger.succeedSpinner("MCP built successfully"),o==="aws"?await X(e,r,t):o==="gcp"&&await Z(e,r,t),s.logger.success(`\u2728 MCP "${e}" deployed successfully!`)}catch(a){throw s.logger.failSpinner("Deployment failed"),a}}async function X(e,t,o){s.logger.startSpinner("Deploying to AWS Lambda..."),s.logger.updateSpinner("Packaging Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),s.logger.updateSpinner("Uploading to S3..."),await new Promise(n=>setTimeout(n,1e3)),s.logger.updateSpinner("Creating/updating Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),s.logger.succeedSpinner("Deployed to AWS Lambda"),s.logger.section("Deployment Info",[`Function: ${e}-${o.env}`,`Region: ${o.region||"us-east-1"}`,`Environment: ${o.env}`,"","Configure in Claude Code:",JSON.stringify({mcpServers:{[e]:{command:"aws",args:["lambda","invoke","--function-name",`${e}-${o.env}`,"--payload","stdin","--output","stdout"]}}},null,2)])}async function Z(e,t,o){s.logger.startSpinner("Deploying to Google Cloud Functions..."),s.logger.updateSpinner("Packaging function..."),await new Promise(n=>setTimeout(n,1e3)),s.logger.updateSpinner("Uploading to Cloud Storage..."),await new Promise(n=>setTimeout(n,1e3)),s.logger.updateSpinner("Deploying Cloud Function..."),await new Promise(n=>setTimeout(n,1e3)),s.logger.succeedSpinner("Deployed to Google Cloud Functions"),s.logger.section("Deployment Info",[`Function: ${e}-${o.env}`,`Region: ${o.region||"us-central1"}`,`Environment: ${o.env}`])}var i=require("@neural-tools/core"),Y=u(require("inquirer"));async function U(e){i.logger.header("AI Toolkit License Management");let t=e.key;if(t||(t=(await Y.default.prompt([{type:"input",name:"licenseKey",message:"Enter your license key:",validate:n=>!n||n.trim().length===0?"License key is required":!0}])).licenseKey),!t){i.logger.error("License key is required");return}i.logger.startSpinner("Validating license...");try{let o=t.split("-");if(o.length<2)throw new Error("Invalid license key format");let n=o[0],r=o[1];if(!Object.values(i.LicenseTier).includes(n))throw new Error("Invalid license tier");await i.licenseManager.saveLicense({tier:n,email:r,key:t,features:[]}),i.logger.succeedSpinner("License activated successfully!");let a=await i.licenseManager.loadLicense();i.logger.section("License Details",[`Tier: ${a.tier.toUpperCase()}`,`Email: ${a.email||"N/A"}`,"Status: Active"]);let c=ee(n);i.logger.section("Available Features",c),n===i.LicenseTier.FREE&&(i.logger.newline(),i.logger.info("Upgrade to Pro for advanced features:"),i.logger.info("https://ai-toolkit.dev/pricing")),i.logger.success("\u2728 Ready to build!")}catch(o){i.logger.failSpinner("License validation failed"),i.logger.error(o.message||"Invalid license key"),i.logger.newline(),i.logger.info("Get a license at: https://ai-toolkit.dev/pricing"),i.logger.info("Or continue with free tier features")}}function ee(e){let t=["\u2713 MCP generation","\u2713 Claude commands","\u2713 Basic templates","\u2713 Local development"],o=[...t,"\u2713 Vector database integration","\u2713 Semantic caching","\u2713 Fine-tuning workflows","\u2713 Cloud deployment (AWS/GCP)","\u2713 Premium templates","\u2713 GitHub automation"],n=[...o,"\u2713 White-label support","\u2713 Custom integrations","\u2713 Priority support","\u2713 SLA guarantee","\u2713 Team collaboration features"];switch(e){case i.LicenseTier.FREE:return t;case i.LicenseTier.PRO:return o;case i.LicenseTier.ENTERPRISE:return n;default:return t}}var l=require("@neural-tools/core");async function q(){l.logger.header("AI Toolkit Status");try{let e=await l.licenseManager.loadLicense();l.logger.section("License Information",[`Tier: ${e.tier.toUpperCase()}`,`Email: ${e.email||"N/A"}`,`Status: ${e.expiresAt?te(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"}],o=await Promise.all(t.map(async n=>`${await l.licenseManager.checkFeature(n.key)?"\u2713":"\u2717"} ${n.name}`));l.logger.section("Feature Availability",o),e.tier===l.LicenseTier.FREE&&(l.logger.newline(),l.logger.info("Unlock more features with Pro or Enterprise:"),l.logger.info("https://ai-toolkit.dev/pricing")),l.logger.newline(),l.logger.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{l.logger.error("Failed to load license information"),l.logger.newline(),l.logger.info('Run "ai-toolkit login" to activate your license'),l.logger.info("Or continue with free tier features")}}function te(e){let t=new Date(e),o=new Date;if(t<o)return"Expired";let n=Math.ceil((t.getTime()-o.getTime())/(1e3*60*60*24));return n<=30?`Active (expires in ${n} days)`:"Active"}var y=new W.Command;y.name("neural-tools").description("Neural Tools - Build MCPs, Claude commands, and AI workflows").version("0.1.0");var A=y.command("generate").alias("g").description("Generate new components (MCP, command, agent, etc.)");A.command("mcp").description("Generate a new MCP server").argument("<name>","Name of the MCP server").option("-d, --description <desc>","Description of the MCP").option("-o, --output <dir>","Output directory","./apps").option("--fastmcp","Use FastMCP template",!0).option("--cicd <provider>","CI/CD provider (github, harness, none)","github").option("--deployment <platform>","Deployment platform (aws, gcp, none)","aws").option("--dry-run","Preview without creating files",!1).action(T);A.command("command").description("Generate a new Claude command").argument("<name>","Name of the command (without /)").option("-d, --description <desc>","Description of the command").option("-o, --output <dir>","Output directory","./claude/commands").option("--args <arguments...>","Command arguments").option("--tools <tools...>","Allowed tools").option("--global","Install globally to ~/.claude/commands",!1).option("--dry-run","Preview without creating files",!1).action(_);A.command("agent").description("Generate a new Claude agent").argument("<name>","Name of the agent").option("-d, --description <desc>","Description of the agent").option("-o, --output <dir>","Output directory","./claude/agents").option("--model <model>","Model to use (sonnet, opus, haiku)","sonnet").option("--tools <tools...>","Available tools").option("--global","Install globally to ~/.claude/agents",!1).option("--dry-run","Preview without creating files",!1).action(F);y.command("deploy").description("Deploy an MCP server").argument("<name>","Name of the MCP to deploy").option("-p, --platform <platform>","Deployment platform (aws, gcp)","aws").option("--region <region>","AWS/GCP region").option("--env <env>","Environment (dev, staging, prod)","dev").action(N);y.command("login").description("Authenticate and manage your license").option("--key <key>","License key").action(U);y.command("status").description("Show license status and available features").action(q);y.exitOverride();try{y.parse(process.argv)}catch(e){e.code!=="commander.help"&&e.code!=="commander.version"&&(B.logger.error(e.message||"An unexpected error occurred"),process.exit(1))}