← All procedures
shell.which
Find the path to a command
CLI- Package
- @procedures/shell · README
- Path
["shell","which"]- CLI
mark shell which --command <string>- As data
{"$proc":["shell","which"],"input":{}}
Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/shell"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["shell","which"], { command: "<command>" });
console.log(JSON.stringify(result));From the command line
$ mark shell which --command <string>
As data, in a program
{ "$proc": ["shell", "which"], "input": { "command": "<command>" } }Input
| Field | Type | Required | Default | Description |
|---|
command | string | yes | | Command to find |
Output
| Field | Type | Required | Default | Description |
|---|
path | string | null | yes | | The full path of the program, or null when it is not found |
found | boolean | yes | | True when the program is found |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"command": {
"type": "string",
"description": "Command to find"
}
},
"required": [
"command"
]
},
"output": {
"type": "object",
"properties": {
"path": {
"description": "The full path of the program, or null when it is not found",
"type": [
"string",
"null"
]
},
"found": {
"type": "boolean",
"description": "True when the program is found"
}
},
"required": [
"path",
"found"
],
"additionalProperties": {}
}
}