Use it
In TypeScript
import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/git"; // registers its procedures
const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["git","diff"], {});
console.log(JSON.stringify(result));From the command line
$ mark git diff
As data, in a program
{ "$proc": ["git", "diff"], "input": {} }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"staged": {
"default": false,
"description": "Show staged changes (default: false, shows unstaged)",
"type": "boolean"
},
"ref": {
"description": "Compare against ref (branch/commit)",
"type": "string"
},
"paths": {
"description": "Specific paths to diff",
"type": "array",
"items": {
"type": "string"
}
},
"stat": {
"default": false,
"description": "Show stat summary only (default: false)",
"type": "boolean"
},
"cwd": {
"description": "Working directory",
"type": "string"
}
}
},
"output": {
"type": "object",
"properties": {
"files": {
"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": {}
},
"description": "The changed files"
},
"additions": {
"type": "number",
"description": "The added lines of all files"
},
"deletions": {
"type": "number",
"description": "The deleted lines of all files"
},
"diff": {
"description": "The text of the diff",
"type": "string"
}
},
"required": [
"files",
"additions",
"deletions"
],
"additionalProperties": {}
}
}