---
title: Getting started
description: Install the CLI, push a site, and manage its commit history.
order: 2
---

# Getting started

```sh
npm install -g @scrapheap/cli
scrapheap push ./dist -m "Initial deploy"
```

The first push creates a public site, an Artifact repository, a commit on `main`, and `scrapheap-site.json`. Later pushes advance `main` and deploy immediately.

```sh
scrapheap push
scrapheap history
scrapheap rollback <sha>
```

Rollback creates a new commit whose tree matches the selected commit. It does not rewind history.

Anonymous sites are read-only, expire after 72 hours, and are limited to three per device. Claim them:

```sh
scrapheap login --email you@example.com
```

Open the printed browser URL, enter the six-digit email code, and approve the displayed code. The CLI stores a revocable 30-day credential and refreshes one-hour access tokens automatically.

Manage access:

```sh
scrapheap access private
scrapheap invite teammate@example.com
scrapheap invite --list
scrapheap invite --remove teammate@example.com
```

Use `--site <slug>` when a directory has no manifest or you want to address a different site. Every command supports `--json`.
