kyawthiha-nextjs-agent-cli 1.0.1 β 1.0.2
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 +165 -101
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -1,188 +1,252 @@
|
|
|
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
|
-
##
|
|
12
|
-
|
|
13
|
-
This CLI is designed to behave like a real developer inside a real project environment.
|
|
14
|
-
|
|
15
|
-
Instead of only generating code, the agent:
|
|
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
|
|
11
|
+
## β¨ Features
|
|
21
12
|
|
|
22
|
-
|
|
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
|
|
23
19
|
|
|
24
20
|
---
|
|
25
21
|
|
|
26
|
-
##
|
|
22
|
+
## π Requirements
|
|
27
23
|
|
|
28
|
-
-
|
|
29
|
-
-
|
|
30
|
-
-
|
|
31
|
-
-
|
|
32
|
-
- Planning before execution
|
|
33
|
-
- Real filesystem operations
|
|
34
|
-
- Build and runtime verification
|
|
35
|
-
- Targeted self-repair for failures
|
|
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
|
|
36
28
|
|
|
37
29
|
---
|
|
38
30
|
|
|
39
|
-
##
|
|
40
|
-
|
|
41
|
-
Before installing, ensure you have:
|
|
42
|
-
|
|
43
|
-
- Node.js 18 or later
|
|
44
|
-
- npm or pnpm
|
|
45
|
-
- PostgreSQL (optional, only required if your project uses a database)
|
|
46
|
-
- A Gemini API key
|
|
31
|
+
## π Quick Start
|
|
47
32
|
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
## Installation (Step by Step)
|
|
33
|
+
### Install Globally
|
|
51
34
|
|
|
52
|
-
1. Clone the repository
|
|
53
35
|
```bash
|
|
54
|
-
|
|
36
|
+
npm install -g kyawthiha-nextjs-agent-cli
|
|
55
37
|
```
|
|
56
38
|
|
|
57
|
-
|
|
58
|
-
```bash
|
|
59
|
-
cd nextjs-agent-cli
|
|
60
|
-
```
|
|
39
|
+
### Set Your API Key (One Time)
|
|
61
40
|
|
|
62
|
-
3. Install dependencies
|
|
63
41
|
```bash
|
|
64
|
-
|
|
42
|
+
next-agent config set-api-key
|
|
65
43
|
```
|
|
66
44
|
|
|
67
|
-
|
|
68
|
-
```bash
|
|
69
|
-
cp .env.example .env
|
|
70
|
-
```
|
|
45
|
+
### Start Building
|
|
71
46
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
GEMINI_API_KEY=your_api_key_here
|
|
47
|
+
```bash
|
|
48
|
+
next-agent start
|
|
75
49
|
```
|
|
76
50
|
|
|
77
51
|
---
|
|
78
52
|
|
|
79
|
-
##
|
|
53
|
+
## π Commands
|
|
54
|
+
|
|
55
|
+
| Command | Description |
|
|
56
|
+
|---------|-------------|
|
|
57
|
+
| `next-agent start` | Start the AI agent to build a new project |
|
|
58
|
+
| `next-agent config set-api-key` | Set or update your Gemini API key |
|
|
59
|
+
| `next-agent config show` | Show current configuration |
|
|
60
|
+
| `next-agent --help` | Display all available commands |
|
|
80
61
|
|
|
81
|
-
Start
|
|
62
|
+
### Start Command Options
|
|
82
63
|
|
|
83
64
|
```bash
|
|
84
|
-
|
|
85
|
-
```
|
|
65
|
+
next-agent start [options]
|
|
86
66
|
|
|
87
|
-
|
|
67
|
+
Options:
|
|
68
|
+
-n, --project-name <name> Project name (created in current directory)
|
|
69
|
+
-m, --max-iterations <num> Maximum agent iterations (default: 500)
|
|
70
|
+
--skip-db Skip PostgreSQL configuration
|
|
71
|
+
--no-verbose Disable verbose logging
|
|
72
|
+
```
|
|
88
73
|
|
|
89
74
|
---
|
|
90
75
|
|
|
91
|
-
## Interactive Workflow
|
|
76
|
+
## π― Interactive Workflow
|
|
92
77
|
|
|
93
|
-
### 1. Project
|
|
78
|
+
### 1. Project Setup
|
|
94
79
|
|
|
95
|
-
Choose where the Next.js project should be created.
|
|
96
80
|
```
|
|
97
|
-
|
|
81
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
82
|
+
β π Next.js Fullstack Agent CLI β
|
|
83
|
+
β Build full-stack apps with AI assistance β
|
|
84
|
+
βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
85
|
+
|
|
86
|
+
β Ready to build!
|
|
87
|
+
|
|
88
|
+
? What is your project name? my-app
|
|
98
89
|
```
|
|
99
90
|
|
|
100
|
-
|
|
91
|
+
### 2. API Key (First Time Only)
|
|
101
92
|
|
|
102
|
-
|
|
93
|
+
```
|
|
94
|
+
? Please enter your Gemini API Key: ********
|
|
95
|
+
? Save API key for future sessions? Yes
|
|
96
|
+
β API key saved to C:\Users\User\.nextjs-agent-cli\cred.json
|
|
97
|
+
```
|
|
103
98
|
|
|
104
|
-
|
|
105
|
-
- gemini-3-flash-preview
|
|
106
|
-
- gemini-3-pro-preview
|
|
99
|
+
### 3. Model Selection
|
|
107
100
|
|
|
108
|
-
|
|
101
|
+
```
|
|
102
|
+
? Select Gemini Model:
|
|
103
|
+
β― gemini-3-flash-preview
|
|
104
|
+
gemini-3-pro-preview
|
|
105
|
+
```
|
|
109
106
|
|
|
110
|
-
###
|
|
107
|
+
### 4. Database Configuration (Optional)
|
|
111
108
|
|
|
112
|
-
If your project requires a database, configure PostgreSQL:
|
|
113
109
|
```
|
|
114
110
|
--- PostgreSQL Configuration ---
|
|
115
111
|
? Host: localhost
|
|
116
112
|
? Port: 5432
|
|
117
113
|
? Username: postgres
|
|
118
|
-
? Password:
|
|
114
|
+
? Password: postgres
|
|
115
|
+
? Database Name: my-app
|
|
116
|
+
```
|
|
117
|
+
|
|
118
|
+
Use `--skip-db` to skip this step for static sites.
|
|
119
|
+
|
|
120
|
+
### 5. Describe Your App
|
|
121
|
+
|
|
122
|
+
```
|
|
123
|
+
? What do you want to build or modify?
|
|
124
|
+
> Build a todo app with user authentication and task categories
|
|
119
125
|
```
|
|
120
126
|
|
|
121
127
|
The agent will:
|
|
122
|
-
-
|
|
123
|
-
-
|
|
124
|
-
-
|
|
128
|
+
- π Create an implementation plan
|
|
129
|
+
- β
Execute tasks step by step
|
|
130
|
+
- π Verify builds and runtime
|
|
131
|
+
- π§ Auto-fix errors when possible
|
|
125
132
|
|
|
126
133
|
---
|
|
127
134
|
|
|
128
|
-
|
|
135
|
+
## ποΈ Project Structure
|
|
136
|
+
|
|
137
|
+
After the agent runs, your project will have:
|
|
129
138
|
|
|
130
|
-
Describe what you want to build using natural language.
|
|
131
139
|
```
|
|
132
|
-
|
|
133
|
-
|
|
140
|
+
my-app/
|
|
141
|
+
βββ .agent/
|
|
142
|
+
β βββ plan1.md # Implementation plan
|
|
143
|
+
β βββ task1.md # Task checklist
|
|
144
|
+
βββ src/
|
|
145
|
+
β βββ app/ # Next.js app router
|
|
146
|
+
β βββ components/ # React components
|
|
147
|
+
β βββ lib/ # Utilities
|
|
148
|
+
βββ prisma/ # Database schema (if using DB)
|
|
149
|
+
βββ package.json
|
|
150
|
+
βββ ...
|
|
134
151
|
```
|
|
135
152
|
|
|
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
153
|
---
|
|
144
154
|
|
|
145
|
-
##
|
|
155
|
+
## βοΈ Configuration
|
|
156
|
+
|
|
157
|
+
### API Key Storage
|
|
146
158
|
|
|
147
|
-
|
|
159
|
+
API keys are stored securely at:
|
|
160
|
+
- **Windows**: `C:\Users\<User>\.nextjs-agent-cli\cred.json`
|
|
161
|
+
- **macOS/Linux**: `~/.nextjs-agent-cli/cred.json`
|
|
148
162
|
|
|
149
|
-
|
|
150
|
-
- Run dependency installs
|
|
151
|
-
- Run builds
|
|
152
|
-
- Detect runtime or build failures
|
|
153
|
-
- Attempt automated fixes
|
|
154
|
-
- Re-run verification steps
|
|
163
|
+
### Environment Variables
|
|
155
164
|
|
|
156
|
-
|
|
165
|
+
You can also set your API key via environment variable:
|
|
166
|
+
|
|
167
|
+
```bash
|
|
168
|
+
export GEMINI_API_KEY=your_api_key_here
|
|
169
|
+
```
|
|
170
|
+
|
|
171
|
+
Priority: Environment variable > Credential store > Interactive prompt
|
|
157
172
|
|
|
158
173
|
---
|
|
159
174
|
|
|
160
|
-
##
|
|
175
|
+
## π§ͺ After Generation
|
|
161
176
|
|
|
162
|
-
|
|
177
|
+
Once the agent finishes, run your project:
|
|
163
178
|
|
|
164
179
|
```bash
|
|
165
180
|
cd my-app
|
|
166
181
|
npm run dev
|
|
167
182
|
```
|
|
168
183
|
|
|
169
|
-
Open
|
|
184
|
+
Open http://localhost:3000 in your browser.
|
|
185
|
+
|
|
186
|
+
---
|
|
187
|
+
|
|
188
|
+
## π οΈ Development
|
|
189
|
+
|
|
190
|
+
### Clone and Build
|
|
191
|
+
|
|
192
|
+
```bash
|
|
193
|
+
git clone https://github.com/kywthiha/nextjs-agent-cli.git
|
|
194
|
+
cd nextjs-agent-cli
|
|
195
|
+
npm install
|
|
196
|
+
npm run build
|
|
170
197
|
```
|
|
171
|
-
|
|
198
|
+
|
|
199
|
+
### Run Locally
|
|
200
|
+
|
|
201
|
+
```bash
|
|
202
|
+
npm run dev
|
|
172
203
|
```
|
|
173
204
|
|
|
174
205
|
---
|
|
175
206
|
|
|
176
|
-
##
|
|
207
|
+
## π Examples
|
|
208
|
+
|
|
209
|
+
### Create a Todo App
|
|
210
|
+
|
|
211
|
+
```bash
|
|
212
|
+
next-agent start -n my-todo-app
|
|
213
|
+
# Then enter: "Build a todo app with categories and due dates"
|
|
214
|
+
```
|
|
215
|
+
|
|
216
|
+
### Create an E-commerce Site
|
|
217
|
+
|
|
218
|
+
```bash
|
|
219
|
+
next-agent start -n my-shop
|
|
220
|
+
# Then enter: "Build a product catalog with shopping cart and checkout"
|
|
221
|
+
```
|
|
177
222
|
|
|
178
|
-
|
|
179
|
-
- Complex architecture changes may need guidance
|
|
180
|
-
- The agent prioritizes safety and correctness over aggressive automation
|
|
223
|
+
### Static Landing Page (No Database)
|
|
181
224
|
|
|
182
|
-
|
|
225
|
+
```bash
|
|
226
|
+
next-agent start -n landing --skip-db
|
|
227
|
+
# Then enter: "Build a modern landing page for a SaaS product"
|
|
228
|
+
```
|
|
183
229
|
|
|
184
230
|
---
|
|
185
231
|
|
|
186
|
-
##
|
|
232
|
+
## β οΈ Limitations
|
|
233
|
+
|
|
234
|
+
- Complex architecture decisions may need guidance
|
|
235
|
+
- Some runtime issues require manual intervention
|
|
236
|
+
- The agent prioritizes safety over aggressive automation
|
|
237
|
+
|
|
238
|
+
---
|
|
239
|
+
|
|
240
|
+
## π License
|
|
187
241
|
|
|
188
242
|
MIT License
|
|
243
|
+
|
|
244
|
+
---
|
|
245
|
+
|
|
246
|
+
## π€ Contributing
|
|
247
|
+
|
|
248
|
+
Contributions are welcome! Please open an issue or submit a pull request.
|
|
249
|
+
|
|
250
|
+
---
|
|
251
|
+
|
|
252
|
+
**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.2",
|
|
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",
|