@robinpath/cli 1.75.0 → 1.76.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/README.md +111 -111
- package/dist/cli.mjs +7 -3
- package/modules/_helpers.js +33 -33
- package/modules/assert.js +270 -270
- package/modules/buffer.js +245 -245
- package/modules/child.js +176 -176
- package/modules/crypto.js +352 -352
- package/modules/dns.js +146 -146
- package/modules/events.js +174 -174
- package/modules/file.js +361 -361
- package/modules/http.js +268 -268
- package/modules/index.js +76 -76
- package/modules/net.js +189 -189
- package/modules/os.js +219 -219
- package/modules/path.js +162 -162
- package/modules/process.js +214 -214
- package/modules/stream.js +322 -322
- package/modules/string_decoder.js +106 -106
- package/modules/timer.js +167 -167
- package/modules/tls.js +264 -264
- package/modules/tty.js +169 -169
- package/modules/url.js +189 -189
- package/modules/util.js +275 -275
- package/modules/zlib.js +126 -126
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,111 +1,111 @@
|
|
|
1
|
-
# RobinPath CLI
|
|
2
|
-
|
|
3
|
-
Scripting language for automation — with built-in AI that understands your code.
|
|
4
|
-
|
|
5
|
-
## Install
|
|
6
|
-
|
|
7
|
-
**Windows** (PowerShell):
|
|
8
|
-
```powershell
|
|
9
|
-
irm https://dev.robinpath.com/install.ps1 | iex
|
|
10
|
-
```
|
|
11
|
-
|
|
12
|
-
**macOS / Linux**:
|
|
13
|
-
```sh
|
|
14
|
-
curl -fsSL https://dev.robinpath.com/install.sh | bash
|
|
15
|
-
```
|
|
16
|
-
|
|
17
|
-
Then restart your terminal and verify:
|
|
18
|
-
```
|
|
19
|
-
robinpath --version
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
## Quick Start
|
|
23
|
-
|
|
24
|
-
```sh
|
|
25
|
-
# Run a script
|
|
26
|
-
robinpath app.rp
|
|
27
|
-
|
|
28
|
-
# Inline code
|
|
29
|
-
robinpath -e 'log "Hello World"'
|
|
30
|
-
|
|
31
|
-
# AI code generation (streaming)
|
|
32
|
-
robinpath -p "read a csv and send email to each row"
|
|
33
|
-
|
|
34
|
-
# AI + save to file
|
|
35
|
-
robinpath -p "implement quicksort" --save
|
|
36
|
-
|
|
37
|
-
# AI + save and run
|
|
38
|
-
robinpath -p "fetch weather for London" --save --run
|
|
39
|
-
|
|
40
|
-
# Interactive AI assistant
|
|
41
|
-
robinpath
|
|
42
|
-
```
|
|
43
|
-
|
|
44
|
-
## AI Mode
|
|
45
|
-
|
|
46
|
-
RobinPath has a built-in AI assistant that knows the entire language and all 210+ modules.
|
|
47
|
-
|
|
48
|
-
```
|
|
49
|
-
robinpath -p "your question" # Headless (streaming output)
|
|
50
|
-
robinpath -p "..." --save # Generate and save to .rp file
|
|
51
|
-
robinpath -p "..." --run # Generate, save, and run
|
|
52
|
-
robinpath -p "..." -o app.rp # Save to specific file
|
|
53
|
-
robinpath # Interactive AI REPL
|
|
54
|
-
```
|
|
55
|
-
|
|
56
|
-
The AI works in any language — English, Russian, Romanian, Spanish, Chinese, etc.
|
|
57
|
-
|
|
58
|
-
To use the interactive REPL with your own model:
|
|
59
|
-
```
|
|
60
|
-
robinpath ai config set-key <your-openrouter-key>
|
|
61
|
-
robinpath ai config set-model anthropic/claude-sonnet-4-20250514
|
|
62
|
-
```
|
|
63
|
-
|
|
64
|
-
## Modules
|
|
65
|
-
|
|
66
|
-
210+ built-in and installable modules for common tasks:
|
|
67
|
-
|
|
68
|
-
```sh
|
|
69
|
-
robinpath add @robinpath/slack # Install a module
|
|
70
|
-
robinpath remove @robinpath/slack # Remove a module
|
|
71
|
-
robinpath search slack # Search the registry
|
|
72
|
-
robinpath info @robinpath/slack # Module details
|
|
73
|
-
```
|
|
74
|
-
|
|
75
|
-
## Commands
|
|
76
|
-
|
|
77
|
-
| Command | Description |
|
|
78
|
-
|---------|-------------|
|
|
79
|
-
| `<file.rp>` | Run a script |
|
|
80
|
-
| `-p "prompt"` | AI code generation |
|
|
81
|
-
| `-e "code"` | Execute inline code |
|
|
82
|
-
| `add <pkg>` | Install a module |
|
|
83
|
-
| `remove <pkg>` | Remove a module |
|
|
84
|
-
| `search <query>` | Search modules |
|
|
85
|
-
| `fmt <file>` | Format a script |
|
|
86
|
-
| `check <file>` | Syntax check |
|
|
87
|
-
| `test [dir]` | Run test files |
|
|
88
|
-
| `update` | Update CLI to latest |
|
|
89
|
-
| `install` / `uninstall` | System install/remove |
|
|
90
|
-
|
|
91
|
-
## Flags
|
|
92
|
-
|
|
93
|
-
| Flag | Description |
|
|
94
|
-
|------|-------------|
|
|
95
|
-
| `-p "prompt"` | AI headless mode |
|
|
96
|
-
| `--save` | Save generated code to .rp file |
|
|
97
|
-
| `--run` | Save and run generated code |
|
|
98
|
-
| `-o <file>` | Output filename for --save |
|
|
99
|
-
| `-e` | Execute inline code |
|
|
100
|
-
| `-v` | Show version |
|
|
101
|
-
| `-h` | Show help |
|
|
102
|
-
|
|
103
|
-
## Platforms
|
|
104
|
-
|
|
105
|
-
| Platform | Binary |
|
|
106
|
-
|----------|--------|
|
|
107
|
-
| Windows x64 | `robinpath-windows-x64.exe` |
|
|
108
|
-
| macOS ARM64 | `robinpath-macos-arm64` |
|
|
109
|
-
| Linux x64 | `robinpath-linux-x64` |
|
|
110
|
-
|
|
111
|
-
Binaries install to `~/.robinpath/bin/`. Shorthand `rp` works everywhere.
|
|
1
|
+
# RobinPath CLI
|
|
2
|
+
|
|
3
|
+
Scripting language for automation — with built-in AI that understands your code.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
**Windows** (PowerShell):
|
|
8
|
+
```powershell
|
|
9
|
+
irm https://dev.robinpath.com/install.ps1 | iex
|
|
10
|
+
```
|
|
11
|
+
|
|
12
|
+
**macOS / Linux**:
|
|
13
|
+
```sh
|
|
14
|
+
curl -fsSL https://dev.robinpath.com/install.sh | bash
|
|
15
|
+
```
|
|
16
|
+
|
|
17
|
+
Then restart your terminal and verify:
|
|
18
|
+
```
|
|
19
|
+
robinpath --version
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
## Quick Start
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
# Run a script
|
|
26
|
+
robinpath app.rp
|
|
27
|
+
|
|
28
|
+
# Inline code
|
|
29
|
+
robinpath -e 'log "Hello World"'
|
|
30
|
+
|
|
31
|
+
# AI code generation (streaming)
|
|
32
|
+
robinpath -p "read a csv and send email to each row"
|
|
33
|
+
|
|
34
|
+
# AI + save to file
|
|
35
|
+
robinpath -p "implement quicksort" --save
|
|
36
|
+
|
|
37
|
+
# AI + save and run
|
|
38
|
+
robinpath -p "fetch weather for London" --save --run
|
|
39
|
+
|
|
40
|
+
# Interactive AI assistant
|
|
41
|
+
robinpath
|
|
42
|
+
```
|
|
43
|
+
|
|
44
|
+
## AI Mode
|
|
45
|
+
|
|
46
|
+
RobinPath has a built-in AI assistant that knows the entire language and all 210+ modules.
|
|
47
|
+
|
|
48
|
+
```
|
|
49
|
+
robinpath -p "your question" # Headless (streaming output)
|
|
50
|
+
robinpath -p "..." --save # Generate and save to .rp file
|
|
51
|
+
robinpath -p "..." --run # Generate, save, and run
|
|
52
|
+
robinpath -p "..." -o app.rp # Save to specific file
|
|
53
|
+
robinpath # Interactive AI REPL
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The AI works in any language — English, Russian, Romanian, Spanish, Chinese, etc.
|
|
57
|
+
|
|
58
|
+
To use the interactive REPL with your own model:
|
|
59
|
+
```
|
|
60
|
+
robinpath ai config set-key <your-openrouter-key>
|
|
61
|
+
robinpath ai config set-model anthropic/claude-sonnet-4-20250514
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
## Modules
|
|
65
|
+
|
|
66
|
+
210+ built-in and installable modules for common tasks:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
robinpath add @robinpath/slack # Install a module
|
|
70
|
+
robinpath remove @robinpath/slack # Remove a module
|
|
71
|
+
robinpath search slack # Search the registry
|
|
72
|
+
robinpath info @robinpath/slack # Module details
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
## Commands
|
|
76
|
+
|
|
77
|
+
| Command | Description |
|
|
78
|
+
|---------|-------------|
|
|
79
|
+
| `<file.rp>` | Run a script |
|
|
80
|
+
| `-p "prompt"` | AI code generation |
|
|
81
|
+
| `-e "code"` | Execute inline code |
|
|
82
|
+
| `add <pkg>` | Install a module |
|
|
83
|
+
| `remove <pkg>` | Remove a module |
|
|
84
|
+
| `search <query>` | Search modules |
|
|
85
|
+
| `fmt <file>` | Format a script |
|
|
86
|
+
| `check <file>` | Syntax check |
|
|
87
|
+
| `test [dir]` | Run test files |
|
|
88
|
+
| `update` | Update CLI to latest |
|
|
89
|
+
| `install` / `uninstall` | System install/remove |
|
|
90
|
+
|
|
91
|
+
## Flags
|
|
92
|
+
|
|
93
|
+
| Flag | Description |
|
|
94
|
+
|------|-------------|
|
|
95
|
+
| `-p "prompt"` | AI headless mode |
|
|
96
|
+
| `--save` | Save generated code to .rp file |
|
|
97
|
+
| `--run` | Save and run generated code |
|
|
98
|
+
| `-o <file>` | Output filename for --save |
|
|
99
|
+
| `-e` | Execute inline code |
|
|
100
|
+
| `-v` | Show version |
|
|
101
|
+
| `-h` | Show help |
|
|
102
|
+
|
|
103
|
+
## Platforms
|
|
104
|
+
|
|
105
|
+
| Platform | Binary |
|
|
106
|
+
|----------|--------|
|
|
107
|
+
| Windows x64 | `robinpath-windows-x64.exe` |
|
|
108
|
+
| macOS ARM64 | `robinpath-macos-arm64` |
|
|
109
|
+
| Linux x64 | `robinpath-linux-x64` |
|
|
110
|
+
|
|
111
|
+
Binaries install to `~/.robinpath/bin/`. Shorthand `rp` works everywhere.
|
package/dist/cli.mjs
CHANGED
|
@@ -18598,7 +18598,7 @@ function getNativeModules() {
|
|
|
18598
18598
|
import { join as join3, basename as basename2 } from "node:path";
|
|
18599
18599
|
import { homedir as homedir2, platform as platform2 } from "node:os";
|
|
18600
18600
|
import { existsSync as existsSync2 } from "node:fs";
|
|
18601
|
-
var CLI_VERSION = true ? "1.
|
|
18601
|
+
var CLI_VERSION = true ? "1.76.0" : "1.76.0";
|
|
18602
18602
|
var FLAG_QUIET = false;
|
|
18603
18603
|
var FLAG_VERBOSE = false;
|
|
18604
18604
|
var FLAG_AUTO_ACCEPT = false;
|
|
@@ -24201,7 +24201,7 @@ function collectInkInput(placeholder) {
|
|
|
24201
24201
|
}
|
|
24202
24202
|
return new Promise((resolve13) => {
|
|
24203
24203
|
let resolved = false;
|
|
24204
|
-
const
|
|
24204
|
+
const instance = render(
|
|
24205
24205
|
/* @__PURE__ */ jsx(
|
|
24206
24206
|
InputPrompt,
|
|
24207
24207
|
{
|
|
@@ -24209,19 +24209,23 @@ function collectInkInput(placeholder) {
|
|
|
24209
24209
|
onSubmit: (v) => {
|
|
24210
24210
|
if (!resolved) {
|
|
24211
24211
|
resolved = true;
|
|
24212
|
+
instance.clear();
|
|
24213
|
+
instance.unmount();
|
|
24212
24214
|
resolve13(v);
|
|
24213
24215
|
}
|
|
24214
24216
|
},
|
|
24215
24217
|
onExit: () => {
|
|
24216
24218
|
if (!resolved) {
|
|
24217
24219
|
resolved = true;
|
|
24220
|
+
instance.clear();
|
|
24221
|
+
instance.unmount();
|
|
24218
24222
|
resolve13(null);
|
|
24219
24223
|
}
|
|
24220
24224
|
}
|
|
24221
24225
|
}
|
|
24222
24226
|
)
|
|
24223
24227
|
);
|
|
24224
|
-
waitUntilExit().then(() => {
|
|
24228
|
+
instance.waitUntilExit().then(() => {
|
|
24225
24229
|
if (!resolved) {
|
|
24226
24230
|
resolved = true;
|
|
24227
24231
|
resolve13(null);
|
package/modules/_helpers.js
CHANGED
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Shared helpers for RobinPath native modules.
|
|
3
|
-
*/
|
|
4
|
-
import { resolve } from 'node:path';
|
|
5
|
-
|
|
6
|
-
/** Coerce value to string with fallback */
|
|
7
|
-
export function toStr(val, fallback = '') {
|
|
8
|
-
return val == null ? fallback : String(val);
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
/** Coerce value to number with fallback */
|
|
12
|
-
export function toNum(val, fallback = 0) {
|
|
13
|
-
const n = Number(val);
|
|
14
|
-
return Number.isNaN(n) ? fallback : n;
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/** Coerce value to boolean */
|
|
18
|
-
export function toBool(val) {
|
|
19
|
-
if (val === 'false' || val === '0' || val === '') return false;
|
|
20
|
-
return Boolean(val);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
/** Require minimum number of arguments or throw */
|
|
24
|
-
export function requireArgs(funcName, args, min) {
|
|
25
|
-
if (!args || args.length < min) {
|
|
26
|
-
throw new Error(`${funcName} requires at least ${min} argument(s)`);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
/** Resolve a file path (handles relative + absolute) */
|
|
31
|
-
export function toPath(val) {
|
|
32
|
-
return resolve(String(val ?? ''));
|
|
33
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* Shared helpers for RobinPath native modules.
|
|
3
|
+
*/
|
|
4
|
+
import { resolve } from 'node:path';
|
|
5
|
+
|
|
6
|
+
/** Coerce value to string with fallback */
|
|
7
|
+
export function toStr(val, fallback = '') {
|
|
8
|
+
return val == null ? fallback : String(val);
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
/** Coerce value to number with fallback */
|
|
12
|
+
export function toNum(val, fallback = 0) {
|
|
13
|
+
const n = Number(val);
|
|
14
|
+
return Number.isNaN(n) ? fallback : n;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/** Coerce value to boolean */
|
|
18
|
+
export function toBool(val) {
|
|
19
|
+
if (val === 'false' || val === '0' || val === '') return false;
|
|
20
|
+
return Boolean(val);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/** Require minimum number of arguments or throw */
|
|
24
|
+
export function requireArgs(funcName, args, min) {
|
|
25
|
+
if (!args || args.length < min) {
|
|
26
|
+
throw new Error(`${funcName} requires at least ${min} argument(s)`);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
/** Resolve a file path (handles relative + absolute) */
|
|
31
|
+
export function toPath(val) {
|
|
32
|
+
return resolve(String(val ?? ''));
|
|
33
|
+
}
|