kyawthiha-nextjs-agent-cli 1.0.1 β 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +184 -97
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,188 +1,275 @@
|
|
|
1
1
|
# Next.js Fullstack Agent CLI
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
π **AI-powered CLI to build production-ready Next.js fullstack applications using natural language**
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
5
|
+
[](https://www.npmjs.com/package/kyawthiha-nextjs-agent-cli)
|
|
6
|
+
[](https://github.com/kywthiha/nextjs-agent-cli)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
8
|
|
|
9
9
|
---
|
|
10
10
|
|
|
11
|
-
##
|
|
11
|
+
## β¨ Features
|
|
12
12
|
|
|
13
|
-
|
|
13
|
+
- π€ **AI-Powered Development** - Describe what you want, the agent builds it
|
|
14
|
+
- π **Real File Operations** - Creates and modifies files directly in your project
|
|
15
|
+
- π§ **Automated Setup** - Installs dependencies, runs builds, handles database setup
|
|
16
|
+
- β
**Self-Verification** - Detects errors and attempts automatic fixes
|
|
17
|
+
- π **Secure API Key Storage** - Credentials stored locally at `~/.nextjs-agent-cli/cred.json`
|
|
18
|
+
- π¨ **Beautiful CLI** - Interactive prompts with colorful output
|
|
14
19
|
|
|
15
|
-
|
|
16
|
-
- Creates and modifies files directly
|
|
17
|
-
- Runs installs and builds
|
|
18
|
-
- Verifies results through execution
|
|
19
|
-
- Attempts automated fixes when failures occur
|
|
20
|
-
- Pauses for human input when decisions require clarity
|
|
20
|
+
---
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
## π Requirements
|
|
23
23
|
|
|
24
|
-
|
|
24
|
+
- **Node.js** 18 or later
|
|
25
|
+
- **npm** or **pnpm**
|
|
26
|
+
- **Gemini API Key** - Get one from [Google AI Studio](https://aistudio.google.com/)
|
|
27
|
+
- **PostgreSQL** (optional) - Only if your project uses a database
|
|
25
28
|
|
|
26
|
-
|
|
29
|
+
### Search Tools (Recommended)
|
|
27
30
|
|
|
28
|
-
|
|
29
|
-
- Language: TypeScript
|
|
30
|
-
- CLI Framework: Commander, Inquirer
|
|
31
|
-
- Agent: Gemini-powered agentic workflow
|
|
32
|
-
- Planning before execution
|
|
33
|
-
- Real filesystem operations
|
|
34
|
-
- Build and runtime verification
|
|
35
|
-
- Targeted self-repair for failures
|
|
31
|
+
For enhanced code search capabilities, install these CLI tools:
|
|
36
32
|
|
|
37
|
-
|
|
33
|
+
| Tool | Description | Install Guide |
|
|
34
|
+
| ---- | ----------- | ------------- |
|
|
35
|
+
| **ripgrep (rg)** | Fast regex search | [Installation Guide](https://github.com/BurntSushi/ripgrep#installation) |
|
|
36
|
+
| **fd** | Fast file finder | [Installation Guide](https://github.com/sharkdp/fd#installation) |
|
|
37
|
+
|
|
38
|
+
**Quick Install:**
|
|
38
39
|
|
|
39
|
-
|
|
40
|
+
```bash
|
|
41
|
+
# Windows (winget)
|
|
42
|
+
winget install BurntSushi.ripgrep.MSVC
|
|
43
|
+
winget install sharkdp.fd
|
|
40
44
|
|
|
41
|
-
|
|
45
|
+
# macOS (Homebrew)
|
|
46
|
+
brew install ripgrep fd
|
|
42
47
|
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
- A Gemini API key
|
|
48
|
+
# Ubuntu/Debian
|
|
49
|
+
sudo apt install ripgrep fd-find
|
|
50
|
+
```
|
|
47
51
|
|
|
48
52
|
---
|
|
49
53
|
|
|
50
|
-
##
|
|
54
|
+
## π Quick Start
|
|
51
55
|
|
|
52
|
-
|
|
53
|
-
```bash
|
|
54
|
-
git clone https://github.com/kywthiha/nextjs-agent-cli.git
|
|
55
|
-
```
|
|
56
|
+
### Install Globally
|
|
56
57
|
|
|
57
|
-
2. Move into the project directory
|
|
58
58
|
```bash
|
|
59
|
-
|
|
59
|
+
npm install -g kyawthiha-nextjs-agent-cli
|
|
60
60
|
```
|
|
61
61
|
|
|
62
|
-
|
|
63
|
-
```bash
|
|
64
|
-
npm install
|
|
65
|
-
```
|
|
62
|
+
### Set Your API Key (One Time)
|
|
66
63
|
|
|
67
|
-
4. Configure environment variables
|
|
68
64
|
```bash
|
|
69
|
-
|
|
65
|
+
next-agent config set-api-key
|
|
70
66
|
```
|
|
71
67
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
68
|
+
### Start Building
|
|
69
|
+
|
|
70
|
+
```bash
|
|
71
|
+
next-agent start
|
|
75
72
|
```
|
|
76
73
|
|
|
77
74
|
---
|
|
78
75
|
|
|
79
|
-
##
|
|
76
|
+
## π Commands
|
|
77
|
+
|
|
78
|
+
| Command | Description |
|
|
79
|
+
|---------|-------------|
|
|
80
|
+
| `next-agent start` | Start the AI agent to build a new project |
|
|
81
|
+
| `next-agent config set-api-key` | Set or update your Gemini API key |
|
|
82
|
+
| `next-agent config show` | Show current configuration |
|
|
83
|
+
| `next-agent --help` | Display all available commands |
|
|
80
84
|
|
|
81
|
-
Start
|
|
85
|
+
### Start Command Options
|
|
82
86
|
|
|
83
87
|
```bash
|
|
84
|
-
|
|
85
|
-
```
|
|
88
|
+
next-agent start [options]
|
|
86
89
|
|
|
87
|
-
|
|
90
|
+
Options:
|
|
91
|
+
-n, --project-name <name> Project name (created in current directory)
|
|
92
|
+
-m, --max-iterations <num> Maximum agent iterations (default: 500)
|
|
93
|
+
--skip-db Skip PostgreSQL configuration
|
|
94
|
+
--no-verbose Disable verbose logging
|
|
95
|
+
```
|
|
88
96
|
|
|
89
97
|
---
|
|
90
98
|
|
|
91
|
-
## Interactive Workflow
|
|
99
|
+
## π― Interactive Workflow
|
|
92
100
|
|
|
93
|
-
### 1. Project
|
|
101
|
+
### 1. Project Setup
|
|
94
102
|
|
|
95
|
-
Choose where the Next.js project should be created.
|
|
96
103
|
```
|
|
97
|
-
|
|
104
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
105
|
+
β π Next.js Fullstack Agent CLI β
|
|
106
|
+
β Build full-stack apps with AI assistance β
|
|
107
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
108
|
+
|
|
109
|
+
β Ready to build!
|
|
110
|
+
|
|
111
|
+
? What is your project name? my-app
|
|
98
112
|
```
|
|
99
113
|
|
|
100
|
-
|
|
114
|
+
### 2. API Key (First Time Only)
|
|
101
115
|
|
|
102
|
-
|
|
116
|
+
```
|
|
117
|
+
? Please enter your Gemini API Key: ********
|
|
118
|
+
? Save API key for future sessions? Yes
|
|
119
|
+
β API key saved to C:\Users\User\.nextjs-agent-cli\cred.json
|
|
120
|
+
```
|
|
103
121
|
|
|
104
|
-
|
|
105
|
-
- gemini-3-flash-preview
|
|
106
|
-
- gemini-3-pro-preview
|
|
122
|
+
### 3. Model Selection
|
|
107
123
|
|
|
108
|
-
|
|
124
|
+
```
|
|
125
|
+
? Select Gemini Model:
|
|
126
|
+
β― gemini-3-flash-preview
|
|
127
|
+
gemini-3-pro-preview
|
|
128
|
+
```
|
|
109
129
|
|
|
110
|
-
###
|
|
130
|
+
### 4. Database Configuration (Optional)
|
|
111
131
|
|
|
112
|
-
If your project requires a database, configure PostgreSQL:
|
|
113
132
|
```
|
|
114
133
|
--- PostgreSQL Configuration ---
|
|
115
134
|
? Host: localhost
|
|
116
135
|
? Port: 5432
|
|
117
136
|
? Username: postgres
|
|
118
|
-
? Password:
|
|
137
|
+
? Password: postgres
|
|
138
|
+
? Database Name: my-app
|
|
139
|
+
```
|
|
140
|
+
|
|
141
|
+
Use `--skip-db` to skip this step for static sites.
|
|
142
|
+
|
|
143
|
+
### 5. Describe Your App
|
|
144
|
+
|
|
145
|
+
```
|
|
146
|
+
? What do you want to build or modify?
|
|
147
|
+
> Build a todo app with user authentication and task categories
|
|
119
148
|
```
|
|
120
149
|
|
|
121
150
|
The agent will:
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
151
|
+
- π Create an implementation plan
|
|
152
|
+
- β
Execute tasks step by step
|
|
153
|
+
- π Verify builds and runtime
|
|
154
|
+
- π§ Auto-fix errors when possible
|
|
125
155
|
|
|
126
156
|
---
|
|
127
157
|
|
|
128
|
-
|
|
158
|
+
## ποΈ Project Structure
|
|
159
|
+
|
|
160
|
+
After the agent runs, your project will have:
|
|
129
161
|
|
|
130
|
-
Describe what you want to build using natural language.
|
|
131
162
|
```
|
|
132
|
-
|
|
133
|
-
|
|
163
|
+
my-app/
|
|
164
|
+
βββ .agent/
|
|
165
|
+
β βββ plan1.md # Implementation plan
|
|
166
|
+
β βββ task1.md # Task checklist
|
|
167
|
+
βββ src/
|
|
168
|
+
β βββ app/ # Next.js app router
|
|
169
|
+
β βββ components/ # React components
|
|
170
|
+
β βββ lib/ # Utilities
|
|
171
|
+
βββ prisma/ # Database schema (if using DB)
|
|
172
|
+
βββ package.json
|
|
173
|
+
βββ ...
|
|
134
174
|
```
|
|
135
175
|
|
|
136
|
-
The agent will then:
|
|
137
|
-
- Generate an implementation plan (plan.md)
|
|
138
|
-
- Generate a task checklist (task.md)
|
|
139
|
-
- Execute tasks step by step
|
|
140
|
-
- Verify builds and runtime behavior
|
|
141
|
-
- Attempt fixes if errors occur
|
|
142
|
-
|
|
143
176
|
---
|
|
144
177
|
|
|
145
|
-
##
|
|
178
|
+
## βοΈ Configuration
|
|
179
|
+
|
|
180
|
+
### API Key Storage
|
|
146
181
|
|
|
147
|
-
|
|
182
|
+
API keys are stored securely at:
|
|
183
|
+
- **Windows**: `C:\Users\<User>\.nextjs-agent-cli\cred.json`
|
|
184
|
+
- **macOS/Linux**: `~/.nextjs-agent-cli/cred.json`
|
|
148
185
|
|
|
149
|
-
|
|
150
|
-
- Run dependency installs
|
|
151
|
-
- Run builds
|
|
152
|
-
- Detect runtime or build failures
|
|
153
|
-
- Attempt automated fixes
|
|
154
|
-
- Re-run verification steps
|
|
186
|
+
### Environment Variables
|
|
155
187
|
|
|
156
|
-
|
|
188
|
+
You can also set your API key via environment variable:
|
|
189
|
+
|
|
190
|
+
```bash
|
|
191
|
+
export GEMINI_API_KEY=your_api_key_here
|
|
192
|
+
```
|
|
193
|
+
|
|
194
|
+
Priority: Environment variable > Credential store > Interactive prompt
|
|
157
195
|
|
|
158
196
|
---
|
|
159
197
|
|
|
160
|
-
##
|
|
198
|
+
## π§ͺ After Generation
|
|
161
199
|
|
|
162
|
-
|
|
200
|
+
Once the agent finishes, run your project:
|
|
163
201
|
|
|
164
202
|
```bash
|
|
165
203
|
cd my-app
|
|
166
204
|
npm run dev
|
|
167
205
|
```
|
|
168
206
|
|
|
169
|
-
Open
|
|
207
|
+
Open http://localhost:3000 in your browser.
|
|
208
|
+
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
## π οΈ Development
|
|
212
|
+
|
|
213
|
+
### Clone and Build
|
|
214
|
+
|
|
215
|
+
```bash
|
|
216
|
+
git clone https://github.com/kywthiha/nextjs-agent-cli.git
|
|
217
|
+
cd nextjs-agent-cli
|
|
218
|
+
npm install
|
|
219
|
+
npm run build
|
|
170
220
|
```
|
|
171
|
-
|
|
221
|
+
|
|
222
|
+
### Run Locally
|
|
223
|
+
|
|
224
|
+
```bash
|
|
225
|
+
npm run dev
|
|
172
226
|
```
|
|
173
227
|
|
|
174
228
|
---
|
|
175
229
|
|
|
176
|
-
##
|
|
230
|
+
## π Examples
|
|
231
|
+
|
|
232
|
+
### Create a Todo App
|
|
233
|
+
|
|
234
|
+
```bash
|
|
235
|
+
next-agent start -n my-todo-app
|
|
236
|
+
# Then enter: "Build a todo app with categories and due dates"
|
|
237
|
+
```
|
|
238
|
+
|
|
239
|
+
### Create an E-commerce Site
|
|
240
|
+
|
|
241
|
+
```bash
|
|
242
|
+
next-agent start -n my-shop
|
|
243
|
+
# Then enter: "Build a product catalog with shopping cart and checkout"
|
|
244
|
+
```
|
|
177
245
|
|
|
178
|
-
|
|
179
|
-
- Complex architecture changes may need guidance
|
|
180
|
-
- The agent prioritizes safety and correctness over aggressive automation
|
|
246
|
+
### Static Landing Page (No Database)
|
|
181
247
|
|
|
182
|
-
|
|
248
|
+
```bash
|
|
249
|
+
next-agent start -n landing --skip-db
|
|
250
|
+
# Then enter: "Build a modern landing page for a SaaS product"
|
|
251
|
+
```
|
|
183
252
|
|
|
184
253
|
---
|
|
185
254
|
|
|
186
|
-
##
|
|
255
|
+
## β οΈ Limitations
|
|
256
|
+
|
|
257
|
+
- Complex architecture decisions may need guidance
|
|
258
|
+
- Some runtime issues require manual intervention
|
|
259
|
+
- The agent prioritizes safety over aggressive automation
|
|
260
|
+
|
|
261
|
+
---
|
|
262
|
+
|
|
263
|
+
## π License
|
|
187
264
|
|
|
188
265
|
MIT License
|
|
266
|
+
|
|
267
|
+
---
|
|
268
|
+
|
|
269
|
+
## π€ Contributing
|
|
270
|
+
|
|
271
|
+
Contributions are welcome! Please open an issue or submit a pull request.
|
|
272
|
+
|
|
273
|
+
---
|
|
274
|
+
|
|
275
|
+
**Made with β€οΈ for the Gemini 3 Hackathon 2026**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "kyawthiha-nextjs-agent-cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.3",
|
|
4
4
|
"description": "Next.js Fullstack Agent CLI",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"nextjs",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"license": "MIT",
|
|
32
32
|
"repository": {
|
|
33
33
|
"type": "git",
|
|
34
|
-
"url": ""
|
|
34
|
+
"url": "https://github.com/kywthiha/nextjs-agent-cli.git"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@google/genai": "^1.34.0",
|