---
title: "Git CLI"
description: "Use Freestyle CLI commands for Git repository lifecycle operations."
url: "/docs/git/cli"
---

Use the CLI for quick repository operations. Use native Git for clone, push, and fetch.


## Prerequisites

```bash
export FREESTYLE_API_KEY="your-api-key"
```

Run commands with `npx freestyle`.


## Create Repositories

```bash
npx freestyle git create
```

Create with options:

```bash
npx freestyle git create \
  --name my-repo \
  --public \
  --default-branch main
```

Create from an existing source:

```bash
npx freestyle git create \
  --source-url https://github.com/owner/repo.git \
  --source-rev main
```


## List Repositories

```bash
npx freestyle git list --limit 20
npx freestyle git list --json
```


## Delete A Repository

```bash
npx freestyle git delete <repo-id>
```


## Use Native Git

```bash
git clone https://x-access-token:<token>@git.freestyle.sh/<repo-id>
git push origin main
```

For hooks, GitHub Sync, repository contents, and search, use the SDK/API docs.
