---
title: "Start or continue the git lane for saved packages: mint a short-lived Cloudflare Artifacts git remote so coding agent..."
method: POST
path: "/v1/packages/{package_id}/git-remote"
tags: ["packages"]
---

# Start or continue the git lane for saved packages: mint a short-lived Cloudflare Artifacts git remote so coding agent...

`POST /v1/packages/{package_id}/git-remote`

## Request

- Base URL: `https://api.kody.codes`
- URL: `https://api.kody.codes/v1/packages/{package_id}/git-remote`
- Auth: HTTP bearer

Start or continue the git lane for saved packages: mint a short-lived Cloudflare Artifacts git remote so coding agents with local filesystem/git access can clone into a temporary directory. When scope is omitted, defaults to write if you have write access to the package, otherwise read. Pass scope explicitly to force read or write; requesting write without write access is denied with guidance (use scope: 'read', ask an Owner for a grant, or communityFork a public package). A read remote rejects push with: this remote is read-only; request scope: 'write'. Pass `create: true` with a new `@scope/leaf` name (or the name leaf) to register a stub saved package and mint its remote in one call, so new packages can be authored via clone-edit-push instead of packageSave file blobs. Prefer the scoped name for existing packages; use `package_id` only when the name is not known. The result includes `git_author` (signed-in Kody account email and display name) and `setup_commands` that set local `user.email` / `user.name` to that identity — never invent a git email. Write access verifies the current package source has a restorable backup snapshot before clone/edit/publish. Individual files may be at most 10 MiB (10,485,760 stored bytes; UTF-8 for text, raw for binary): publish rejects anything larger with external-hosting guidance (commit a link or pointer instead), and the Artifacts remote itself fails pushes above ~32 MiB of pack content with a raw HTTP 413.

Org permission: `package:read`.

## Path parameters

- `package_id` string, required: Saved-package UUID. Use when the scoped name is not known, or for a stable ref.

## Request body

- object
  - `kody_id` string: Package name (`@owner/leaf` or the name leaf). Prefer this when you know the name.
  - `create` boolean: Set true with the new `@scope/leaf` name (or the name leaf) to register a new stub saved package (private, minimal scaffold) when none exists yet, then mint its remote in the same call. Existing packages are reused as-is. Prefer the scoped name for existing packages; use `package_id` only when the name is not known.
  - `description` string: Package description used when `create: true` registers a new stub package. At most 200 characters (short public tagline). Ignored for existing packages.
  - `scope` 'read' | 'write': Access scope for the minted Artifacts token. When omitted, defaults to write if you have write access to the package, otherwise read. Explicit scope is honored; requesting write without write access is denied. A read remote rejects push with: this remote is read-only; request scope: 'write'.
  - `ttl_seconds` integer

## Response `200`

Success.

- object
  - `package_id` string, required
  - `kody_id` string, required: Package name leaf (same value as `slug`).
  - `slug` string, required: Package name leaf (same value as `kody_id`).
  - `created` boolean, required: True when this call registered a new stub saved package before minting the remote.
  - `remote` string, required
  - `authenticated_remote` string, required
  - `git_extra_header` string, required
  - `scope` 'read' | 'write', required
  - `expires_at` string, required
  - `git_author` object, required: Git author for this clone: the signed-in Kody account. setup_commands set local user.name and user.email to these values.
    - `name` string, required: Signed-in Kody account display name. Use as git user.name; do not guess a name.
    - `email` string, email, required: Signed-in Kody account email. Use as git user.email; never invent an email.
  - `setup_commands` string[], required

## Other responses

- `400`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `401`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `403`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `404`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `409`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `413`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `429`: Too many requests (edge IP/token limit) or an entitlement / plan-cap limit. Wait at least `Retry-After` seconds before retrying.
- `500`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `503`: Error envelope `{ "error": { "code", "message", "details"? } }`.
- `default`: Error envelope `{ "error": { "code", "message", "details"? } }`.

---

[API](https://skmtc.dev/kody/apis/kody-api.md) · [All operations](https://skmtc.dev/kody/apis/kody-api/llms.txt) · [OpenAPI document](https://skmtc.dev/kody/apis/kody-api/revisions/705f4f022728?raw)
