← 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

FieldTypeRequiredDefaultDescription
urlstringyesRepository URL
deststringnoDestination directory (default: derived from URL)
branchstringnoBranch to clone (default: default branch)
depthnumbernoCreate shallow clone with depth (default: full clone)
cwdstringnoWorking directory

Output

FieldTypeRequiredDefaultDescription
pathstringyesThe folder of the clone
branchstringyesThe 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": {}
  }
}