Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/git/register"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["git","show"], {});
console.log(JSON.stringify(result));From the command line
$ mark git show
As data, in a program
{ "$proc": ["git", "show"], "input": {} }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"ref": {
"description": "The commit, branch or tag (default: HEAD)",
"type": "string"
},
"path": {
"description": "A file, relative to the root of the repository: the call gives its content at the commit",
"type": "string"
},
"stat": {
"description": "Give the counts of the files, without the text of the diff (default: false)",
"type": "boolean"
},
"cwd": {
"description": "Working directory",
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"ref": {
"type": "string",
"description": "The ref of the input"
},
"hash": {
"type": "string",
"description": "The hash of the commit"
},
"shortHash": {
"description": "The short hash",
"type": "string"
},
"author": {
"description": "The author name",
"type": "string"
},
"email": {
"description": "The author email",
"type": "string"
},
"date": {
"description": "The author date",
"type": "string"
},
"message": {
"description": "The subject of the commit message",
"type": "string"
},
"body": {
"description": "The commit message after the subject",
"type": "string"
},
"files": {
"description": "The changed files, against the first parent",
"type": "array",
"items": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The path of the file (for a rename, the new path)"
},
"from": {
"description": "For a rename, the old path",
"type": "string"
},
"additions": {
"type": "number",
"description": "The added lines (0 for a binary file)"
},
"deletions": {
"type": "number",
"description": "The deleted lines (0 for a binary file)"
}
},
"required": [
"path",
"additions",
"deletions"
],
"additionalProperties": {}
}
},
"additions": {
"description": "The added lines of all files",
"type": "number"
},
"deletions": {
"description": "The deleted lines of all files",
"type": "number"
},
"diff": {
"description": "The text of the diff",
"type": "string"
},
"path": {
"description": "With path: the file",
"type": "string"
},
"content": {
"description": "With path: the content of the file at the commit",
"type": "string"
}
},
"required": [
"ref",
"hash"
],
"additionalProperties": {}
}
}