Modules@robinpath/shell
@robinpath/shell
0.1.0PublicExecute shell commands, inspect the process environment, and query system information
@robinpath/shell
Execute shell commands, inspect the process environment, and query system information
Why use this module?
The shell module lets you:
- Execute a command string in the system shell and return stdout, stderr, and exitCode
- Execute a command string in the system shell and return trimmed stdout. Throws on non-zero exit
- Execute a file directly without a shell and return stdout, stderr, and exitCode
- Find the full path of a command using which (or where on Windows)
- Get a copy of all current environment variables
All functions are callable directly from RobinPath scripts with a simple, consistent API.
Installation
npm install @robinpath/shell
Quick Start
No credentials needed — start using it right away:
shell.run "echo hello"
Available Functions
| Function | Description |
|---|---|
shell.exec | Execute a command string in the system shell and return stdout, stderr, and exitCode |
shell.run | Execute a command string in the system shell and return trimmed stdout. Throws on non-zero exit |
shell.execFile | Execute a file directly without a shell and return stdout, stderr, and exitCode |
shell.which | Find the full path of a command using which (or where on Windows) |
shell.env | Get a copy of all current environment variables |
shell.cwd | Get the current working directory |
shell.exit | Exit the current process with a given exit code |
shell.pid | Get the process ID of the current process |
shell.platform | Get the operating system platform identifier |
shell.uptime | Get the number of seconds the current process has been running |
Examples
Execute a command string in the system shell and return trimmed stdout. Throws on non-zero exit
shell.run "echo hello"
Execute a file directly without a shell and return stdout, stderr, and exitCode
shell.execFile "/usr/bin/node" ["--version"]
Find the full path of a command using which (or where on Windows)
shell.which "node"
Integration with RobinPath
import { RobinPath } from "@wiredwp/robinpath";
import Module from "@robinpath/shell";
const rp = new RobinPath();
rp.registerModule(Module.name, Module.functions);
rp.registerModuleMeta(Module.name, Module.functionMetadata);
const result = await rp.executeScript(`
shell.run "echo hello"
`);
Full API Reference
See MODULE.md for complete documentation including all parameters, return types, error handling, and advanced examples.
Related Modules
@robinpath/json— JSON module for complementary functionality
License
MIT
Versions (1)
| Version | Tag | Published |
|---|---|---|
| 0.1.0 | latest | yesterday |
Related Modules
utilities
1
@dev-tester/hello-world
v2.0.0dev-tester
Updated description
0 downloads
...
utilities
0
@robinpath/apollo
v0.1.1robinpath
Apollo module for RobinPath.
0 downloads
...
utilities
0
@robinpath/archive
v0.1.1robinpath
Create and extract .zip and .tar.gz file archives
0 downloads
...
utilities
0
@robinpath/assert
v0.1.1robinpath
Testing assertions: equal, deepEqual, truthy, falsy, type checks, includes, matches, throws, and more
0 downloads
...
Install
$ robinpath install @robinpath/shell Version0.1.0
LicenseMIT
Unpacked Size4.1 KB
Versions1
Weekly Downloads0
Total Downloads0
Stars0
Last Publishyesterday
Createdyesterday

