nscout 0.1.3 → 0.2.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/.env +71 -0
- package/.env.example +10 -0
- package/README.md +37 -4
- package/package.json +1 -1
- package/ui/index.html +12 -0
- package/ui/package.json +27 -0
- package/ui/server.ts +53 -0
- package/ui/vite.config.ts +14 -0
package/.env
ADDED
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# nscout configuration
|
|
2
|
+
# Copy or rename this file to .env before running nscout.
|
|
3
|
+
# All values shown are the defaults. Edit only what you need to change.
|
|
4
|
+
|
|
5
|
+
# ─── Registries ───────────────────────────────────────────────────────────────
|
|
6
|
+
|
|
7
|
+
# Comma-separated list of registries to check by default.
|
|
8
|
+
# Available: npm, github, pypi, domains, dockerhub
|
|
9
|
+
NSCOUT_REGISTRIES=npm,github,pypi,domains,dockerhub
|
|
10
|
+
|
|
11
|
+
# Comma-separated list of TLDs to check when domains registry is enabled.
|
|
12
|
+
NSCOUT_DOMAINS=.com,.dev,.io,.sh
|
|
13
|
+
|
|
14
|
+
# ─── Performance ──────────────────────────────────────────────────────────────
|
|
15
|
+
|
|
16
|
+
# Number of names checked in parallel.
|
|
17
|
+
NSCOUT_CONCURRENCY=4
|
|
18
|
+
|
|
19
|
+
# Per-request timeout in milliseconds.
|
|
20
|
+
NSCOUT_TIMEOUT=8000
|
|
21
|
+
|
|
22
|
+
# ─── AI suggest ───────────────────────────────────────────────────────────────
|
|
23
|
+
|
|
24
|
+
# Number of name candidates to generate with --suggest.
|
|
25
|
+
NSCOUT_LIMIT=10
|
|
26
|
+
|
|
27
|
+
# Default naming style for --suggest: free | claw | short | portmanteau
|
|
28
|
+
NSCOUT_STYLE=free
|
|
29
|
+
|
|
30
|
+
# Maximum tokens returned by the AI provider for --suggest.
|
|
31
|
+
NSCOUT_AI_MAX_TOKENS=512
|
|
32
|
+
|
|
33
|
+
# Force a specific AI provider: openai, anthropic
|
|
34
|
+
# If not set, the first provider with a valid API key is used automatically.
|
|
35
|
+
# Without any key, --suggest falls back to a deterministic stub and warns to stderr.
|
|
36
|
+
NSCOUT_AI_PROVIDER=
|
|
37
|
+
|
|
38
|
+
# OpenAI
|
|
39
|
+
OPENAI_API_KEY=
|
|
40
|
+
OPENAI_MODEL=gpt-4.1-mini
|
|
41
|
+
|
|
42
|
+
# Anthropic
|
|
43
|
+
ANTHROPIC_API_KEY=
|
|
44
|
+
ANTHROPIC_MODEL=claude-haiku-4-5-20251001
|
|
45
|
+
|
|
46
|
+
# ─── GitHub ───────────────────────────────────────────────────────────────────
|
|
47
|
+
|
|
48
|
+
# Without a token: 60 requests/hour (unauthenticated).
|
|
49
|
+
# With a token: 5000 requests/hour.
|
|
50
|
+
GITHUB_TOKEN=
|
|
51
|
+
|
|
52
|
+
# ─── RDAP (domain checks) ─────────────────────────────────────────────────────
|
|
53
|
+
|
|
54
|
+
# Number of retry attempts on non-404 RDAP errors (e.g. rate limiting).
|
|
55
|
+
NSCOUT_RDAP_RETRY_COUNT=1
|
|
56
|
+
|
|
57
|
+
# Delay in milliseconds between RDAP retry attempts.
|
|
58
|
+
NSCOUT_RDAP_RETRY_DELAY_MS=600
|
|
59
|
+
|
|
60
|
+
# Domains expiring within this many days are shown as expiring rather than taken.
|
|
61
|
+
NSCOUT_EXPIRING_THRESHOLD_DAYS=30
|
|
62
|
+
|
|
63
|
+
# ─── nscout-ui ────────────────────────────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
# Port for the nscout-ui web server.
|
|
66
|
+
PORT=3000
|
|
67
|
+
|
|
68
|
+
# Path to the nscout binary. Defaults to "nscout" (must be in PATH).
|
|
69
|
+
# If nscout is not globally installed, set the full path:
|
|
70
|
+
# NSCOUT_BIN=/path/to/nscout/dist/cli/index.js
|
|
71
|
+
NSCOUT_BIN=node ../dist/cli/index.js
|
package/.env.example
CHANGED
|
@@ -59,3 +59,13 @@ NSCOUT_RDAP_RETRY_DELAY_MS=600
|
|
|
59
59
|
|
|
60
60
|
# Domains expiring within this many days are shown as expiring rather than taken.
|
|
61
61
|
NSCOUT_EXPIRING_THRESHOLD_DAYS=30
|
|
62
|
+
|
|
63
|
+
# ─── nscout-ui ────────────────────────────────────────────────────────────────
|
|
64
|
+
|
|
65
|
+
# Port for the nscout-ui web server.
|
|
66
|
+
PORT=3000
|
|
67
|
+
|
|
68
|
+
# Path to the nscout binary. Defaults to "nscout" (must be in PATH).
|
|
69
|
+
# If nscout is not globally installed, use the local build:
|
|
70
|
+
# NSCOUT_BIN=node ../dist/cli/index.js
|
|
71
|
+
NSCOUT_BIN=nscout
|
package/README.md
CHANGED
|
@@ -195,6 +195,41 @@ All configuration is through environment variables in `.env`. Copy `.env.example
|
|
|
195
195
|
| `NSCOUT_RDAP_RETRY_DELAY_MS` | `600` | Delay in milliseconds between RDAP retries |
|
|
196
196
|
| `NSCOUT_EXPIRING_THRESHOLD_DAYS` | `30` | Domains expiring within this many days show as expiring |
|
|
197
197
|
|
|
198
|
+
### Web UI
|
|
199
|
+
|
|
200
|
+
| Variable | Default | What it does |
|
|
201
|
+
|---|---|---|
|
|
202
|
+
| `PORT` | `3000` | Port for the nscout-ui web server |
|
|
203
|
+
| `NSCOUT_BIN` | `nscout` | Path to the nscout binary. Use `node ../dist/cli/index.js` if not installed globally |
|
|
204
|
+
|
|
205
|
+
## Web UI
|
|
206
|
+
|
|
207
|
+
nscout includes a web interface in the `ui/` folder. It calls the nscout CLI and displays results in the browser.
|
|
208
|
+
|
|
209
|
+
### Requirements
|
|
210
|
+
|
|
211
|
+
- nscout built or installed globally
|
|
212
|
+
- `.env` configured (same file as CLI)
|
|
213
|
+
|
|
214
|
+
### Start
|
|
215
|
+
|
|
216
|
+
```bash
|
|
217
|
+
cd ui
|
|
218
|
+
pnpm install
|
|
219
|
+
pnpm build
|
|
220
|
+
pnpm tsx server.ts
|
|
221
|
+
```
|
|
222
|
+
|
|
223
|
+
Open `http://localhost:3000`.
|
|
224
|
+
|
|
225
|
+
In development (live reload):
|
|
226
|
+
|
|
227
|
+
```bash
|
|
228
|
+
pnpm dev
|
|
229
|
+
```
|
|
230
|
+
|
|
231
|
+
The UI runs on the port set in `PORT` (default 3000). The server spawns `nscout --json` and returns results to the browser.
|
|
232
|
+
|
|
198
233
|
## Architecture
|
|
199
234
|
|
|
200
235
|
nscout is built as a set of independent modules with no coupling between layers.
|
|
@@ -243,9 +278,7 @@ focused, and the AI suggest mode is the headline that differentiates it.
|
|
|
243
278
|
|
|
244
279
|
- [x] Docker Hub check.
|
|
245
280
|
- [ ] VS Code Marketplace check.
|
|
246
|
-
|
|
247
|
-
- [ ] Premium-domain detection (would need a paid API like Domainr).
|
|
248
|
-
- [ ] Watch mode: poll an expiring domain until it frees up.
|
|
281
|
+
|
|
249
282
|
|
|
250
283
|
## OpenClaw
|
|
251
284
|
|
|
@@ -258,7 +291,7 @@ The `--json` output makes nscout agent-friendly: structured results that any
|
|
|
258
291
|
agent or script can parse and act on.
|
|
259
292
|
|
|
260
293
|
To use `--suggest` through your OpenClaw agent's configured LLM instead of a
|
|
261
|
-
separate API key,
|
|
294
|
+
separate API key, configure `NSCOUT_AI_PROVIDER` in your `.env`.
|
|
262
295
|
|
|
263
296
|
## License
|
|
264
297
|
|
package/package.json
CHANGED
package/ui/index.html
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
<!doctype html>
|
|
2
|
+
<html lang="en">
|
|
3
|
+
<head>
|
|
4
|
+
<meta charset="UTF-8" />
|
|
5
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
|
|
6
|
+
<title>nscout</title>
|
|
7
|
+
</head>
|
|
8
|
+
<body>
|
|
9
|
+
<div id="app"></div>
|
|
10
|
+
<script type="module" src="/src/main.ts"></script>
|
|
11
|
+
</body>
|
|
12
|
+
</html>
|
package/ui/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "nscout-ui",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Web UI for nscout",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"scripts": {
|
|
7
|
+
"dev": "concurrently \"tsx server.ts\" \"vite\"",
|
|
8
|
+
"dev:server": "tsx server.ts",
|
|
9
|
+
"dev:app": "vite",
|
|
10
|
+
"build": "vite build",
|
|
11
|
+
"start": "tsx server.ts"
|
|
12
|
+
},
|
|
13
|
+
"dependencies": {
|
|
14
|
+
"@hono/node-server": "^2.0.4",
|
|
15
|
+
"dotenv": "^17.4.2",
|
|
16
|
+
"hono": "^4.12.23"
|
|
17
|
+
},
|
|
18
|
+
"devDependencies": {
|
|
19
|
+
"@types/node": "^25.9.1",
|
|
20
|
+
"@vitejs/plugin-vue": "^6.0.7",
|
|
21
|
+
"concurrently": "^10.0.0",
|
|
22
|
+
"tsx": "^4.22.3",
|
|
23
|
+
"typescript": "^6.0.3",
|
|
24
|
+
"vite": "^8.0.14",
|
|
25
|
+
"vue": "^3.5.35"
|
|
26
|
+
}
|
|
27
|
+
}
|
package/ui/server.ts
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
import { config } from "dotenv";
|
|
2
|
+
import { resolve, dirname } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
6
|
+
config({ path: resolve(__dirname, "../.env") });
|
|
7
|
+
import { execFile } from "node:child_process";
|
|
8
|
+
import { Hono } from "hono";
|
|
9
|
+
import { serve } from "@hono/node-server";
|
|
10
|
+
import { serveStatic } from "@hono/node-server/serve-static";
|
|
11
|
+
|
|
12
|
+
const app = new Hono();
|
|
13
|
+
const PORT = Number(process.env.PORT || 3000);
|
|
14
|
+
const NSCOUT_BIN = (process.env.NSCOUT_BIN || "nscout").split(" ");
|
|
15
|
+
const [bin, ...binArgs] = NSCOUT_BIN;
|
|
16
|
+
|
|
17
|
+
function runNscout(args: string[]): Promise<string> {
|
|
18
|
+
return new Promise((resolve, reject) => {
|
|
19
|
+
execFile(bin, [...binArgs, ...args], { env: { ...process.env } }, (err, stdout, stderr) => {
|
|
20
|
+
if (err) reject(new Error(stderr || err.message));
|
|
21
|
+
else resolve(stdout);
|
|
22
|
+
});
|
|
23
|
+
});
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
app.post("/api/check", async (c) => {
|
|
27
|
+
const { names, registries, domains } = await c.req.json<{
|
|
28
|
+
names: string[];
|
|
29
|
+
registries: string[];
|
|
30
|
+
domains: string[];
|
|
31
|
+
}>();
|
|
32
|
+
|
|
33
|
+
const args = [
|
|
34
|
+
...names,
|
|
35
|
+
"--json",
|
|
36
|
+
"--no-color",
|
|
37
|
+
"-r", registries.join(","),
|
|
38
|
+
"-d", domains.join(","),
|
|
39
|
+
];
|
|
40
|
+
|
|
41
|
+
try {
|
|
42
|
+
const stdout = await runNscout(args);
|
|
43
|
+
return c.json(JSON.parse(stdout));
|
|
44
|
+
} catch (err) {
|
|
45
|
+
return c.json({ error: err instanceof Error ? err.message : String(err) }, 500);
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
app.use("/*", serveStatic({ root: "./dist/app" }));
|
|
50
|
+
|
|
51
|
+
serve({ fetch: app.fetch, port: PORT }, () => {
|
|
52
|
+
process.stdout.write(`nscout-ui running at http://localhost:${PORT}\n`);
|
|
53
|
+
});
|