prior-cli 1.5.2 → 1.5.4
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 +82 -0
- package/lib/tools.js +40 -0
- package/package.json +3 -2
package/README.md
ADDED
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Prior CLI
|
|
2
|
+
|
|
3
|
+
**Prior** is an AI assistant for your terminal — built on the Prior Network platform.
|
|
4
|
+
|
|
5
|
+
```
|
|
6
|
+
██████╗ ██████╗ ██╗ ██████╗ ██████╗
|
|
7
|
+
██╔══██╗██╔══██╗██║██╔═══██╗██╔══██╗
|
|
8
|
+
██████╔╝██████╔╝██║██║ ██║██████╔╝
|
|
9
|
+
██╔═══╝ ██╔══██╗██║██║ ██║██╔══██╗
|
|
10
|
+
██║ ██║ ██║██║╚██████╔╝██║ ██║
|
|
11
|
+
╚═╝ ╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═╝
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
## Install
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install -g prior-cli
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Login
|
|
21
|
+
|
|
22
|
+
```bash
|
|
23
|
+
prior login
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
Opens a browser window to sign in with your Prior Network account.
|
|
27
|
+
|
|
28
|
+
## Usage
|
|
29
|
+
|
|
30
|
+
```bash
|
|
31
|
+
prior chat
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
Starts an interactive chat session. Prior can read and write files, run shell commands, search the web, check the weather, generate images, and interact with the Prior Network — all from a single prompt.
|
|
35
|
+
|
|
36
|
+
## What Prior can do
|
|
37
|
+
|
|
38
|
+
| Capability | Example prompt |
|
|
39
|
+
|---|---|
|
|
40
|
+
| **Files** | `read the file package.json` |
|
|
41
|
+
| **Shell** | `what node version am i on` |
|
|
42
|
+
| **Web search** | `what is the latest news in the philippines` |
|
|
43
|
+
| **Weather** | `what's the weather in tokyo` |
|
|
44
|
+
| **Image generation** | `generate a sunset over the ocean` |
|
|
45
|
+
| **Clipboard** | `read my clipboard` |
|
|
46
|
+
| **Prior Network** | `show my prior profile` |
|
|
47
|
+
| **Coding** | `write a python script that prints fibonacci numbers` |
|
|
48
|
+
|
|
49
|
+
## Agent mode
|
|
50
|
+
|
|
51
|
+
Prior runs as an autonomous agent — it can chain multiple tool calls together to complete complex tasks without you having to break things down step by step.
|
|
52
|
+
|
|
53
|
+
```
|
|
54
|
+
> find all .js files in this project and tell me which one is the largest
|
|
55
|
+
```
|
|
56
|
+
|
|
57
|
+
Prior will list the directory, check file sizes, and report back — all in one go.
|
|
58
|
+
|
|
59
|
+
## Slash commands
|
|
60
|
+
|
|
61
|
+
| Command | Description |
|
|
62
|
+
|---|---|
|
|
63
|
+
| `/help` | Show available commands |
|
|
64
|
+
| `/clear` | Clear the conversation |
|
|
65
|
+
| `/uncensored` | Enable uncensored mode |
|
|
66
|
+
| `/censored` | Return to default mode |
|
|
67
|
+
| `/exit` | Exit the CLI |
|
|
68
|
+
|
|
69
|
+
## Tips
|
|
70
|
+
|
|
71
|
+
- **Multiline input** — end a line with `\` and press Enter to continue on the next line
|
|
72
|
+
- **Clipboard images** — press `Alt+V` to attach an image from your clipboard
|
|
73
|
+
- **Cancel** — press `Ctrl+C` to cancel a running response
|
|
74
|
+
|
|
75
|
+
## Requirements
|
|
76
|
+
|
|
77
|
+
- Node.js 16+
|
|
78
|
+
- A [Prior Network](https://prior.ngrok.app) account
|
|
79
|
+
|
|
80
|
+
## License
|
|
81
|
+
|
|
82
|
+
MIT
|
package/lib/tools.js
CHANGED
|
@@ -376,6 +376,46 @@ const TOOLS = {
|
|
|
376
376
|
summary: `@${u.username || '?'}`,
|
|
377
377
|
};
|
|
378
378
|
},
|
|
379
|
+
async zap_scan({ url, scan_type = 'passive' }, { token }) {
|
|
380
|
+
if (!url) throw new Error('"url" is required');
|
|
381
|
+
const res = await fetch(`${CLI_BASE}/api/zap/scan`, {
|
|
382
|
+
method: 'POST',
|
|
383
|
+
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
|
|
384
|
+
body: JSON.stringify({ url, scan_type }),
|
|
385
|
+
timeout: 60000,
|
|
386
|
+
});
|
|
387
|
+
if (res.status === 403) throw new Error('ZAP tools are only available to Organization accounts.');
|
|
388
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
389
|
+
const data = await res.json();
|
|
390
|
+
return { output: data.output || JSON.stringify(data), summary: data.summary || `scan started for ${url}` };
|
|
391
|
+
},
|
|
392
|
+
|
|
393
|
+
async zap_alerts({ url }, { token }) {
|
|
394
|
+
const res = await fetch(`${CLI_BASE}/api/zap/alerts`, {
|
|
395
|
+
method: 'POST',
|
|
396
|
+
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
|
|
397
|
+
body: JSON.stringify({ url }),
|
|
398
|
+
timeout: 15000,
|
|
399
|
+
});
|
|
400
|
+
if (res.status === 403) throw new Error('ZAP tools are only available to Organization accounts.');
|
|
401
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
402
|
+
const data = await res.json();
|
|
403
|
+
return { output: data.output || JSON.stringify(data), summary: data.summary || 'alerts fetched' };
|
|
404
|
+
},
|
|
405
|
+
|
|
406
|
+
async zap_spider({ url }, { token }) {
|
|
407
|
+
if (!url) throw new Error('"url" is required');
|
|
408
|
+
const res = await fetch(`${CLI_BASE}/api/zap/spider`, {
|
|
409
|
+
method: 'POST',
|
|
410
|
+
headers: { 'Content-Type': 'application/json', Authorization: `Bearer ${token}` },
|
|
411
|
+
body: JSON.stringify({ url }),
|
|
412
|
+
timeout: 60000,
|
|
413
|
+
});
|
|
414
|
+
if (res.status === 403) throw new Error('ZAP tools are only available to Organization accounts.');
|
|
415
|
+
if (!res.ok) { const e = await res.json().catch(() => ({})); throw new Error(e.error || `HTTP ${res.status}`); }
|
|
416
|
+
const data = await res.json();
|
|
417
|
+
return { output: data.output || JSON.stringify(data), summary: data.summary || `spider started for ${url}` };
|
|
418
|
+
},
|
|
379
419
|
};
|
|
380
420
|
|
|
381
421
|
async function executeTool(name, args, context) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "prior-cli",
|
|
3
|
-
"version": "1.5.
|
|
3
|
+
"version": "1.5.4",
|
|
4
4
|
"description": "Prior Network AI — command-line interface",
|
|
5
5
|
"bin": {
|
|
6
6
|
"prior": "bin/prior.js"
|
|
@@ -26,6 +26,7 @@
|
|
|
26
26
|
"license": "MIT",
|
|
27
27
|
"files": [
|
|
28
28
|
"bin/",
|
|
29
|
-
"lib/"
|
|
29
|
+
"lib/",
|
|
30
|
+
"README.md"
|
|
30
31
|
]
|
|
31
32
|
}
|