@robinpath/cli 1.74.0 → 1.75.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 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.74.0" : "1.74.0";
18601
+ var CLI_VERSION = true ? "1.75.0" : "1.75.0";
18602
18602
  var FLAG_QUIET = false;
18603
18603
  var FLAG_VERBOSE = false;
18604
18604
  var FLAG_AUTO_ACCEPT = false;
@@ -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
+ }