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","blame"], { path: "<path>" });
console.log(JSON.stringify(result));From the command line
$ mark git blame --path <string>
As data, in a program
{ "$proc": ["git", "blame"], "input": { "path": "<path>" } }JSON Schemas
{
"input": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The file"
},
"ref": {
"description": "The commit (default: the working tree)",
"type": "string"
},
"startLine": {
"description": "The first line (default: 1)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"endLine": {
"description": "The last line (default: the last line of the file)",
"type": "integer",
"exclusiveMinimum": 0,
"maximum": 9007199254740991
},
"cwd": {
"description": "Working directory",
"type": "string"
}
},
"required": [
"path"
]
},
"output": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The file"
},
"lines": {
"type": "array",
"items": {
"type": "object",
"properties": {
"line": {
"type": "number",
"description": "The line number (1 is the first line)"
},
"hash": {
"type": "string",
"description": "The commit that last changed the line (zeros when it is not committed)"
},
"author": {
"type": "string",
"description": "The author name"
},
"email": {
"type": "string",
"description": "The author email"
},
"date": {
"type": "string",
"description": "The author date, as an ISO 8601 string"
},
"summary": {
"type": "string",
"description": "The subject of the commit"
},
"content": {
"type": "string",
"description": "The text of the line"
}
},
"required": [
"line",
"hash",
"author",
"email",
"date",
"summary",
"content"
],
"additionalProperties": {}
},
"description": "The lines of the file"
}
},
"required": [
"path",
"lines"
],
"additionalProperties": {}
}
}