natureco-cli 1.0.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/CHANGELOG.md ADDED
@@ -0,0 +1,192 @@
1
+ # Changelog
2
+
3
+ All notable changes to NatureCo CLI will be documented in this file.
4
+
5
+ ## [1.0.0] - 2026-05-10
6
+
7
+ ### Added
8
+
9
+ #### Core Features
10
+ - **First-Time Setup Wizard**
11
+ - Automatic setup on first run
12
+ - Interactive API key validation with live check
13
+ - Bot selection from user's bots
14
+ - Optional Telegram integration
15
+ - Creates `~/.natureco/` directory structure
16
+ - Beautiful boxed interface
17
+ - Can be run manually with `natureco setup`
18
+
19
+ - **Authentication System**
20
+ - Login/logout with API key
21
+ - Secure storage in `~/.natureco/config.json`
22
+ - Support for both `nco_` and `nc_` key formats
23
+
24
+ - **Bot Management**
25
+ - List available bots
26
+ - Interactive chat with bots
27
+ - Bot switching within chat
28
+
29
+ - **Gateway Screen**
30
+ - Beautiful boxed interface
31
+ - Login status display
32
+ - Active bot information
33
+ - Skill and MCP server counts
34
+
35
+ #### Project Management
36
+ - **Project Initialization**
37
+ - `natureco init` command
38
+ - Creates `.natureco/` folder structure
39
+ - Interactive bot and skill selection
40
+ - Generates `config.json` and `AGENTS.md`
41
+
42
+ - **Configuration System**
43
+ - Global config: `~/.natureco/config.json`
44
+ - Project config: `.natureco/config.json`
45
+ - Get/set/list commands
46
+ - Hierarchical config management
47
+
48
+ #### Skills System
49
+ - **Three-Tier Hierarchy**
50
+ - Built-in skills (code-review, summarize, translate)
51
+ - User skills (`~/.natureco/skills/`)
52
+ - Project skills (`.natureco/skills/`)
53
+
54
+ - **Skill Management**
55
+ - List installed skills
56
+ - Install from NatureHub
57
+ - Remove skills
58
+ - Update all skills
59
+ - Create new skill templates
60
+
61
+ - **Skill Features**
62
+ - Automatic prompt injection in chat
63
+ - Requirement gating (bins, env vars, OS)
64
+ - SKILL.md format with frontmatter
65
+ - Metadata validation
66
+
67
+ #### Chat Features
68
+ - **Interactive Chat**
69
+ - Real-time conversation with bots
70
+ - Readline interface with arrow key support
71
+ - Command history (last 100 commands)
72
+ - Conversation history saved to `~/.natureco/history/`
73
+
74
+ - **Chat Commands**
75
+ - `/clear` - Clear screen
76
+ - `/bot [name]` - Switch bot or list bots
77
+ - `/skills` - Show active skills
78
+ - `/help` - Show chat help
79
+ - `exit`, `quit` - Exit chat
80
+
81
+ - **Quick Commands**
82
+ - `natureco ask "<question>"` - Single-shot questions
83
+ - `natureco run <script.md>` - Run markdown scripts
84
+ - Pipe support for ask command
85
+
86
+ #### MCP Server Support
87
+ - **Server Management**
88
+ - List MCP servers
89
+ - Add servers (interactive or template-based)
90
+ - Remove servers
91
+ - Test connections
92
+ - Enable/disable servers
93
+
94
+ - **Ready Templates**
95
+ - `filesystem` - File system operations
96
+ - `github` - GitHub operations
97
+ - `postgres` - PostgreSQL database
98
+ - `sqlite` - SQLite database
99
+ - `brave-search` - Web search
100
+
101
+ - **Configuration**
102
+ - Stored in `~/.natureco/config.json`
103
+ - Environment variable support
104
+ - Auto-approve lists
105
+ - Disable/enable flags
106
+
107
+ #### AGENTS.md Support
108
+ - Project-specific bot instructions
109
+ - Automatic prompt injection in chat
110
+ - Markdown format
111
+ - Created during `natureco init`
112
+
113
+ #### Update System
114
+ - **Auto-Update Notifications**
115
+ - Checks every 24 hours
116
+ - Notifies when new version available
117
+ - Uses update-notifier package
118
+
119
+ - **Manual Update Check**
120
+ - `natureco update` command
121
+ - Shows current and latest versions
122
+ - Provides update instructions
123
+
124
+ #### UI/UX
125
+ - Colorful terminal interface with chalk
126
+ - Loading animations with spinners
127
+ - Boxed gateway screen
128
+ - Monospace formatting
129
+ - Error messages in Turkish
130
+ - Cross-platform support (Windows, macOS, Linux)
131
+
132
+ ### Technical Details
133
+
134
+ #### Dependencies
135
+ - `chalk@4.1.2` - Terminal colors
136
+ - `commander@11.1.0` - CLI framework
137
+ - `inquirer@8.2.7` - Interactive prompts
138
+ - `boxen@5.1.2` - Terminal boxes
139
+ - `ora@5.4.1` - Spinners
140
+ - `conf@10.2.0` - Config management
141
+ - `update-notifier@6.0.2` - Update notifications
142
+
143
+ #### API Integration
144
+ - Base URL: `https://api.natureco.me`
145
+ - Endpoints:
146
+ - `GET /api/v1/bots` - List bots
147
+ - `POST /api/agent/chat` - Chat with bot
148
+ - Headers:
149
+ - `Authorization: Bearer <apiKey>`
150
+ - `X-User-ID: cli-user`
151
+ - Platform identifier: `cli`
152
+
153
+ #### File Structure
154
+ ```
155
+ ~/.natureco/
156
+ ├── config.json # Global config
157
+ ├── skills/ # User skills
158
+ └── history/ # Chat history
159
+ └── <bot-id>.json
160
+
161
+ .natureco/ # Project folder
162
+ ├── config.json # Project config
163
+ ├── AGENTS.md # Bot instructions
164
+ └── skills/ # Project skills
165
+ ```
166
+
167
+ ### Commands
168
+
169
+ ```bash
170
+ natureco # Gateway screen (runs setup if needed)
171
+ natureco setup # Run setup wizard
172
+ natureco login # Login
173
+ natureco logout # Logout
174
+ natureco bots # List bots
175
+ natureco chat <bot> # Start chat
176
+ natureco ask "<question>" # Quick question
177
+ natureco run <script.md> # Run script
178
+ natureco init # Initialize project
179
+ natureco skills [action] # Manage skills
180
+ natureco mcp [action] # Manage MCP servers
181
+ natureco config <action> # Manage config
182
+ natureco update # Check updates
183
+ natureco help # Show help
184
+ ```
185
+
186
+ ### Requirements
187
+ - Node.js >= 18.0.0 (for native fetch)
188
+ - npm or yarn
189
+ - NatureCo API key
190
+
191
+ ### License
192
+ MIT
package/README.md ADDED
@@ -0,0 +1,369 @@
1
+ # NatureCo CLI
2
+
3
+ 🌿 AI Bot Terminal Interface for NatureCo platform.
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g natureco-cli
9
+ ```
10
+
11
+ ## Quick Start
12
+
13
+ ```bash
14
+ # First time - automatic setup
15
+ natureco
16
+
17
+ # Or run setup manually
18
+ natureco setup
19
+
20
+ # Start chatting
21
+ natureco chat "Nature Bot V3"
22
+ ```
23
+
24
+ The first time you run `natureco`, it will automatically guide you through the setup process:
25
+ 1. Create `~/.natureco/` directory
26
+ 2. Enter and validate your API key
27
+ 3. Select your default bot
28
+ 4. Optionally connect Telegram
29
+
30
+ ## Commands
31
+
32
+ ### Setup & Gateway
33
+
34
+ ```bash
35
+ # Show gateway (runs setup if needed)
36
+ natureco
37
+
38
+ # Run setup wizard manually
39
+ natureco setup
40
+ ```
41
+
42
+ ### Authentication
43
+
44
+ ```bash
45
+ # Login
46
+ natureco login
47
+
48
+ # Logout
49
+ natureco logout
50
+ ```
51
+
52
+ Get your API key from [developers.natureco.me](https://developers.natureco.me).
53
+
54
+ ### Bots
55
+
56
+ ```bash
57
+ # List your bots
58
+ natureco bots
59
+ ```
60
+
61
+ ### Chat
62
+
63
+ ```bash
64
+ # Start interactive chat
65
+ natureco chat "Bot Name"
66
+ ```
67
+
68
+ **Chat Commands:**
69
+ - `/clear` - Clear screen
70
+ - `/bot [name]` - Switch bot or list available bots
71
+ - `/skills` - Show active skills
72
+ - `/help` - Show chat help
73
+ - `exit` or `quit` - Exit chat
74
+ - `↑` `↓` - Navigate command history
75
+
76
+ ### Quick Ask
77
+
78
+ ```bash
79
+ # Ask a single question
80
+ natureco ask "What's the weather today?"
81
+
82
+ # Pipe support
83
+ echo "Summarize this file" | natureco ask
84
+ ```
85
+
86
+ ### Run Scripts
87
+
88
+ ```bash
89
+ # Run markdown script
90
+ natureco run script.md
91
+ ```
92
+
93
+ ### Project Initialization
94
+
95
+ ```bash
96
+ # Initialize NatureCo project
97
+ natureco init
98
+ ```
99
+
100
+ Creates:
101
+ - `.natureco/config.json` - Project configuration
102
+ - `.natureco/AGENTS.md` - Bot instructions
103
+ - `.natureco/skills/` - Project-specific skills
104
+
105
+ ### Skills Management
106
+
107
+ ```bash
108
+ # List skills
109
+ natureco skills
110
+
111
+ # Install skill from NatureHub
112
+ natureco skills install code-review
113
+
114
+ # Remove skill
115
+ natureco skills remove code-review
116
+
117
+ # Update all skills
118
+ natureco skills update --all
119
+
120
+ # Create new skill
121
+ natureco skills create my-skill
122
+ ```
123
+
124
+ **Skill Sources (priority order):**
125
+ 1. `.natureco/skills/` - Project skills
126
+ 2. `~/.natureco/skills/` - User skills
127
+ 3. Built-in skills (code-review, summarize, translate)
128
+
129
+ ### Configuration
130
+
131
+ ```bash
132
+ # List all config
133
+ natureco config list
134
+
135
+ # Get value
136
+ natureco config get defaultBot
137
+
138
+ # Set value
139
+ natureco config set defaultBotId <bot-id>
140
+ ```
141
+
142
+ ### MCP Servers
143
+
144
+ ```bash
145
+ # List MCP servers
146
+ natureco mcp list
147
+
148
+ # Show available templates
149
+ natureco mcp templates
150
+
151
+ # Add MCP server (interactive)
152
+ natureco mcp add
153
+
154
+ # Add with specific name
155
+ natureco mcp add my-server
156
+
157
+ # Remove MCP server
158
+ natureco mcp remove my-server
159
+
160
+ # Test connection
161
+ natureco mcp test my-server
162
+
163
+ # Enable/disable server
164
+ natureco mcp enable my-server
165
+ natureco mcp disable my-server
166
+ ```
167
+
168
+ **Available Templates:**
169
+ - `filesystem` - File system operations (read, write, list)
170
+ - `github` - GitHub operations (issues, PRs, commits)
171
+ - `postgres` - PostgreSQL database operations
172
+ - `sqlite` - SQLite database operations
173
+ - `brave-search` - Web search using Brave Search API
174
+
175
+ ### Update
176
+
177
+ ```bash
178
+ # Check for updates
179
+ natureco update
180
+ ```
181
+
182
+ The CLI also automatically checks for updates every 24 hours and notifies you when a new version is available.
183
+
184
+ ### Help
185
+
186
+ ```bash
187
+ natureco help
188
+ ```
189
+
190
+ ## Features
191
+
192
+ ### 🎯 First-Time Setup Wizard
193
+ - Automatic setup on first run
194
+ - Interactive API key validation
195
+ - Bot selection
196
+ - Optional Telegram integration
197
+ - Creates `~/.natureco/` directory structure
198
+
199
+ ### 🔐 Secure Authentication
200
+ - API key stored in `~/.natureco/config.json`
201
+ - Supports both `nco_` and `nc_` key formats
202
+
203
+ ### 🤖 Interactive Chat
204
+ - Real-time conversation with AI bots
205
+ - Command history with arrow keys
206
+ - In-chat commands (/clear, /bot, /skills, /help)
207
+ - Conversation history saved to `~/.natureco/history/`
208
+
209
+ ### 🎯 Skills System
210
+ - Three-tier skill hierarchy (builtin/user/project)
211
+ - Automatic skill prompt injection
212
+ - Requirement gating (bins, env vars, OS platform)
213
+ - Install from NatureHub
214
+
215
+ ### 📝 Project Context
216
+ - AGENTS.md for project-specific instructions
217
+ - Automatic prompt injection in chat
218
+ - Per-project configuration
219
+
220
+ ### 🔌 MCP Server Support
221
+ - Manage MCP servers from CLI
222
+ - 5 ready-to-use templates (filesystem, github, postgres, sqlite, brave-search)
223
+ - Test connections before use
224
+ - Enable/disable servers
225
+ - Config stored in `~/.natureco/config.json`
226
+
227
+ ### 🔄 Auto-Update Notifications
228
+ - Automatic update check every 24 hours
229
+ - Manual update check with `natureco update`
230
+ - Notifies when new version is available
231
+
232
+ ### 🎨 Beautiful UI
233
+ - Colorful terminal interface with chalk
234
+ - Loading animations with spinners
235
+ - Boxed gateway screen
236
+ - Monospace formatting
237
+
238
+ ### 🌍 Cross-Platform
239
+ - Windows, macOS, Linux support
240
+ - PowerShell and Bash compatible
241
+ - Native Node.js fetch (no dependencies)
242
+
243
+ ## File Structure
244
+
245
+ ```
246
+ ~/.natureco/
247
+ ├── config.json # Global config (includes mcpServers)
248
+ ├── skills/ # User skills
249
+ └── history/ # Chat history
250
+ └── <bot-id>.json
251
+
252
+ .natureco/ # Project folder
253
+ ├── config.json # Project config
254
+ ├── AGENTS.md # Bot instructions
255
+ └── skills/ # Project skills
256
+ ```
257
+
258
+ ## Skill Format
259
+
260
+ Skills are defined in `SKILL.md` files:
261
+
262
+ ```markdown
263
+ ---
264
+ name: code-review
265
+ description: Code review and suggestions
266
+ metadata: {"natureco": {"requires": {"bins": ["node"]}, "os": ["win32","darwin","linux"]}}
267
+ ---
268
+
269
+ # Code Review Skill
270
+
271
+ This skill performs code review...
272
+ ```
273
+
274
+ ## Configuration Schema
275
+
276
+ ```json
277
+ {
278
+ "apiKey": "nc_...",
279
+ "defaultBot": "Nature Bot V3",
280
+ "defaultBotId": "uuid",
281
+ "skills": {
282
+ "enabled": true,
283
+ "list": ["code-review", "summarize"]
284
+ },
285
+ "mcpServers": {
286
+ "filesystem": {
287
+ "command": "npx",
288
+ "args": ["-y", "@modelcontextprotocol/server-filesystem", "/path/to/dir"],
289
+ "env": {},
290
+ "disabled": false,
291
+ "autoApprove": []
292
+ },
293
+ "github": {
294
+ "command": "npx",
295
+ "args": ["-y", "@modelcontextprotocol/server-github"],
296
+ "env": {
297
+ "GITHUB_TOKEN": "ghp_..."
298
+ },
299
+ "disabled": false,
300
+ "autoApprove": []
301
+ }
302
+ }
303
+ }
304
+ ```
305
+
306
+ ## API Endpoints
307
+
308
+ - Base URL: `https://api.natureco.me`
309
+ - Bots: `GET /api/v1/bots`
310
+ - Chat: `POST /api/agent/chat`
311
+
312
+ ## Requirements
313
+
314
+ - Node.js >= 18.0.0 (for native fetch)
315
+
316
+ ## Examples
317
+
318
+ ```bash
319
+ # First time setup
320
+ natureco
321
+ # Follow the interactive setup wizard
322
+
323
+ # Quick question
324
+ natureco ask "List my tasks for this week"
325
+
326
+ # Run a script
327
+ natureco run deploy-checklist.md
328
+
329
+ # Chat with bot switching
330
+ natureco chat "Nature Bot V3"
331
+ # In chat: /bot "Code Assistant"
332
+
333
+ # Install and use skills
334
+ natureco skills install code-review
335
+ natureco chat "Nature Bot V3"
336
+ # Skills are automatically injected
337
+
338
+ # Add MCP server
339
+ natureco mcp add
340
+ # Select template: filesystem
341
+ # MCP server added
342
+
343
+ # Test MCP connection
344
+ natureco mcp test filesystem
345
+
346
+ # List all MCP servers
347
+ natureco mcp list
348
+ ```
349
+
350
+ ## Troubleshooting
351
+
352
+ ### "Not logged in" error
353
+ Run `natureco login` and enter your API key.
354
+
355
+ ### "Bot not found" error
356
+ Run `natureco bots` to see available bots. Use exact bot name.
357
+
358
+ ### Skills not working
359
+ Check skill requirements with `natureco skills` - ensure required binaries and env vars are available.
360
+
361
+ ### MCP server connection failed
362
+ - Check if `npx` is installed: `npx --version`
363
+ - Verify environment variables are set correctly
364
+ - Test connection: `natureco mcp test <server-name>`
365
+ - Check server logs in terminal output
366
+
367
+ ## License
368
+
369
+ MIT
@@ -0,0 +1,109 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { Command } = require('commander');
4
+ const chalk = require('chalk');
5
+ const packageJson = require('../package.json');
6
+ const login = require('../src/commands/login');
7
+ const logout = require('../src/commands/logout');
8
+ const bots = require('../src/commands/bots');
9
+ const chat = require('../src/commands/chat');
10
+ const help = require('../src/commands/help');
11
+ const gateway = require('../src/commands/gateway');
12
+ const init = require('../src/commands/init');
13
+ const config = require('../src/commands/config');
14
+ const ask = require('../src/commands/ask');
15
+ const run = require('../src/commands/run');
16
+
17
+ const program = new Command();
18
+
19
+ program
20
+ .name('natureco')
21
+ .description('NatureCo AI Bot Terminal Interface')
22
+ .version('1.0.0');
23
+
24
+ program
25
+ .command('login')
26
+ .description('Login with your NatureCo API key')
27
+ .action(login);
28
+
29
+ program
30
+ .command('setup')
31
+ .description('Run initial setup wizard')
32
+ .action(async () => {
33
+ const setup = require('../src/commands/setup');
34
+ await setup();
35
+ });
36
+
37
+ program
38
+ .command('logout')
39
+ .description('Logout and remove stored credentials')
40
+ .action(logout);
41
+
42
+ program
43
+ .command('bots')
44
+ .description('List your AI bots')
45
+ .action(bots);
46
+
47
+ program
48
+ .command('chat <bot-name>')
49
+ .description('Start interactive chat with a bot')
50
+ .action(chat);
51
+
52
+ program
53
+ .command('init')
54
+ .description('Initialize NatureCo project in current directory')
55
+ .action(init);
56
+
57
+ program
58
+ .command('config <action> [key] [value...]')
59
+ .description('Manage configuration (get|set|list)')
60
+ .action((action, key, value) => config([action, key, ...(value || [])]));
61
+
62
+ program
63
+ .command('skills [action] [params...]')
64
+ .description('Manage skills (list|install|remove|update|create)')
65
+ .action((action, params) => {
66
+ const skillsCmd = require('../src/commands/skills');
67
+ skillsCmd([action, ...(params || [])]);
68
+ });
69
+
70
+ program
71
+ .command('ask <question>')
72
+ .description('Ask a single question to your default bot')
73
+ .action(ask);
74
+
75
+ program
76
+ .command('run <script>')
77
+ .description('Run a markdown script file')
78
+ .action(run);
79
+
80
+ program
81
+ .command('mcp [action] [params...]')
82
+ .description('Manage MCP servers (list|add|remove|test|enable|disable|templates)')
83
+ .action((action, params) => {
84
+ const mcpCmd = require('../src/commands/mcp');
85
+ mcpCmd([action, ...(params || [])]);
86
+ });
87
+
88
+ program
89
+ .command('update')
90
+ .description('Check for updates')
91
+ .action(() => {
92
+ const updateCmd = require('../src/commands/update');
93
+ updateCmd();
94
+ });
95
+
96
+ program
97
+ .command('help')
98
+ .description('Show help information')
99
+ .action(help);
100
+
101
+ // Komut verilmezse gateway göster
102
+ if (!process.argv.slice(2).length) {
103
+ gateway().catch(err => {
104
+ console.error(chalk.red(`\n❌ Hata: ${err.message}\n`));
105
+ process.exit(1);
106
+ });
107
+ } else {
108
+ program.parse(process.argv);
109
+ }
package/package.json ADDED
@@ -0,0 +1,33 @@
1
+ {
2
+ "name": "natureco-cli",
3
+ "version": "1.0.0",
4
+ "description": "NatureCo AI Bot Terminal Interface",
5
+ "main": "bin/natureco.js",
6
+ "bin": {
7
+ "natureco": "./bin/natureco.js"
8
+ },
9
+ "scripts": {
10
+ "test": "node bin/natureco.js help"
11
+ },
12
+ "keywords": [
13
+ "natureco",
14
+ "ai",
15
+ "bot",
16
+ "cli",
17
+ "terminal"
18
+ ],
19
+ "author": "NatureCo",
20
+ "license": "MIT",
21
+ "dependencies": {
22
+ "chalk": "^4.1.2",
23
+ "commander": "^11.1.0",
24
+ "inquirer": "^8.2.7",
25
+ "boxen": "^5.1.2",
26
+ "ora": "^5.4.1",
27
+ "conf": "^10.2.0",
28
+ "update-notifier": "^6.0.2"
29
+ },
30
+ "engines": {
31
+ "node": ">=16.0.0"
32
+ }
33
+ }