open-ready 0.1.3 → 0.1.7
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 +64 -0
- package/package.json +4 -4
package/README.md
ADDED
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# open-ready
|
|
2
|
+
|
|
3
|
+
Smart dev server launcher that watches your server's output and automatically opens the browser when ready — or opens an AI assistant with the error context when something goes wrong.
|
|
4
|
+
|
|
5
|
+
Works with Next.js, Vite, and any CLI-based dev server.
|
|
6
|
+
|
|
7
|
+
## Install
|
|
8
|
+
|
|
9
|
+
```sh
|
|
10
|
+
npm install -g open-ready
|
|
11
|
+
# or use without installing:
|
|
12
|
+
npx open-ready <your-dev-command>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Usage
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
open-ready <command> [options]
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
### Examples
|
|
22
|
+
|
|
23
|
+
```sh
|
|
24
|
+
open-ready npm run dev
|
|
25
|
+
open-ready bun run dev
|
|
26
|
+
open-ready vite
|
|
27
|
+
open-ready next dev
|
|
28
|
+
```
|
|
29
|
+
|
|
30
|
+
### Options
|
|
31
|
+
|
|
32
|
+
| Flag | Default | Description |
|
|
33
|
+
|------|---------|-------------|
|
|
34
|
+
| `--ai-base <url>` | `https://perplexity.ai?q=` | AI assistant base URL to open on error |
|
|
35
|
+
| `--noAi` | `false` | Disable opening AI on error |
|
|
36
|
+
| `--noOpen` | `false` | Disable opening browser when ready |
|
|
37
|
+
| `--pollDelay <ms>` | `1200` | How often to poll the log for ready/error signals |
|
|
38
|
+
|
|
39
|
+
### Disable AI on error
|
|
40
|
+
|
|
41
|
+
```sh
|
|
42
|
+
open-ready npm run dev --noAi
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
### Use a different AI assistant
|
|
46
|
+
|
|
47
|
+
```sh
|
|
48
|
+
open-ready npm run dev --ai-base "https://chatgpt.com/?q="
|
|
49
|
+
```
|
|
50
|
+
|
|
51
|
+
## How it works
|
|
52
|
+
|
|
53
|
+
1. Spawns your dev command and pipes its stdout/stderr to a log file
|
|
54
|
+
2. Polls the log every `pollDelay` ms looking for:
|
|
55
|
+
- **Error signal** — lines matching `error`, `failed`, `exception`, `SyntaxError`, or `⨯`
|
|
56
|
+
- **Ready signal** — lines matching `ready - started server` or `Ready in Xms`
|
|
57
|
+
3. On **error**: extracts up to ~1000 chars of surrounding context and opens your AI assistant with a pre-filled prompt explaining the error and asking for a fix
|
|
58
|
+
4. On **ready**: waits for the port to be reachable, then opens the local URL in your default browser
|
|
59
|
+
|
|
60
|
+
For Next.js projects, the log is written to `.next/port.log`; otherwise `open-when-ready.log` in the current directory.
|
|
61
|
+
|
|
62
|
+
## License
|
|
63
|
+
|
|
64
|
+
MIT
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "open-ready",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.7",
|
|
4
4
|
"description": "Smart dev server launcher: error→AI search, success→auto-open browser. Any CLI tool.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"bin": {
|
|
@@ -28,10 +28,10 @@
|
|
|
28
28
|
},
|
|
29
29
|
"repository": {
|
|
30
30
|
"type": "github",
|
|
31
|
-
"url": "https://github.com/
|
|
31
|
+
"url": "https://github.com/OpenSourceAGI/appdemo-dev-tools"
|
|
32
32
|
},
|
|
33
33
|
"bugs": {
|
|
34
|
-
"url": "https://github.com/
|
|
34
|
+
"url": "https://github.com/OpenSourceAGI/appdemo-dev-tools"
|
|
35
35
|
},
|
|
36
|
-
"homepage": "https://github.com/
|
|
36
|
+
"homepage": "https://github.com/OpenSourceAGI/appdemo-dev-tools/tree/master/packages/open-when-ready#readme"
|
|
37
37
|
}
|