SandboxesGit

Clone a repository

Clone url into path and return the root of the new work tree.

  • An HTTPS remote authenticates with the project's Git Credentials at the egress gateway. SSH remotes are not supported. The command stops after 4 minutes.
  • Local git writes on one work tree run one at a time. A write through the files endpoints does not wait for them. After a timeout, the outcome is unknown: the command can have run.
  • Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters.
  • Served at the access endpoint of the sandbox (access_endpoint of GET /v1/sandboxes/{sandboxId}), not at the API host.
  • A paused sandbox returns 409, unless resume=true. A sandbox that started before its files server existed returns 409 sandbox_update_required until it restarts.
  • A refused operation returns its code as the problem type.
  • A path that starts with ~ or ~/ names the home directory of the user that the operation runs as. ~name returns 422.
POST
/v1/sandboxes/{sandboxId}/git/clone
AuthorizationBearer <token>

API key starting with tektona_. Create one at app-dev.tektona.ai under API Keys.

In: header

Path Parameters

sandboxId*string

Sandbox ID (ULID)

Query Parameters

resume?boolean

Wake a paused sandbox to serve this request

Request Body

application/json

TypeScript Definitions

Use the request body type in TypeScript.

branch?string

Branch or tag to check out; defaults to the remote HEAD

Match^[^-\x00\n\r][^\x00\n\r]*$
depth?integer

Clone only this many commits; 0 clones the whole history

Formatint32
Range0 <= value
path*string

Directory to clone into: absolute, or relative to the sandbox working directory. Its parent must exist

Match^[^-\x00\n\r][^\x00\n\r]*$
url*string

HTTPS remote. The project's Git Credentials authenticate it at the egress gateway; SSH remotes are not supported

Match^https://[^\x00\n\r]+$

Response Body

application/json

application/problem+json

curl -X POST "https://example.com/v1/sandboxes/string/git/clone" \  -H "Content-Type: application/json" \  -d '{    "path": "string",    "url": "string"  }'
{  "root": "string"}

Check out a git ref PUT

Switch to a local branch, or detach `HEAD` at any other revision. - When the switch would overwrite local changes, it fails with `git_failed`. - Local git writes on one work tree run one at a time. A write through the files endpoints does not wait for them. After a timeout, the outcome is unknown: the command can have run. - Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.

Create a git branch POST

Create a branch at `start_point`. With `checkout`, switch to it. - Local git writes on one work tree run one at a time. A write through the files endpoints does not wait for them. After a timeout, the outcome is unknown: the command can have run. - Runs in the sandbox as the image user. Needs write access to the sandbox, because git runs the repository's own config and filters. - Served at the access endpoint of the sandbox (`access_endpoint` of `GET /v1/sandboxes/{sandboxId}`), not at the API host. - A paused sandbox returns 409, unless `resume=true`. A sandbox that started before its files server existed returns 409 `sandbox_update_required` until it restarts. - A refused operation returns its code as the problem type. - A path that starts with `~` or `~/` names the home directory of the user that the operation runs as. `~name` returns 422.