---
title: "Freestyle CLI"
description: "Install and use the Freestyle CLI for local VM and Git workflows."
url: "/docs/cli"
---

The Freestyle CLI is for one-off operations while developing, debugging, or automating local workflows. Use the SDK for application code, and use the CLI when you want to inspect or operate on VMs and Git repositories from a terminal.


## Install

Run the CLI without installing it globally:

```bash
npx freestyle --help
```

Or install the package globally:

```bash pnpm
pnpm add -g freestyle
```

```bash bun
bun add -g freestyle
```

```bash npm
npm install -g freestyle
```

```bash yarn
yarn global add freestyle
```

Then verify the command is available:

```bash
freestyle --help
```


## Authenticate

Authenticate the CLI in one of two ways.

Log in through your browser with OAuth. This stores your credentials and sets a default team, so it's the easiest option for local development:

```bash
freestyle login
```

Or set an API key directly, which is the better fit for CI and scripts:

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

If `FREESTYLE_API_KEY` is set, the CLI uses it. Otherwise it falls back to your `freestyle login` session.


## VM Commands

Create a VM and run a command:

```bash
npx freestyle vm create --exec 'uname -a'
```

Start a temporary SSH session:

```bash
npx freestyle vm create --ssh --delete
```

See [VM CLI](https://www.freestyle.sh/docs/vms/cli) for VM list, exec, SSH, and delete commands.


## Git Commands

Create a repository:

```bash
npx freestyle git create
```

List repositories:

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

See [Git CLI](https://www.freestyle.sh/docs/git/cli) for repository lifecycle commands and native Git usage.
