@agiflowai/aicode-toolkit 0.6.0
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 +661 -0
- package/README.md +151 -0
- package/dist/cli.cjs +732 -0
- package/dist/cli.d.cts +1 -0
- package/dist/cli.d.ts +1 -0
- package/dist/cli.js +727 -0
- package/dist/index.cjs +17 -0
- package/dist/index.d.cts +282 -0
- package/dist/index.d.ts +282 -0
- package/dist/index.js +4 -0
- package/dist/mcp-Bdxvi2Ej.cjs +4 -0
- package/dist/mcp-BmhiAfeF.js +47 -0
- package/dist/mcp-CZIiB-6Y.js +3 -0
- package/dist/mcp-Dwt8nYQV.cjs +65 -0
- package/dist/services-DNldrNnu.js +739 -0
- package/dist/services-s1vmufE4.cjs +859 -0
- package/package.json +85 -0
package/README.md
ADDED
|
@@ -0,0 +1,151 @@
|
|
|
1
|
+
# @agiflowai/aicode-toolkit
|
|
2
|
+
|
|
3
|
+
AI-powered code toolkit CLI for scaffolding and development workflows.
|
|
4
|
+
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- **Template management**: Initialize templates folder and add templates from remote repositories
|
|
8
|
+
- **Dynamic template discovery**: Automatically finds templates in your workspace
|
|
9
|
+
- **Multiple frameworks**: Support for Next.js, Vite React, and custom boilerplates
|
|
10
|
+
- **Git integration**: Clone templates from GitHub repositories or subdirectories
|
|
11
|
+
|
|
12
|
+
## Installation
|
|
13
|
+
|
|
14
|
+
```bash
|
|
15
|
+
pnpm install @agiflowai/aicode-toolkit
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
Or install globally:
|
|
19
|
+
|
|
20
|
+
```bash
|
|
21
|
+
pnpm install -g @agiflowai/aicode-toolkit
|
|
22
|
+
```
|
|
23
|
+
|
|
24
|
+
## Usage
|
|
25
|
+
|
|
26
|
+
### Initialize Templates
|
|
27
|
+
|
|
28
|
+
The `init` command sets up your templates folder and **automatically downloads official templates** from the AgiFlow repository:
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
# Initialize templates folder and download official templates
|
|
32
|
+
aicode init
|
|
33
|
+
|
|
34
|
+
# Or specify a custom path
|
|
35
|
+
aicode init --path ./my-templates
|
|
36
|
+
|
|
37
|
+
# Skip auto-download if you want to add templates manually
|
|
38
|
+
aicode init --no-download
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
**What `init` does:**
|
|
42
|
+
1. Creates `templates/` folder in your workspace root
|
|
43
|
+
2. Automatically downloads official templates from [AgiFlow/aicode-toolkit](https://github.com/AgiFlow/aicode-toolkit/tree/main/templates)
|
|
44
|
+
3. Creates a README.md with usage instructions
|
|
45
|
+
4. Skips templates that already exist (safe to re-run)
|
|
46
|
+
|
|
47
|
+
**What gets downloaded:**
|
|
48
|
+
- ✅ `nextjs-15-drizzle` - Next.js 15 with App Router, TypeScript, Tailwind CSS 4, Storybook, and optional Drizzle ORM
|
|
49
|
+
- ✅ More templates coming soon...
|
|
50
|
+
|
|
51
|
+
### Add Templates
|
|
52
|
+
|
|
53
|
+
Add templates from GitHub repositories or subdirectories:
|
|
54
|
+
|
|
55
|
+
```bash
|
|
56
|
+
# Add a template from a full repository
|
|
57
|
+
aicode add --name my-template --url https://github.com/yourorg/nextjs-template
|
|
58
|
+
|
|
59
|
+
# Add a template from a repository subdirectory
|
|
60
|
+
aicode add \
|
|
61
|
+
--name nextjs-15-drizzle \
|
|
62
|
+
--url https://github.com/AgiFlow/aicode-toolkit/tree/main/templates/nextjs-15-drizzle
|
|
63
|
+
|
|
64
|
+
# Add to a specific type folder
|
|
65
|
+
aicode add \
|
|
66
|
+
--name react-component \
|
|
67
|
+
--url https://github.com/yourorg/react-component-scaffold \
|
|
68
|
+
--type scaffold
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
**What `add` does:**
|
|
72
|
+
1. Parses GitHub URL to detect full repository vs subdirectory
|
|
73
|
+
2. Downloads template using git clone (full repo) or sparse checkout (subdirectory)
|
|
74
|
+
3. Validates template has required configuration files (scaffold.yaml)
|
|
75
|
+
4. Saves template to your templates folder
|
|
76
|
+
|
|
77
|
+
**Supported URL formats:**
|
|
78
|
+
- Full repository: `https://github.com/user/repo`
|
|
79
|
+
- Subdirectory: `https://github.com/user/repo/tree/branch/path/to/template`
|
|
80
|
+
- With `.git` extension: `https://github.com/user/repo.git`
|
|
81
|
+
|
|
82
|
+
## CLI Commands
|
|
83
|
+
|
|
84
|
+
### `aicode init`
|
|
85
|
+
|
|
86
|
+
Initialize templates folder structure at workspace root.
|
|
87
|
+
|
|
88
|
+
**Options:**
|
|
89
|
+
- `--path <path>`: Custom path for templates folder (default: `./templates`)
|
|
90
|
+
- `--no-download`: Skip automatic download of official templates
|
|
91
|
+
|
|
92
|
+
**Examples:**
|
|
93
|
+
```bash
|
|
94
|
+
# Initialize at default location
|
|
95
|
+
aicode init
|
|
96
|
+
|
|
97
|
+
# Initialize at custom location
|
|
98
|
+
aicode init --path ./custom-templates
|
|
99
|
+
|
|
100
|
+
# Initialize without downloading templates
|
|
101
|
+
aicode init --no-download
|
|
102
|
+
```
|
|
103
|
+
|
|
104
|
+
### `aicode add`
|
|
105
|
+
|
|
106
|
+
Add a template from a GitHub repository.
|
|
107
|
+
|
|
108
|
+
**Options:**
|
|
109
|
+
- `--name <name>`: Name for the template (required)
|
|
110
|
+
- `--url <url>`: GitHub repository URL (required)
|
|
111
|
+
- `--type <type>`: Template type folder (default: auto-detect)
|
|
112
|
+
|
|
113
|
+
**Examples:**
|
|
114
|
+
```bash
|
|
115
|
+
# Add template from full repository
|
|
116
|
+
aicode add --name my-template --url https://github.com/user/repo
|
|
117
|
+
|
|
118
|
+
# Add template from subdirectory
|
|
119
|
+
aicode add \
|
|
120
|
+
--name nextjs-15 \
|
|
121
|
+
--url https://github.com/AgiFlow/aicode-toolkit/tree/main/templates/nextjs-15-drizzle
|
|
122
|
+
|
|
123
|
+
# Specify custom type
|
|
124
|
+
aicode add \
|
|
125
|
+
--name my-scaffold \
|
|
126
|
+
--url https://github.com/user/repo \
|
|
127
|
+
--type scaffold
|
|
128
|
+
```
|
|
129
|
+
|
|
130
|
+
## Template Structure
|
|
131
|
+
|
|
132
|
+
Templates are organized in the `templates/` folder at your workspace root:
|
|
133
|
+
|
|
134
|
+
```
|
|
135
|
+
templates/
|
|
136
|
+
├── nextjs-15-drizzle/
|
|
137
|
+
│ ├── scaffold.yaml # Template configuration
|
|
138
|
+
│ ├── package.json.liquid # Template files with variables
|
|
139
|
+
│ └── ...
|
|
140
|
+
└── README.md
|
|
141
|
+
```
|
|
142
|
+
|
|
143
|
+
Each template must have a `scaffold.yaml` file that defines:
|
|
144
|
+
- Boilerplate configurations
|
|
145
|
+
- Feature scaffolds
|
|
146
|
+
- Variable schemas
|
|
147
|
+
- File includes
|
|
148
|
+
|
|
149
|
+
## License
|
|
150
|
+
|
|
151
|
+
AGPL-3.0
|