Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/cli-run"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["cli","run"], { path: [] });
console.log(JSON.stringify(result));From the command line
$ mark cli run --path <string[]>
As data, in a program
{ "$proc": ["cli", "run"], "input": { "path": [] } }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"path": {
"type": "array",
"items": {
"type": "string"
},
"description": "Procedure path to call, e.g. [\"lib\", \"new\"] for \"mark lib new\""
},
"args": {
"description": "Named arguments as key-value pairs, e.g. { name: \"foo\" } -> \"--name foo\"",
"type": "object",
"propertyNames": {
"type": "string"
},
"additionalProperties": {
"type": [
"string",
"number",
"boolean"
]
}
},
"positional": {
"description": "Positional arguments after the path",
"type": "array",
"items": {
"type": "string"
}
},
"cwd": {
"description": "Working directory",
"type": "string"
},
"timeout": {
"description": "Timeout in milliseconds",
"type": "number"
}
},
"required": [
"path"
]
},
"output": {
"type": "object",
"properties": {
"exitCode": {
"type": "number",
"description": "The exit code of mark"
},
"stdout": {
"type": "string",
"description": "The standard output of mark"
},
"stderr": {
"type": "string",
"description": "The standard error of mark"
},
"success": {
"type": "boolean",
"description": "True when the exit code is 0"
},
"duration": {
"type": "number",
"description": "The time of the command, in milliseconds"
}
},
"required": [
"exitCode",
"stdout",
"stderr",
"success",
"duration"
],
"additionalProperties": {}
}
}