@neural-tools/cli 0.1.5 → 0.1.6
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 +271 -0
- package/dist/cli.js +9 -9
- package/dist/cli.mjs +10 -10
- package/dist/index.js +9 -9
- package/dist/index.mjs +10 -10
- package/package.json +2 -2
package/LICENSE.md
CHANGED
|
@@ -1,80 +1,21 @@
|
|
|
1
|
-
#
|
|
2
|
-
|
|
3
|
-
Copyright (c) 2025 Luke Amy
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
### 2. Pro/Enterprise License (Proprietary)
|
|
24
|
-
|
|
25
|
-
The following features require a valid Pro or Enterprise license:
|
|
26
|
-
|
|
27
|
-
**Pro Features:**
|
|
28
|
-
- Vector database integration
|
|
29
|
-
- Semantic caching
|
|
30
|
-
- Fine-tuning workflows
|
|
31
|
-
- Cloud deployment templates (AWS/GCP)
|
|
32
|
-
- Premium templates and examples
|
|
33
|
-
- GitHub automation features
|
|
34
|
-
|
|
35
|
-
**Enterprise Features:**
|
|
36
|
-
- White-label support
|
|
37
|
-
- Custom integrations
|
|
38
|
-
- Priority support
|
|
39
|
-
- SLA guarantees
|
|
40
|
-
- Team collaboration features
|
|
41
|
-
|
|
42
|
-
These features are proprietary and may not be used without a valid license key purchased from neural-tools.dev.
|
|
43
|
-
|
|
44
|
-
### License Terms
|
|
45
|
-
|
|
46
|
-
1. **Free Tier**: You may use the free tier features for any purpose, including commercial use, under the MIT License terms.
|
|
47
|
-
|
|
48
|
-
2. **Pro/Enterprise**: You must purchase a license to access Pro or Enterprise features. Each license is:
|
|
49
|
-
- Per-user for individual licenses
|
|
50
|
-
- Per-organization for team/enterprise licenses
|
|
51
|
-
- Non-transferable without written consent
|
|
52
|
-
- Subject to the terms at neural-tools.dev/terms
|
|
53
|
-
|
|
54
|
-
3. **Source Code**: This repository is private. You may not:
|
|
55
|
-
- Redistribute the source code
|
|
56
|
-
- Create derivative works for redistribution
|
|
57
|
-
- Reverse engineer Pro/Enterprise features
|
|
58
|
-
- Remove or circumvent license checks
|
|
59
|
-
|
|
60
|
-
4. **Support**: Support is provided based on your license tier:
|
|
61
|
-
- Free: Community support only
|
|
62
|
-
- Pro: Email support (48-hour response)
|
|
63
|
-
- Enterprise: Priority support with SLA
|
|
64
|
-
|
|
65
|
-
### Warranty Disclaimer
|
|
66
|
-
|
|
67
|
-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
|
68
|
-
|
|
69
|
-
IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
70
|
-
|
|
71
|
-
### Contact
|
|
72
|
-
|
|
73
|
-
For licensing inquiries:
|
|
74
|
-
- Email: licensing@neural-tools.dev
|
|
75
|
-
- Website: https://neural-tools.dev/pricing
|
|
76
|
-
- Support: support@neural-tools.dev
|
|
77
|
-
|
|
78
|
-
---
|
|
79
|
-
|
|
80
|
-
**Last Updated:** January 2025
|
|
1
|
+
# MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Luke Amy
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,271 @@
|
|
|
1
|
+
# @neural-tools/cli
|
|
2
|
+
|
|
3
|
+
> CLI for Neural Tools - Generate MCPs, Claude commands, and AI workflows
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@neural-tools/cli)
|
|
6
|
+
[](../../LICENSE.md)
|
|
7
|
+
|
|
8
|
+
The main CLI tool for Neural Tools, providing commands to generate MCP servers, Claude commands, agents, and deploy AI-powered applications.
|
|
9
|
+
|
|
10
|
+
## Installation
|
|
11
|
+
|
|
12
|
+
### Global Installation (Recommended)
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
npm install -g @neural-tools/cli
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
### Project-specific
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
npm install --save-dev @neural-tools/cli
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
### Using npx (No installation)
|
|
25
|
+
|
|
26
|
+
```bash
|
|
27
|
+
npx @neural-tools/cli <command>
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
## Usage
|
|
31
|
+
|
|
32
|
+
```bash
|
|
33
|
+
neural-tools <command> [options]
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
## Available Commands
|
|
37
|
+
|
|
38
|
+
### `generate mcp`
|
|
39
|
+
|
|
40
|
+
Generate a FastMCP server with Python templates.
|
|
41
|
+
|
|
42
|
+
```bash
|
|
43
|
+
neural-tools generate mcp <name> [options]
|
|
44
|
+
|
|
45
|
+
Options:
|
|
46
|
+
-d, --description <desc> Description of the MCP server
|
|
47
|
+
-o, --output <dir> Output directory (default: ./apps)
|
|
48
|
+
--cicd <provider> CI/CD provider (github, harness, none)
|
|
49
|
+
--deployment <platform> Deployment platform (aws, gcp, none)
|
|
50
|
+
--dry-run Preview without creating files
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
**Example:**
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
neural-tools generate mcp github-integration \
|
|
57
|
+
--description "GitHub API integration server" \
|
|
58
|
+
--cicd github \
|
|
59
|
+
--deployment aws
|
|
60
|
+
```
|
|
61
|
+
|
|
62
|
+
This creates:
|
|
63
|
+
- Complete FastMCP server with Python
|
|
64
|
+
- Docker configuration
|
|
65
|
+
- CI/CD workflow files
|
|
66
|
+
- Deployment templates (if specified)
|
|
67
|
+
|
|
68
|
+
---
|
|
69
|
+
|
|
70
|
+
### `generate command`
|
|
71
|
+
|
|
72
|
+
Generate a Claude Code slash command.
|
|
73
|
+
|
|
74
|
+
```bash
|
|
75
|
+
neural-tools generate command <name> [options]
|
|
76
|
+
|
|
77
|
+
Options:
|
|
78
|
+
-d, --description <desc> Description of the command
|
|
79
|
+
-o, --output <dir> Output directory (default: ./claude/commands)
|
|
80
|
+
--args <arguments...> Command arguments
|
|
81
|
+
--tools <tools...> Allowed tools for Claude
|
|
82
|
+
--global Install globally to ~/.claude/commands
|
|
83
|
+
--dry-run Preview without creating files
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
**Example:**
|
|
87
|
+
|
|
88
|
+
```bash
|
|
89
|
+
neural-tools generate command search-docs \
|
|
90
|
+
--description "Search project documentation" \
|
|
91
|
+
--args query \
|
|
92
|
+
--tools "Read" "Grep" "Bash"
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
This creates a slash command that can be used in Claude Code as `/search-docs <query>`.
|
|
96
|
+
|
|
97
|
+
---
|
|
98
|
+
|
|
99
|
+
### `generate agent`
|
|
100
|
+
|
|
101
|
+
Generate a specialized Claude agent.
|
|
102
|
+
|
|
103
|
+
```bash
|
|
104
|
+
neural-tools generate agent <name> [options]
|
|
105
|
+
|
|
106
|
+
Options:
|
|
107
|
+
-d, --description <desc> Description of the agent
|
|
108
|
+
-o, --output <dir> Output directory (default: ./claude/agents)
|
|
109
|
+
--model <model> Model to use (sonnet, opus, haiku)
|
|
110
|
+
--tools <tools...> Available tools
|
|
111
|
+
--global Install globally to ~/.claude/agents
|
|
112
|
+
--dry-run Preview without creating files
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Example:**
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
neural-tools generate agent code-reviewer \
|
|
119
|
+
--description "Automated code review agent" \
|
|
120
|
+
--model opus \
|
|
121
|
+
--tools "Read" "Grep" "Edit"
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
---
|
|
125
|
+
|
|
126
|
+
### `deploy`
|
|
127
|
+
|
|
128
|
+
Deploy an MCP server to AWS or GCP.
|
|
129
|
+
|
|
130
|
+
```bash
|
|
131
|
+
neural-tools deploy <name> [options]
|
|
132
|
+
|
|
133
|
+
Options:
|
|
134
|
+
-p, --platform <platform> Deployment platform (aws, gcp)
|
|
135
|
+
--region <region> Cloud region
|
|
136
|
+
--env <env> Environment (dev, staging, prod)
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
**Example:**
|
|
140
|
+
|
|
141
|
+
```bash
|
|
142
|
+
neural-tools deploy github-integration \
|
|
143
|
+
--platform aws \
|
|
144
|
+
--region us-east-1 \
|
|
145
|
+
--env production
|
|
146
|
+
```
|
|
147
|
+
|
|
148
|
+
---
|
|
149
|
+
|
|
150
|
+
### `login`
|
|
151
|
+
|
|
152
|
+
Manage your Neural Tools license (optional).
|
|
153
|
+
|
|
154
|
+
```bash
|
|
155
|
+
neural-tools login [options]
|
|
156
|
+
|
|
157
|
+
Options:
|
|
158
|
+
--key <key> License key
|
|
159
|
+
```
|
|
160
|
+
|
|
161
|
+
**Note:** All features are free and available without a license.
|
|
162
|
+
|
|
163
|
+
---
|
|
164
|
+
|
|
165
|
+
### `status`
|
|
166
|
+
|
|
167
|
+
View current status and available features.
|
|
168
|
+
|
|
169
|
+
```bash
|
|
170
|
+
neural-tools status
|
|
171
|
+
```
|
|
172
|
+
|
|
173
|
+
Shows:
|
|
174
|
+
- License information (if configured)
|
|
175
|
+
- Available features (all features are enabled)
|
|
176
|
+
- Quick start commands
|
|
177
|
+
|
|
178
|
+
## Project Structure
|
|
179
|
+
|
|
180
|
+
When you use the CLI, it creates organized project structures:
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
my-project/
|
|
184
|
+
├── apps/ # Generated MCP servers
|
|
185
|
+
│ └── mcp-github/
|
|
186
|
+
│ ├── server.py
|
|
187
|
+
│ ├── Dockerfile
|
|
188
|
+
│ └── requirements.txt
|
|
189
|
+
├── claude/
|
|
190
|
+
│ ├── commands/ # Slash commands
|
|
191
|
+
│ │ └── search-docs.md
|
|
192
|
+
│ └── agents/ # Specialized agents
|
|
193
|
+
│ └── code-reviewer.md
|
|
194
|
+
└── package.json
|
|
195
|
+
```
|
|
196
|
+
|
|
197
|
+
## Configuration
|
|
198
|
+
|
|
199
|
+
The CLI reads configuration from:
|
|
200
|
+
- `package.json` (workspace settings)
|
|
201
|
+
- `.env` (environment variables)
|
|
202
|
+
- `~/.ai-toolkit/` (user settings)
|
|
203
|
+
|
|
204
|
+
## Development
|
|
205
|
+
|
|
206
|
+
```bash
|
|
207
|
+
# Clone the repository
|
|
208
|
+
git clone https://github.com/MacLeanLuke/neural-tools.git
|
|
209
|
+
cd neural-tools/packages/cli
|
|
210
|
+
|
|
211
|
+
# Install dependencies
|
|
212
|
+
pnpm install
|
|
213
|
+
|
|
214
|
+
# Build
|
|
215
|
+
pnpm build
|
|
216
|
+
|
|
217
|
+
# Run locally
|
|
218
|
+
node dist/cli.js --help
|
|
219
|
+
```
|
|
220
|
+
|
|
221
|
+
## Examples
|
|
222
|
+
|
|
223
|
+
### Create a GitHub MCP Server
|
|
224
|
+
|
|
225
|
+
```bash
|
|
226
|
+
neural-tools generate mcp github \
|
|
227
|
+
--description "GitHub API integration" \
|
|
228
|
+
--cicd github \
|
|
229
|
+
--deployment aws
|
|
230
|
+
```
|
|
231
|
+
|
|
232
|
+
### Create a Knowledge Base Search Command
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
neural-tools generate command search-kb \
|
|
236
|
+
--description "Search vector database" \
|
|
237
|
+
--args query \
|
|
238
|
+
--tools "Read" "Bash"
|
|
239
|
+
```
|
|
240
|
+
|
|
241
|
+
### Deploy to AWS
|
|
242
|
+
|
|
243
|
+
```bash
|
|
244
|
+
neural-tools deploy github \
|
|
245
|
+
--platform aws \
|
|
246
|
+
--region us-east-1 \
|
|
247
|
+
--env prod
|
|
248
|
+
```
|
|
249
|
+
|
|
250
|
+
## Dependencies
|
|
251
|
+
|
|
252
|
+
- [@neural-tools/core](../core) - Core utilities and types
|
|
253
|
+
- commander - CLI framework
|
|
254
|
+
- inquirer - Interactive prompts
|
|
255
|
+
- execa - Process execution
|
|
256
|
+
- fs-extra - Enhanced file system operations
|
|
257
|
+
|
|
258
|
+
## Contributing
|
|
259
|
+
|
|
260
|
+
Contributions are welcome! See the [main repository](https://github.com/MacLeanLuke/neural-tools) for guidelines.
|
|
261
|
+
|
|
262
|
+
## License
|
|
263
|
+
|
|
264
|
+
MIT - See [LICENSE.md](../../LICENSE.md) for details.
|
|
265
|
+
|
|
266
|
+
## Links
|
|
267
|
+
|
|
268
|
+
- [Documentation](https://neural-tools.com/docs/cli.html)
|
|
269
|
+
- [GitHub](https://github.com/MacLeanLuke/neural-tools)
|
|
270
|
+
- [npm](https://www.npmjs.com/package/@neural-tools/cli)
|
|
271
|
+
- [Issues](https://github.com/MacLeanLuke/neural-tools/issues)
|
package/dist/cli.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
"use strict";var
|
|
2
|
+
"use strict";var B=Object.create;var _=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&&_(e,r,{get:()=>t[r],enumerable:!(n=z(t,r))||n.enumerable});return e};var l=(e,t,o)=>(o=e!=null?B(H(e)):{},Q(t||!e||!e.__esModule?_(o,"default",{value:e,enumerable:!0}):o,e));var W=require("commander"),K=require("@neural-tools/core");var m=l(require("path")),p=l(require("fs-extra")),d=require("@neural-tools/core"),S=l(require("inquirer"));async function G(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 S.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 S.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
3
|
name = "mcp-${e}"
|
|
4
4
|
version = "0.1.0"
|
|
5
5
|
description = "${o}"
|
|
@@ -24,7 +24,7 @@ line-length = 100
|
|
|
24
24
|
|
|
25
25
|
[tool.ruff]
|
|
26
26
|
line-length = 100
|
|
27
|
-
`;await p.default.writeFile(m.default.join(n,"pyproject.toml"),r,"utf-8");let
|
|
27
|
+
`;await p.default.writeFile(m.default.join(n,"pyproject.toml"),r,"utf-8");let i=`"""
|
|
28
28
|
${e} MCP Server
|
|
29
29
|
|
|
30
30
|
${o}
|
|
@@ -83,7 +83,7 @@ def brainstorm_topic(topic: str) -> str:
|
|
|
83
83
|
|
|
84
84
|
if __name__ == "__main__":
|
|
85
85
|
mcp.run()
|
|
86
|
-
`;await p.default.writeFile(m.default.join(n,"server.py"),
|
|
86
|
+
`;await p.default.writeFile(m.default.join(n,"server.py"),i,"utf-8");let s=`# ${e} MCP Server
|
|
87
87
|
|
|
88
88
|
${o}
|
|
89
89
|
|
|
@@ -190,7 +190,7 @@ ruff check .
|
|
|
190
190
|
## License
|
|
191
191
|
|
|
192
192
|
MIT
|
|
193
|
-
`;await p.default.writeFile(m.default.join(n,"README.md"),
|
|
193
|
+
`;await p.default.writeFile(m.default.join(n,"README.md"),s,"utf-8"),await p.default.writeFile(m.default.join(n,"Dockerfile"),`FROM python:3.11-slim
|
|
194
194
|
|
|
195
195
|
WORKDIR /app
|
|
196
196
|
|
|
@@ -320,11 +320,11 @@ jobs:
|
|
|
320
320
|
run: |
|
|
321
321
|
gcloud builds submit --tag gcr.io/\${{ secrets.GCP_PROJECT_ID }}/mcp-${e}:latest
|
|
322
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 $=
|
|
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 $=l(require("path")),O=l(require("os")),b=l(require("fs-extra")),g=require("@neural-tools/core"),R=l(require("inquirer"));async function T(e,t){g.logger.header(`Generating Claude Command: /${e}`);let o=t.description;o||(o=(await R.default.prompt([{type:"input",name:"description",message:"Description of your command:",default:`Execute ${e}`}])).description);let n;t.global?n=$.default.join(O.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:i}=await R.default.prompt([{type:"confirm",name:"overwrite",message:`Command /${e} already exists. Overwrite?`,default:!1}]);if(!i){g.logger.warn("Cancelled");return}}g.logger.startSpinner("Creating Claude command...");try{await b.default.ensureDir(n);let i=["---"];t.args&&t.args.length>0&&i.push(`argument-hint: ${t.args.join(" ")}`),i.push(`description: ${o}`),t.tools&&t.tools.length>0&&(i.push("allowed-tools:"),t.tools.forEach(C=>{i.push(` - ${C}`)})),i.push("---"),i.push("");let s=t.args||[],v=s.map((C,D)=>`$${D+1}`).join(" "),h=s.length>0?`
|
|
324
324
|
|
|
325
325
|
Arguments:
|
|
326
|
-
${
|
|
327
|
-
`)}`:"",M=`${
|
|
326
|
+
${s.map((C,D)=>`- $${D+1}: ${C}`).join(`
|
|
327
|
+
`)}`:"",M=`${i.join(`
|
|
328
328
|
`)}# ${e} Command
|
|
329
329
|
|
|
330
330
|
Execute the ${e} operation${h?":"+h:"."}
|
|
@@ -332,7 +332,7 @@ Execute the ${e} operation${h?":"+h:"."}
|
|
|
332
332
|
${v?`Using arguments: ${v}`:""}
|
|
333
333
|
|
|
334
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:",
|
|
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:",s.length>0?` /${e} ${s.join(" ")}`:` /${e}`]),g.logger.success(`\u2728 Command "/${e}" ready to use!`)}catch(i){throw g.logger.failSpinner("Failed to create command"),i}}var P=l(require("path")),I=l(require("os")),k=l(require("fs-extra")),f=require("@neural-tools/core"),E=l(require("inquirer"));async function F(e,t){f.logger.header(`Generating Claude Agent: ${e}`);let o=t.description;o||(o=(await E.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`),i=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: ${i}`,`Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await k.default.pathExists(r)){let{overwrite:s}=await E.default.prompt([{type:"confirm",name:"overwrite",message:`Agent ${e} already exists. Overwrite?`,default:!1}]);if(!s){f.logger.warn("Cancelled");return}}f.logger.startSpinner("Creating Claude agent...");try{await k.default.ensureDir(n);let s=["---"];s.push(`model: claude-${i}-4-5`),t.tools&&t.tools.length>0&&(s.push("tools:"),t.tools.forEach(h=>{s.push(` - ${h}`)})),s.push("---"),s.push("");let v=`${s.join(`
|
|
336
336
|
`)}# ${e} Agent
|
|
337
337
|
|
|
338
338
|
${o}
|
|
@@ -361,4 +361,4 @@ Provide clear, structured responses that:
|
|
|
361
361
|
- [Output requirement 3]
|
|
362
362
|
|
|
363
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(
|
|
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(s){throw f.logger.failSpinner("Failed to create agent"),s}}var a=require("@neural-tools/core"),j=require("execa"),x=l(require("path")),L=l(require("fs-extra"));async function N(e,t){a.logger.header(`Deploying MCP: ${e}`),await(0,a.requireFeature)("cloud-deployment","Cloud Deployment");let o=t.platform||"aws",n=t.env||"dev";a.logger.info(`Platform: ${o}`),a.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}`);a.logger.startSpinner("Building MCP...");try{await(0,j.execa)("npm",["run","build"],{cwd:r,stdio:"pipe"}),a.logger.succeedSpinner("MCP built successfully"),o==="aws"?await X(e,r,t):o==="gcp"&&await Z(e,r,t),a.logger.success(`\u2728 MCP "${e}" deployed successfully!`)}catch(i){throw a.logger.failSpinner("Deployment failed"),i}}async function X(e,t,o){a.logger.startSpinner("Deploying to AWS Lambda..."),a.logger.updateSpinner("Packaging Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Uploading to S3..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Creating/updating Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.succeedSpinner("Deployed to AWS Lambda"),a.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){a.logger.startSpinner("Deploying to Google Cloud Functions..."),a.logger.updateSpinner("Packaging function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Uploading to Cloud Storage..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.updateSpinner("Deploying Cloud Function..."),await new Promise(n=>setTimeout(n,1e3)),a.logger.succeedSpinner("Deployed to Google Cloud Functions"),a.logger.section("Deployment Info",[`Function: ${e}-${o.env}`,`Region: ${o.region||"us-central1"}`,`Environment: ${o.env}`])}var c=require("@neural-tools/core"),Y=l(require("inquirer"));async function q(e){c.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){c.logger.error("License key is required");return}c.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(c.LicenseTier).includes(n))throw new Error("Invalid license tier");await c.licenseManager.saveLicense({tier:n,email:r,key:t,features:[]}),c.logger.succeedSpinner("License activated successfully!");let i=await c.licenseManager.loadLicense();c.logger.section("License Details",[`Tier: ${i.tier.toUpperCase()}`,`Email: ${i.email||"N/A"}`,"Status: Active"]);let s=ee();c.logger.section("Available Features",s),c.logger.success("\u2728 Ready to build!")}catch(o){c.logger.failSpinner("License validation failed"),c.logger.error(o.message||"Invalid license key"),c.logger.newline(),c.logger.info("All features are available for free - no license required!")}}function ee(){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"]}var u=require("@neural-tools/core");async function U(){u.logger.header("AI Toolkit Status");try{let e=await u.licenseManager.loadLicense();u.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 u.licenseManager.checkFeature(n.key)?"\u2713":"\u2717"} ${n.name}`));u.logger.section("Feature Availability",o),u.logger.newline(),u.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{u.logger.error("Failed to load license information"),u.logger.newline(),u.logger.info("All features are available - no license required!"),u.logger.info('Run "ai-toolkit --help" to get started')}}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(G);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(T);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(q);y.command("status").description("Show license status and available features").action(U);y.exitOverride();try{y.parse(process.argv)}catch(e){e.code!=="commander.help"&&e.code!=="commander.version"&&(K.logger.error(e.message||"An unexpected error occurred"),process.exit(1))}
|
package/dist/cli.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
|
-
import{Command as
|
|
2
|
+
import{Command as X}from"commander";import{logger as Z}from"@neural-tools/core";import u from"path";import c from"fs-extra";import{logger as p,requireFeature as L}from"@neural-tools/core";import E from"inquirer";async function A(e,t){p.header(`Generating MCP: ${e}`),t.deployment!=="none"&&await L("cloud-deployment","Cloud Deployment");let o=t.description;o||(o=(await E.prompt([{type:"input",name:"description",message:"Description of your MCP:",default:`${e} MCP server`}])).description);let n=u.resolve(t.output||"./apps",e);if(t.dryRun){p.info("Dry run mode - no files will be created"),p.section("Configuration",[`Name: ${e}`,`Description: ${o}`,`Output: ${n}`,`Template: ${t.fastmcp?"FastMCP":"Standard"}`,`CI/CD: ${t.cicd}`,`Deployment: ${t.deployment}`]);return}if(await c.pathExists(n)){let{overwrite:r}=await E.prompt([{type:"confirm",name:"overwrite",message:`Directory ${n} already exists. Overwrite?`,default:!1}]);if(!r){p.warn("Cancelled");return}await c.remove(n)}p.startSpinner("Creating MCP structure...");try{await c.ensureDir(n);let r=`[project]
|
|
3
3
|
name = "mcp-${e}"
|
|
4
4
|
version = "0.1.0"
|
|
5
5
|
description = "${o}"
|
|
@@ -24,7 +24,7 @@ line-length = 100
|
|
|
24
24
|
|
|
25
25
|
[tool.ruff]
|
|
26
26
|
line-length = 100
|
|
27
|
-
`;await
|
|
27
|
+
`;await c.writeFile(u.join(n,"pyproject.toml"),r,"utf-8");let i=`"""
|
|
28
28
|
${e} MCP Server
|
|
29
29
|
|
|
30
30
|
${o}
|
|
@@ -83,7 +83,7 @@ def brainstorm_topic(topic: str) -> str:
|
|
|
83
83
|
|
|
84
84
|
if __name__ == "__main__":
|
|
85
85
|
mcp.run()
|
|
86
|
-
`;await
|
|
86
|
+
`;await c.writeFile(u.join(n,"server.py"),i,"utf-8");let a=`# ${e} MCP Server
|
|
87
87
|
|
|
88
88
|
${o}
|
|
89
89
|
|
|
@@ -190,7 +190,7 @@ ruff check .
|
|
|
190
190
|
## License
|
|
191
191
|
|
|
192
192
|
MIT
|
|
193
|
-
`;await
|
|
193
|
+
`;await c.writeFile(u.join(n,"README.md"),a,"utf-8"),await c.writeFile(u.join(n,"Dockerfile"),`FROM python:3.11-slim
|
|
194
194
|
|
|
195
195
|
WORKDIR /app
|
|
196
196
|
|
|
@@ -219,7 +219,7 @@ services:
|
|
|
219
219
|
- .:/app
|
|
220
220
|
environment:
|
|
221
221
|
- PYTHONUNBUFFERED=1
|
|
222
|
-
`;if(await
|
|
222
|
+
`;if(await c.writeFile(u.join(n,"docker-compose.yml"),y,"utf-8"),await c.writeFile(u.join(n,".dockerignore"),`__pycache__
|
|
223
223
|
*.pyc
|
|
224
224
|
*.pyo
|
|
225
225
|
*.pyd
|
|
@@ -236,7 +236,7 @@ venv
|
|
|
236
236
|
.git
|
|
237
237
|
.github
|
|
238
238
|
README.md
|
|
239
|
-
`,"utf-8"),t.cicd==="github"){await
|
|
239
|
+
`,"utf-8"),t.cicd==="github"){await c.ensureDir(u.join(n,".github","workflows"));let h=`name: Deploy MCP
|
|
240
240
|
|
|
241
241
|
on:
|
|
242
242
|
push:
|
|
@@ -320,10 +320,10 @@ jobs:
|
|
|
320
320
|
run: |
|
|
321
321
|
gcloud builds submit --tag gcr.io/\${{ secrets.GCP_PROJECT_ID }}/mcp-${e}:latest
|
|
322
322
|
`:""}
|
|
323
|
-
`;await
|
|
323
|
+
`;await c.writeFile(u.join(n,".github","workflows","deploy.yml"),h,"utf-8")}p.succeedSpinner("MCP created successfully!"),p.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"]),p.success(`\u2728 MCP "${e}" ready to use!`)}catch(r){throw p.failSpinner("Failed to create MCP"),r}}import b from"path";import N from"os";import P from"fs-extra";import{logger as d}from"@neural-tools/core";import M from"inquirer";async function _(e,t){d.header(`Generating Claude Command: /${e}`);let o=t.description;o||(o=(await M.prompt([{type:"input",name:"description",message:"Description of your command:",default:`Execute ${e}`}])).description);let n;t.global?n=b.join(N.homedir(),".claude","commands"):n=b.resolve(t.output||"./claude/commands");let r=b.join(n,`${e}.md`);if(t.dryRun){d.info("Dry run mode - no files will be created"),d.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 P.pathExists(r)){let{overwrite:i}=await M.prompt([{type:"confirm",name:"overwrite",message:`Command /${e} already exists. Overwrite?`,default:!1}]);if(!i){d.warn("Cancelled");return}}d.startSpinner("Creating Claude command...");try{await P.ensureDir(n);let i=["---"];t.args&&t.args.length>0&&i.push(`argument-hint: ${t.args.join(" ")}`),i.push(`description: ${o}`),t.tools&&t.tools.length>0&&(i.push("allowed-tools:"),t.tools.forEach(h=>{i.push(` - ${h}`)})),i.push("---"),i.push("");let a=t.args||[],v=a.map((h,$)=>`$${$+1}`).join(" "),y=a.length>0?`
|
|
324
324
|
|
|
325
325
|
Arguments:
|
|
326
|
-
${a.map((h
|
|
326
|
+
${a.map((h,$)=>`- $${$+1}: ${h}`).join(`
|
|
327
327
|
`)}`:"",R=`${i.join(`
|
|
328
328
|
`)}# ${e} Command
|
|
329
329
|
|
|
@@ -332,7 +332,7 @@ Execute the ${e} operation${y?":"+y:"."}
|
|
|
332
332
|
${v?`Using arguments: ${v}`:""}
|
|
333
333
|
|
|
334
334
|
Please proceed with the ${e} operation.
|
|
335
|
-
`;await
|
|
335
|
+
`;await P.writeFile(r,R,"utf-8"),d.succeedSpinner("Claude command created successfully!"),d.section("Next steps",[t.global?`Command /${e} is now available globally in Claude Code`:`Add the command to your project by copying ${r}`,"","Usage:",a.length>0?` /${e} ${a.join(" ")}`:` /${e}`]),d.success(`\u2728 Command "/${e}" ready to use!`)}catch(i){throw d.failSpinner("Failed to create command"),i}}import k from"path";import Y from"os";import D from"fs-extra";import{logger as m}from"@neural-tools/core";import G from"inquirer";async function O(e,t){m.header(`Generating Claude Agent: ${e}`);let o=t.description;o||(o=(await G.prompt([{type:"input",name:"description",message:"Description of your agent:",default:`${e} specialized agent`}])).description);let n;t.global?n=k.join(Y.homedir(),".claude","agents"):n=k.resolve(t.output||"./claude/agents");let r=k.join(n,`${e}.md`),i=t.model||"sonnet";if(t.dryRun){m.info("Dry run mode - no files will be created"),m.section("Configuration",[`Name: ${e}`,`Description: ${o}`,`Output: ${r}`,`Model: ${i}`,`Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await D.pathExists(r)){let{overwrite:a}=await G.prompt([{type:"confirm",name:"overwrite",message:`Agent ${e} already exists. Overwrite?`,default:!1}]);if(!a){m.warn("Cancelled");return}}m.startSpinner("Creating Claude agent...");try{await D.ensureDir(n);let a=["---"];a.push(`model: claude-${i}-4-5`),t.tools&&t.tools.length>0&&(a.push("tools:"),t.tools.forEach(y=>{a.push(` - ${y}`)})),a.push("---"),a.push("");let v=`${a.join(`
|
|
336
336
|
`)}# ${e} Agent
|
|
337
337
|
|
|
338
338
|
${o}
|
|
@@ -361,4 +361,4 @@ Provide clear, structured responses that:
|
|
|
361
361
|
- [Output requirement 3]
|
|
362
362
|
|
|
363
363
|
Focus on ${e} and deliver actionable results.
|
|
364
|
-
`;await
|
|
364
|
+
`;await D.writeFile(r,v,"utf-8"),m.succeedSpinner("Claude agent created successfully!"),m.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"]),m.success(`\u2728 Agent "${e}" ready to use!`)}catch(a){throw m.failSpinner("Failed to create agent"),a}}import{logger as s,requireFeature as q}from"@neural-tools/core";import{execa as U}from"execa";import W from"path";import K from"fs-extra";async function T(e,t){s.header(`Deploying MCP: ${e}`),await q("cloud-deployment","Cloud Deployment");let o=t.platform||"aws",n=t.env||"dev";s.info(`Platform: ${o}`),s.info(`Environment: ${n}`);let r=W.resolve("./apps",e);if(!await K.pathExists(r))throw new Error(`MCP "${e}" not found at ${r}`);s.startSpinner("Building MCP...");try{await U("npm",["run","build"],{cwd:r,stdio:"pipe"}),s.succeedSpinner("MCP built successfully"),o==="aws"?await B(e,r,t):o==="gcp"&&await z(e,r,t),s.success(`\u2728 MCP "${e}" deployed successfully!`)}catch(i){throw s.failSpinner("Deployment failed"),i}}async function B(e,t,o){s.startSpinner("Deploying to AWS Lambda..."),s.updateSpinner("Packaging Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),s.updateSpinner("Uploading to S3..."),await new Promise(n=>setTimeout(n,1e3)),s.updateSpinner("Creating/updating Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),s.succeedSpinner("Deployed to AWS Lambda"),s.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.startSpinner("Deploying to Google Cloud Functions..."),s.updateSpinner("Packaging function..."),await new Promise(n=>setTimeout(n,1e3)),s.updateSpinner("Uploading to Cloud Storage..."),await new Promise(n=>setTimeout(n,1e3)),s.updateSpinner("Deploying Cloud Function..."),await new Promise(n=>setTimeout(n,1e3)),s.succeedSpinner("Deployed to Google Cloud Functions"),s.section("Deployment Info",[`Function: ${e}-${o.env}`,`Region: ${o.region||"us-central1"}`,`Environment: ${o.env}`])}import{logger as l,licenseManager as I,LicenseTier as V}from"@neural-tools/core";import H from"inquirer";async function F(e){l.header("AI Toolkit License Management");let t=e.key;if(t||(t=(await H.prompt([{type:"input",name:"licenseKey",message:"Enter your license key:",validate:n=>!n||n.trim().length===0?"License key is required":!0}])).licenseKey),!t){l.error("License key is required");return}l.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(V).includes(n))throw new Error("Invalid license tier");await I.saveLicense({tier:n,email:r,key:t,features:[]}),l.succeedSpinner("License activated successfully!");let i=await I.loadLicense();l.section("License Details",[`Tier: ${i.tier.toUpperCase()}`,`Email: ${i.email||"N/A"}`,"Status: Active"]);let a=J();l.section("Available Features",a),l.success("\u2728 Ready to build!")}catch(o){l.failSpinner("License validation failed"),l.error(o.message||"Invalid license key"),l.newline(),l.info("All features are available for free - no license required!")}}function J(){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 g,licenseManager as j}from"@neural-tools/core";async function x(){g.header("AI Toolkit Status");try{let e=await j.loadLicense();g.section("License Information",[`Tier: ${e.tier.toUpperCase()}`,`Email: ${e.email||"N/A"}`,`Status: ${e.expiresAt?Q(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 j.checkFeature(n.key)?"\u2713":"\u2717"} ${n.name}`));g.section("Feature Availability",o),g.newline(),g.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{g.error("Failed to load license information"),g.newline(),g.info("All features are available - no license required!"),g.info('Run "ai-toolkit --help" to get started')}}function Q(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 f=new X;f.name("neural-tools").description("Neural Tools - Build MCPs, Claude commands, and AI workflows").version("0.1.0");var S=f.command("generate").alias("g").description("Generate new components (MCP, command, agent, etc.)");S.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(A);S.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(_);S.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(O);f.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(T);f.command("login").description("Authenticate and manage your license").option("--key <key>","License key").action(F);f.command("status").description("Show license status and available features").action(x);f.exitOverride();try{f.parse(process.argv)}catch(e){e.code!=="commander.help"&&e.code!=="commander.version"&&(Z.error(e.message||"An unexpected error occurred"),process.exit(1))}
|
package/dist/index.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
"use strict";var U=Object.create;var v=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var
|
|
1
|
+
"use strict";var U=Object.create;var v=Object.defineProperty;var W=Object.getOwnPropertyDescriptor;var K=Object.getOwnPropertyNames;var B=Object.getPrototypeOf,z=Object.prototype.hasOwnProperty;var V=(e,t)=>{for(var r in t)v(e,r,{get:t[r],enumerable:!0})},_=(e,t,r,n)=>{if(t&&typeof t=="object"||typeof t=="function")for(let i of K(t))!z.call(e,i)&&i!==r&&v(e,i,{get:()=>t[i],enumerable:!(n=W(t,i))||n.enumerable});return e};var l=(e,t,r)=>(r=e!=null?U(B(e)):{},_(t||!e||!e.__esModule?v(r,"default",{value:e,enumerable:!0}):r,e)),H=e=>_(v({},"__esModule",{value:!0}),e);var ee={};V(ee,{deployMCP:()=>L,generateAgent:()=>I,generateCommand:()=>G,generateMCP:()=>M,loginCommand:()=>q,statusCommand:()=>N});module.exports=H(ee);var m=l(require("path")),p=l(require("fs-extra")),d=require("@neural-tools/core"),D=l(require("inquirer"));async function M(e,t){d.logger.header(`Generating MCP: ${e}`),t.deployment!=="none"&&await(0,d.requireFeature)("cloud-deployment","Cloud Deployment");let r=t.description;r||(r=(await D.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: ${r}`,`Output: ${n}`,`Template: ${t.fastmcp?"FastMCP":"Standard"}`,`CI/CD: ${t.cicd}`,`Deployment: ${t.deployment}`]);return}if(await p.default.pathExists(n)){let{overwrite:i}=await D.default.prompt([{type:"confirm",name:"overwrite",message:`Directory ${n} already exists. Overwrite?`,default:!1}]);if(!i){d.logger.warn("Cancelled");return}await p.default.remove(n)}d.logger.startSpinner("Creating MCP structure...");try{await p.default.ensureDir(n);let i=`[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 p.default.writeFile(m.default.join(n,"pyproject.toml"),i,"utf-8");let
|
|
26
|
+
`;await p.default.writeFile(m.default.join(n,"pyproject.toml"),i,"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 p.default.writeFile(m.default.join(n,"server.py"),
|
|
85
|
+
`;await p.default.writeFile(m.default.join(n,"server.py"),o,"utf-8");let a=`# ${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 p.default.writeFile(m.default.join(n,"README.md"),
|
|
192
|
+
`;await p.default.writeFile(m.default.join(n,"README.md"),a,"utf-8"),await p.default.writeFile(m.default.join(n,"Dockerfile"),`FROM python:3.11-slim
|
|
193
193
|
|
|
194
194
|
WORKDIR /app
|
|
195
195
|
|
|
@@ -319,11 +319,11 @@ jobs:
|
|
|
319
319
|
run: |
|
|
320
320
|
gcloud builds submit --tag gcr.io/\${{ secrets.GCP_PROJECT_ID }}/mcp-${e}:latest
|
|
321
321
|
`:""}
|
|
322
|
-
`;await p.default.writeFile(m.default.join(n,".github","workflows","deploy.yml"),h,"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(i){throw d.logger.failSpinner("Failed to create MCP"),i}}var $=
|
|
322
|
+
`;await p.default.writeFile(m.default.join(n,".github","workflows","deploy.yml"),h,"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(i){throw d.logger.failSpinner("Failed to create MCP"),i}}var $=l(require("path")),O=l(require("os")),b=l(require("fs-extra")),g=require("@neural-tools/core"),R=l(require("inquirer"));async function G(e,t){g.logger.header(`Generating Claude Command: /${e}`);let r=t.description;r||(r=(await R.default.prompt([{type:"input",name:"description",message:"Description of your command:",default:`Execute ${e}`}])).description);let n;t.global?n=$.default.join(O.default.homedir(),".claude","commands"):n=$.default.resolve(t.output||"./claude/commands");let i=$.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: ${r}`,`Output: ${i}`,`Arguments: ${t.args?.join(", ")||"none"}`,`Allowed Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await b.default.pathExists(i)){let{overwrite:o}=await R.default.prompt([{type:"confirm",name:"overwrite",message:`Command /${e} already exists. Overwrite?`,default:!1}]);if(!o){g.logger.warn("Cancelled");return}}g.logger.startSpinner("Creating Claude command...");try{await b.default.ensureDir(n);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(h=>{o.push(` - ${h}`)})),o.push("---"),o.push("");let a=t.args||[],w=a.map((h,S)=>`$${S+1}`).join(" "),y=a.length>0?`
|
|
323
323
|
|
|
324
324
|
Arguments:
|
|
325
|
-
${
|
|
326
|
-
`)}`:"",A=`${
|
|
325
|
+
${a.map((h,S)=>`- $${S+1}: ${h}`).join(`
|
|
326
|
+
`)}`:"",A=`${o.join(`
|
|
327
327
|
`)}# ${e} Command
|
|
328
328
|
|
|
329
329
|
Execute the ${e} operation${y?":"+y:"."}
|
|
@@ -331,7 +331,7 @@ Execute the ${e} operation${y?":"+y:"."}
|
|
|
331
331
|
${w?`Using arguments: ${w}`:""}
|
|
332
332
|
|
|
333
333
|
Please proceed with the ${e} operation.
|
|
334
|
-
`;await b.default.writeFile(i,A,"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 ${i}`,"","Usage:",
|
|
334
|
+
`;await b.default.writeFile(i,A,"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 ${i}`,"","Usage:",a.length>0?` /${e} ${a.join(" ")}`:` /${e}`]),g.logger.success(`\u2728 Command "/${e}" ready to use!`)}catch(o){throw g.logger.failSpinner("Failed to create command"),o}}var k=l(require("path")),T=l(require("os")),P=l(require("fs-extra")),f=require("@neural-tools/core"),E=l(require("inquirer"));async function I(e,t){f.logger.header(`Generating Claude Agent: ${e}`);let r=t.description;r||(r=(await E.default.prompt([{type:"input",name:"description",message:"Description of your agent:",default:`${e} specialized agent`}])).description);let n;t.global?n=k.default.join(T.default.homedir(),".claude","agents"):n=k.default.resolve(t.output||"./claude/agents");let i=k.default.join(n,`${e}.md`),o=t.model||"sonnet";if(t.dryRun){f.logger.info("Dry run mode - no files will be created"),f.logger.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${i}`,`Model: ${o}`,`Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await P.default.pathExists(i)){let{overwrite:a}=await E.default.prompt([{type:"confirm",name:"overwrite",message:`Agent ${e} already exists. Overwrite?`,default:!1}]);if(!a){f.logger.warn("Cancelled");return}}f.logger.startSpinner("Creating Claude agent...");try{await P.default.ensureDir(n);let a=["---"];a.push(`model: claude-${o}-4-5`),t.tools&&t.tools.length>0&&(a.push("tools:"),t.tools.forEach(y=>{a.push(` - ${y}`)})),a.push("---"),a.push("");let w=`${a.join(`
|
|
335
335
|
`)}# ${e} Agent
|
|
336
336
|
|
|
337
337
|
${r}
|
|
@@ -360,4 +360,4 @@ Provide clear, structured responses that:
|
|
|
360
360
|
- [Output requirement 3]
|
|
361
361
|
|
|
362
362
|
Focus on ${e} and deliver actionable results.
|
|
363
|
-
`;await P.default.writeFile(i,w,"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 ${i}`,"","Customize the agent by editing:",` ${i}`,"","Use the agent via the Task tool in Claude Code"]),f.logger.success(`\u2728 Agent "${e}" ready to use!`)}catch(
|
|
363
|
+
`;await P.default.writeFile(i,w,"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 ${i}`,"","Customize the agent by editing:",` ${i}`,"","Use the agent via the Task tool in Claude Code"]),f.logger.success(`\u2728 Agent "${e}" ready to use!`)}catch(a){throw f.logger.failSpinner("Failed to create agent"),a}}var s=require("@neural-tools/core"),j=require("execa"),F=l(require("path")),x=l(require("fs-extra"));async function L(e,t){s.logger.header(`Deploying MCP: ${e}`),await(0,s.requireFeature)("cloud-deployment","Cloud Deployment");let r=t.platform||"aws",n=t.env||"dev";s.logger.info(`Platform: ${r}`),s.logger.info(`Environment: ${n}`);let i=F.default.resolve("./apps",e);if(!await x.default.pathExists(i))throw new Error(`MCP "${e}" not found at ${i}`);s.logger.startSpinner("Building MCP...");try{await(0,j.execa)("npm",["run","build"],{cwd:i,stdio:"pipe"}),s.logger.succeedSpinner("MCP built successfully"),r==="aws"?await J(e,i,t):r==="gcp"&&await Q(e,i,t),s.logger.success(`\u2728 MCP "${e}" deployed successfully!`)}catch(o){throw s.logger.failSpinner("Deployment failed"),o}}async function J(e,t,r){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}-${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 Q(e,t,r){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}-${r.env}`,`Region: ${r.region||"us-central1"}`,`Environment: ${r.env}`])}var c=require("@neural-tools/core"),Y=l(require("inquirer"));async function q(e){c.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){c.logger.error("License key is required");return}c.logger.startSpinner("Validating license...");try{let r=t.split("-");if(r.length<2)throw new Error("Invalid license key format");let n=r[0],i=r[1];if(!Object.values(c.LicenseTier).includes(n))throw new Error("Invalid license tier");await c.licenseManager.saveLicense({tier:n,email:i,key:t,features:[]}),c.logger.succeedSpinner("License activated successfully!");let o=await c.licenseManager.loadLicense();c.logger.section("License Details",[`Tier: ${o.tier.toUpperCase()}`,`Email: ${o.email||"N/A"}`,"Status: Active"]);let a=X();c.logger.section("Available Features",a),c.logger.success("\u2728 Ready to build!")}catch(r){c.logger.failSpinner("License validation failed"),c.logger.error(r.message||"Invalid license key"),c.logger.newline(),c.logger.info("All features are available for free - no license required!")}}function X(){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"]}var u=require("@neural-tools/core");async function N(){u.logger.header("AI Toolkit Status");try{let e=await u.licenseManager.loadLicense();u.logger.section("License Information",[`Tier: ${e.tier.toUpperCase()}`,`Email: ${e.email||"N/A"}`,`Status: ${e.expiresAt?Z(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 n=>`${await u.licenseManager.checkFeature(n.key)?"\u2713":"\u2717"} ${n.name}`));u.logger.section("Feature Availability",r),u.logger.newline(),u.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{u.logger.error("Failed to load license information"),u.logger.newline(),u.logger.info("All features are available - no license required!"),u.logger.info('Run "ai-toolkit --help" to get started')}}function Z(e){let t=new Date(e),r=new Date;if(t<r)return"Expired";let n=Math.ceil((t.getTime()-r.getTime())/(1e3*60*60*24));return n<=30?`Active (expires in ${n} days)`:"Active"}0&&(module.exports={deployMCP,generateAgent,generateCommand,generateMCP,loginCommand,statusCommand});
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import u from"path";import c from"fs-extra";import{logger as p,requireFeature as M}from"@neural-tools/core";import D from"inquirer";async function O(e,t){p.header(`Generating MCP: ${e}`),t.deployment!=="none"&&await M("cloud-deployment","Cloud Deployment");let r=t.description;r||(r=(await D.prompt([{type:"input",name:"description",message:"Description of your MCP:",default:`${e} MCP server`}])).description);let n=u.resolve(t.output||"./apps",e);if(t.dryRun){p.info("Dry run mode - no files will be created"),p.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${n}`,`Template: ${t.fastmcp?"FastMCP":"Standard"}`,`CI/CD: ${t.cicd}`,`Deployment: ${t.deployment}`]);return}if(await c.pathExists(n)){let{overwrite:i}=await D.prompt([{type:"confirm",name:"overwrite",message:`Directory ${n} already exists. Overwrite?`,default:!1}]);if(!i){p.warn("Cancelled");return}await c.remove(n)}p.startSpinner("Creating MCP structure...");try{await c.ensureDir(n);let i=`[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
|
|
26
|
+
`;await c.writeFile(u.join(n,"pyproject.toml"),i,"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
|
|
85
|
+
`;await c.writeFile(u.join(n,"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
|
|
192
|
+
`;await c.writeFile(u.join(n,"README.md"),s,"utf-8"),await c.writeFile(u.join(n,"Dockerfile"),`FROM python:3.11-slim
|
|
193
193
|
|
|
194
194
|
WORKDIR /app
|
|
195
195
|
|
|
@@ -218,7 +218,7 @@ services:
|
|
|
218
218
|
- .:/app
|
|
219
219
|
environment:
|
|
220
220
|
- PYTHONUNBUFFERED=1
|
|
221
|
-
`;if(await
|
|
221
|
+
`;if(await c.writeFile(u.join(n,"docker-compose.yml"),f,"utf-8"),await c.writeFile(u.join(n,".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
|
|
238
|
+
`,"utf-8"),t.cicd==="github"){await c.ensureDir(u.join(n,".github","workflows"));let y=`name: Deploy MCP
|
|
239
239
|
|
|
240
240
|
on:
|
|
241
241
|
push:
|
|
@@ -319,10 +319,10 @@ jobs:
|
|
|
319
319
|
run: |
|
|
320
320
|
gcloud builds submit --tag gcr.io/\${{ secrets.GCP_PROJECT_ID }}/mcp-${e}:latest
|
|
321
321
|
`:""}
|
|
322
|
-
`;await
|
|
322
|
+
`;await c.writeFile(u.join(n,".github","workflows","deploy.yml"),y,"utf-8")}p.succeedSpinner("MCP created successfully!"),p.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"]),p.success(`\u2728 MCP "${e}" ready to use!`)}catch(i){throw p.failSpinner("Failed to create MCP"),i}}import $ from"path";import G from"os";import b from"fs-extra";import{logger as d}from"@neural-tools/core";import R from"inquirer";async function T(e,t){d.header(`Generating Claude Command: /${e}`);let r=t.description;r||(r=(await R.prompt([{type:"input",name:"description",message:"Description of your command:",default:`Execute ${e}`}])).description);let n;t.global?n=$.join(G.homedir(),".claude","commands"):n=$.resolve(t.output||"./claude/commands");let i=$.join(n,`${e}.md`);if(t.dryRun){d.info("Dry run mode - no files will be created"),d.section("Configuration",[`Name: /${e}`,`Description: ${r}`,`Output: ${i}`,`Arguments: ${t.args?.join(", ")||"none"}`,`Allowed Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await b.pathExists(i)){let{overwrite:o}=await R.prompt([{type:"confirm",name:"overwrite",message:`Command /${e} already exists. Overwrite?`,default:!1}]);if(!o){d.warn("Cancelled");return}}d.startSpinner("Creating Claude command...");try{await b.ensureDir(n);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(y=>{o.push(` - ${y}`)})),o.push("---"),o.push("");let s=t.args||[],w=s.map((y,v)=>`$${v+1}`).join(" "),f=s.length>0?`
|
|
323
323
|
|
|
324
324
|
Arguments:
|
|
325
|
-
${s.map((y
|
|
325
|
+
${s.map((y,v)=>`- $${v+1}: ${y}`).join(`
|
|
326
326
|
`)}`:"",S=`${o.join(`
|
|
327
327
|
`)}# ${e} Command
|
|
328
328
|
|
|
@@ -331,7 +331,7 @@ Execute the ${e} operation${f?":"+f:"."}
|
|
|
331
331
|
${w?`Using arguments: ${w}`:""}
|
|
332
332
|
|
|
333
333
|
Please proceed with the ${e} operation.
|
|
334
|
-
`;await
|
|
334
|
+
`;await b.writeFile(i,S,"utf-8"),d.succeedSpinner("Claude command created successfully!"),d.section("Next steps",[t.global?`Command /${e} is now available globally in Claude Code`:`Add the command to your project by copying ${i}`,"","Usage:",s.length>0?` /${e} ${s.join(" ")}`:` /${e}`]),d.success(`\u2728 Command "/${e}" ready to use!`)}catch(o){throw d.failSpinner("Failed to create command"),o}}import k from"path";import I from"os";import P from"fs-extra";import{logger as m}from"@neural-tools/core";import E from"inquirer";async function j(e,t){m.header(`Generating Claude Agent: ${e}`);let r=t.description;r||(r=(await E.prompt([{type:"input",name:"description",message:"Description of your agent:",default:`${e} specialized agent`}])).description);let n;t.global?n=k.join(I.homedir(),".claude","agents"):n=k.resolve(t.output||"./claude/agents");let i=k.join(n,`${e}.md`),o=t.model||"sonnet";if(t.dryRun){m.info("Dry run mode - no files will be created"),m.section("Configuration",[`Name: ${e}`,`Description: ${r}`,`Output: ${i}`,`Model: ${o}`,`Tools: ${t.tools?.join(", ")||"all"}`,`Global: ${t.global?"Yes":"No"}`]);return}if(await P.pathExists(i)){let{overwrite:s}=await E.prompt([{type:"confirm",name:"overwrite",message:`Agent ${e} already exists. Overwrite?`,default:!1}]);if(!s){m.warn("Cancelled");return}}m.startSpinner("Creating Claude agent...");try{await P.ensureDir(n);let s=["---"];s.push(`model: claude-${o}-4-5`),t.tools&&t.tools.length>0&&(s.push("tools:"),t.tools.forEach(f=>{s.push(` - ${f}`)})),s.push("---"),s.push("");let w=`${s.join(`
|
|
335
335
|
`)}# ${e} Agent
|
|
336
336
|
|
|
337
337
|
${r}
|
|
@@ -360,4 +360,4 @@ 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 P.writeFile(i,w,"utf-8"),m.succeedSpinner("Claude agent created successfully!"),m.section("Next steps",[t.global?`Agent ${e} is now available globally in Claude Code`:`Add the agent to your project by copying ${i}`,"","Customize the agent by editing:",` ${i}`,"","Use the agent via the Task tool in Claude Code"]),m.success(`\u2728 Agent "${e}" ready to use!`)}catch(s){throw m.failSpinner("Failed to create agent"),s}}import{logger as a,requireFeature as F}from"@neural-tools/core";import{execa as x}from"execa";import L from"path";import Y from"fs-extra";async function q(e,t){a.header(`Deploying MCP: ${e}`),await F("cloud-deployment","Cloud Deployment");let r=t.platform||"aws",n=t.env||"dev";a.info(`Platform: ${r}`),a.info(`Environment: ${n}`);let i=L.resolve("./apps",e);if(!await Y.pathExists(i))throw new Error(`MCP "${e}" not found at ${i}`);a.startSpinner("Building MCP...");try{await x("npm",["run","build"],{cwd:i,stdio:"pipe"}),a.succeedSpinner("MCP built successfully"),r==="aws"?await N(e,i,t):r==="gcp"&&await U(e,i,t),a.success(`\u2728 MCP "${e}" deployed successfully!`)}catch(o){throw a.failSpinner("Deployment failed"),o}}async function N(e,t,r){a.startSpinner("Deploying to AWS Lambda..."),a.updateSpinner("Packaging Lambda function..."),await new Promise(n=>setTimeout(n,1e3)),a.updateSpinner("Uploading to S3..."),await new Promise(n=>setTimeout(n,1e3)),a.updateSpinner("Creating/updating Lambda function..."),await new Promise(n=>setTimeout(n,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 U(e,t,r){a.startSpinner("Deploying to Google Cloud Functions..."),a.updateSpinner("Packaging function..."),await new Promise(n=>setTimeout(n,1e3)),a.updateSpinner("Uploading to Cloud Storage..."),await new Promise(n=>setTimeout(n,1e3)),a.updateSpinner("Deploying Cloud Function..."),await new Promise(n=>setTimeout(n,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 l,licenseManager as A,LicenseTier as W}from"@neural-tools/core";import K from"inquirer";async function B(e){l.header("AI Toolkit License Management");let t=e.key;if(t||(t=(await K.prompt([{type:"input",name:"licenseKey",message:"Enter your license key:",validate:n=>!n||n.trim().length===0?"License key is required":!0}])).licenseKey),!t){l.error("License key is required");return}l.startSpinner("Validating license...");try{let r=t.split("-");if(r.length<2)throw new Error("Invalid license key format");let n=r[0],i=r[1];if(!Object.values(W).includes(n))throw new Error("Invalid license tier");await A.saveLicense({tier:n,email:i,key:t,features:[]}),l.succeedSpinner("License activated successfully!");let o=await A.loadLicense();l.section("License Details",[`Tier: ${o.tier.toUpperCase()}`,`Email: ${o.email||"N/A"}`,"Status: Active"]);let s=z();l.section("Available Features",s),l.success("\u2728 Ready to build!")}catch(r){l.failSpinner("License validation failed"),l.error(r.message||"Invalid license key"),l.newline(),l.info("All features are available for free - no license required!")}}function z(){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 g,licenseManager as _}from"@neural-tools/core";async function V(){g.header("AI Toolkit Status");try{let e=await _.loadLicense();g.section("License Information",[`Tier: ${e.tier.toUpperCase()}`,`Email: ${e.email||"N/A"}`,`Status: ${e.expiresAt?H(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 n=>`${await _.checkFeature(n.key)?"\u2713":"\u2717"} ${n.name}`));g.section("Feature Availability",r),g.newline(),g.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{g.error("Failed to load license information"),g.newline(),g.info("All features are available - no license required!"),g.info('Run "ai-toolkit --help" to get started')}}function H(e){let t=new Date(e),r=new Date;if(t<r)return"Expired";let n=Math.ceil((t.getTime()-r.getTime())/(1e3*60*60*24));return n<=30?`Active (expires in ${n} days)`:"Active"}export{q as deployMCP,j as generateAgent,T as generateCommand,O as generateMCP,B as loginCommand,V 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.6",
|
|
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.6"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/fs-extra": "^11.0.4",
|