← All procedures
git.clone
Clone repository
CLI- Package
- @procedures/git · README
- Path
["git","clone"]- CLI
mark git clone --url <string>- As data
{"$proc":["git","clone"],"input":{}}
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","clone"], { url: "<url>" });
console.log(JSON.stringify(result));From the command line
$ mark git clone --url <string>
As data, in a program
{ "$proc": ["git", "clone"], "input": { "url": "<url>" } }Input
| Field | Type | Required | Default | Description |
|---|
url | string | yes | | Repository URL |
dest | string | no | | Destination directory (default: derived from URL) |
branch | string | no | | Branch to clone (default: default branch) |
depth | number | no | | Create shallow clone with depth (default: full clone) |
cwd | string | no | | Working directory |
Output
| Field | Type | Required | Default | Description |
|---|
path | string | yes | | The folder of the clone |
branch | string | yes | | The branch of the clone |
JSON Schemas
{
"input": {
"type": "object",
"properties": {
"url": {
"type": "string",
"description": "Repository URL"
},
"dest": {
"description": "Destination directory (default: derived from URL)",
"type": "string"
},
"branch": {
"description": "Branch to clone (default: default branch)",
"type": "string"
},
"depth": {
"description": "Create shallow clone with depth (default: full clone)",
"type": "number"
},
"cwd": {
"description": "Working directory",
"type": "string"
}
},
"required": [
"url"
]
},
"output": {
"type": "object",
"properties": {
"path": {
"type": "string",
"description": "The folder of the clone"
},
"branch": {
"type": "string",
"description": "The branch of the clone"
}
},
"required": [
"path",
"branch"
],
"additionalProperties": {}
}
}