@drewsepsi/nextpi 0.1.0 β†’ 0.1.1

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 CHANGED
@@ -1,6 +1,8 @@
1
1
  # πŸš€ NextPi: The Agentic IDE
2
+ [![npm version](https://img.shields.io/npm/v/@drewsepsi/nextpi.svg)](https://www.npmjs.com/package/@drewsepsi/nextpi)
3
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
2
4
 
3
- **NextPi** is your project's personal secret agent. It's a tiny, powerful workspace that lives in your project folder and helps you research, code, and debug using top-tier AI.
5
+ **NextPi** is your project's personal secret agent. It's a lightweight, powerful AI-IDE that lives in your project folder and helps you research, code, and debug using top-tier LLMsβ€”all through a beautiful, VS-Code-like interface in your browser.
4
6
 
5
7
  Turn any folder into an intelligent workspace with just one command.
6
8
 
@@ -16,35 +18,47 @@ npx @drewsepsi/nextpi
16
18
 
17
19
  *Requires [Node.js](https://nodejs.org/) installed.*
18
20
 
19
- ### πŸ”‘ Setup
20
- You will need an [OpenRouter](https://openrouter.ai/) API key to use the AI features. Set it in your terminal:
21
- ```bash
22
- export OPENROUTER_API_KEY=your_key_here
23
- ```
21
+ ---
22
+
23
+ ## πŸ€” Why NextPi?
24
+
25
+ ChatGPT and Claude are great, but they don't have **context**. They can't see your files, they can't run your code, and they can't confirm if their suggestions actually work.
26
+
27
+ **NextPi is different.** It is an *agent*, not just a chatbot.
28
+ 1. **It sees what you see**: It automatically indexes your local files.
29
+ 2. **It takes action**: It can create files, fix bugs, and run terminal commands.
30
+ 3. **It researches**: If it doesn't know something, it searches the web and reads documentation for you.
24
31
 
25
32
  ---
26
33
 
27
34
  ## ✨ Features
28
35
 
29
- - **πŸ“‚ Folder-Aware**: NextPi instantly understands the files in your current folder.
30
- - **🌐 Web Research**: It can search the internet, read documentation, and find answers for you.
31
- - **Code Editing**: Ask it to fix bugs or add features, and watch it work directly on your files.
32
- - **🧠 Multi-Model Support**: Use any model from OpenRouter (Claude, GPT-4, Gemini, etc.).
33
- - **πŸš€ One-Tap Preview**: Run your app and see the changes live inside the NextPi interface.
36
+ - **πŸ“‚ Folder-Aware**: Instant context for your current workspace.
37
+ - **🌐 Web Research**: Real-time internet access to find the latest API docs and solutions.
38
+ - **πŸ›  Code Editing**: High-fidelity file modifications and bug fixes.
39
+ - **🧠 Multi-Model Support**: Powered by OpenRouterβ€”use Claude 3.5 Sonnet, GPT-4o, Gemini 1.5 Pro, and more.
40
+ - **πŸš€ Live Preview**: Launch your app (e.g., `npm run dev`) and view it side-by-side with the agent.
41
+ - **πŸŒ‘ Sleek UI**: A premium dark-mode interface with glassmorphism and smooth animations.
34
42
 
35
43
  ---
36
44
 
37
- ## πŸ›  How it Works
45
+ ## πŸ”‘ Setup & Config
46
+
47
+ NextPi works out of the box. You'll need an [OpenRouter](https://openrouter.ai/) API key to power the AI.
38
48
 
39
- NextPi starts a small web server on your machine that only you can access. It uses **Agentic AI**β€”which means it doesn't just talk; it **takes action**. It can read your code, search the web for solutions, and help you build faster than ever.
49
+ You can set it up in two ways:
50
+ 1. **In the UI**: Click the **Settings** gear in the top right and paste your key.
51
+ 2. **Via Terminal**:
52
+ ```bash
53
+ export OPENROUTER_API_KEY=your_key_here
54
+ ```
40
55
 
41
56
  ---
42
57
 
43
58
  ## πŸ”’ Privacy & Safety
44
59
 
45
- NextPi runs entirely on **your** computer. While it uses cloud AI models to "think," it only accesses the files in the folder where you started it. You are always in control.
60
+ NextPi runs **locally** on your machine. While it communicates with AI providers via API, it only reads the files in the directory where you launch it. Your local environment remains under your total control.
46
61
 
47
62
  ---
48
63
 
49
64
  Built with ❀️ by [drewsepsi](https://github.com/drewsepsi)
50
- # nextpi
package/bin/cli.js CHANGED
@@ -30,7 +30,10 @@ if (!process.env.OPENROUTER_API_KEY) {
30
30
  // 4. Determine if we should run in dev mode or production mode
31
31
  // If we are running from a local development folder, we likely want dev.
32
32
  // If we are installed as a package, we likely want 'next start'.
33
- const isDev = fs.existsSync(path.join(packageRoot, 'next.config.js')) && !fs.existsSync(path.join(packageRoot, '.next'));
33
+ const hasNextConfig = fs.existsSync(path.join(packageRoot, 'next.config.js')) ||
34
+ fs.existsSync(path.join(packageRoot, 'next.config.mjs')) ||
35
+ fs.existsSync(path.join(packageRoot, 'next.config.ts'));
36
+ const isDev = hasNextConfig && !fs.existsSync(path.join(packageRoot, '.next'));
34
37
 
35
38
  console.log(`\x1b[35m%s\x1b[0m`, `
36
39
  _ __ __ ____ _
@@ -412,7 +412,6 @@ const Folder = forwardRef<
412
412
  setExpandedItems,
413
413
  indicator,
414
414
  selectedId,
415
- selectItem,
416
415
  onFolderContextMenu,
417
416
  } = useTree()
418
417
  const isSelected = isSelect ?? selectedId === value
package/lib/config.js ADDED
@@ -0,0 +1,45 @@
1
+ import fs from 'fs';
2
+ import path from 'path';
3
+ import os from 'os';
4
+
5
+ const CONFIG_DIR = path.join(os.homedir(), '.nextpi');
6
+ const CONFIG_FILE = path.join(CONFIG_DIR, 'config.json');
7
+
8
+ export function getConfig() {
9
+ try {
10
+ if (!fs.existsSync(CONFIG_FILE)) {
11
+ return {};
12
+ }
13
+ const data = fs.readFileSync(CONFIG_FILE, 'utf-8');
14
+ return JSON.parse(data);
15
+ } catch (err) {
16
+ console.error('Error reading config:', err);
17
+ return {};
18
+ }
19
+ }
20
+
21
+ export function saveConfig(newConfig) {
22
+ try {
23
+ if (!fs.existsSync(CONFIG_DIR)) {
24
+ fs.mkdirSync(CONFIG_DIR, { recursive: true });
25
+ }
26
+ const current = getConfig();
27
+ const updated = { ...current, ...newConfig };
28
+ fs.writeFileSync(CONFIG_FILE, JSON.stringify(updated, null, 2));
29
+
30
+ // Also update current process env for immediate use
31
+ if (updated.openRouterApiKey) {
32
+ process.env.OPENROUTER_API_KEY = updated.openRouterApiKey;
33
+ }
34
+
35
+ return updated;
36
+ } catch (err) {
37
+ console.error('Error saving config:', err);
38
+ throw err;
39
+ }
40
+ }
41
+
42
+ export function getEffectiveApiKey() {
43
+ // Priority: 1. Environment Variable, 2. Config File
44
+ return process.env.OPENROUTER_API_KEY || getConfig().openRouterApiKey;
45
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@drewsepsi/nextpi",
3
- "version": "0.1.0",
3
+ "version": "0.1.1",
4
4
  "description": "The Agentic IDE - An AI-powered research and coding assistant workspace.",
5
5
  "type": "module",
6
6
  "bin": {