# Licensing

> How a vidmake license works. You pay once and get every update of the major version you buy, on a few Macs at once, offline included; the next major version is offered to license holders at a discount.

vidmake is sold once, not by subscription. A license costs **$79**, paid once through Stripe, and gives you:

- vidmake for Mac (the studio and the `vidmake` command), for any use, commercial included. The videos you make
  are yours;
- **every update of the major version you buy**, for good: a 1.x license gets 1.0, 1.1, 1.2 and every later 1.x;
- use on up to **3 Macs at once**;
- **50% off the next major version** when it ships. You don't have to upgrade: the version you have
  keeps working and keeps getting its updates.

The easiest way to buy is from the app: [download vidmake](https://vidmake.app/docs/installation.md), open it, and choose **Buy
vidmake**. vidmake unlocks itself as soon as the payment goes through. You can also [buy on the site](https://vidmake.app/#pricing); the
page after checkout shows your license key, and the same key comes by email either way.

## Activating a Mac

The app activates the Mac it runs on: when you buy from it, or when you enter your key in its paywall (**I have a
license key**). The studio and the `vidmake` command share one activation, so either unlocks both. From a terminal:

```bash
vidmake license activate VMK-XXXXX-XXXXX-XXXXX-XXXXX
```

```output
✓ activated vidmake on this machine
license   VMK-XXXXX-…-XXXXX
email     you@example.com
covers    vidmake 1.x and older, with every 1.x update
machines  up to 3
this one  studio-mac (347e15dac9fb)
checks in within 30 days (works offline until then)
```

Without a license, the studio shows its paywall, and every command except `docs`, `schema`, `update` and
`license` stops with exit status 3:

```output
error: vidmake needs a license to run. Open the vidmake app to buy one or enter your key (one payment; updates until the next major version), or run
  vidmake license activate <KEY>
Buy at https://vidmake.app/#pricing. In a script, set VIDMAKE_LICENSE_KEY instead.
```

`vidmake license status` shows the license on this Mac, and `vidmake license status --json` prints the same as
JSON. In the studio, the **License** button in the toolbar shows it, with updates and the command line tool.

### Scripts and agent sandboxes

Set `VIDMAKE_LICENSE_KEY` in the environment. The first command that needs a license activates the Mac with it, and
later commands use the activation saved in the config directory (`VIDMAKE_CONFIG_DIR`, else
`$XDG_CONFIG_HOME/vidmake` or `~/.config/vidmake`). An agent running on your Mac uses the activation the app made.

> [!AGENT]
> If a command exits with status 3, vidmake has no license on this machine. Ask the user for their license key and
> run `vidmake license activate <KEY>`, or have them set `VIDMAKE_LICENSE_KEY`. Don't retry the command until then.

## Macs

A license works on 3 Macs at once. Activating one more stops with an error that lists the Macs using the
license and when each was last used (the app shows the same):

```output
error: this license is active on 3 machines already (its limit); run `vidmake license deactivate` on one of them
  - studio-mac (aarch64-apple-darwin), last used today
  - render-box (x86_64-unknown-linux-gnu), last used 2 days ago
  - old-laptop (x86_64-apple-darwin), last used 24 days ago
A machine unused for 30 days frees its seat by itself.
```

To move the license, choose **License**, then **Deactivate this Mac** in vidmake on the Mac you're leaving (or run
`vidmake license deactivate`), and activate the new one. A Mac that hasn't checked in for 30 days gives its seat
back on its own, so a laptop you no longer have doesn't keep a seat forever.

## Working offline

Activating a Mac gets it a token signed by the license server, which vidmake checks on every run without the
network. Every few days vidmake checks in with the server: a request of at most three seconds, which, when it
fails, waits an hour before it is tried again. vidmake has to reach the server at least once every 30 days. A check-in
sends the license key, a hash of the Mac's id, its name, architecture and the vidmake version, and nothing
about your projects.

## Updates

vidmake updates itself to the newest release your license covers: the studio offers it in its toolbar, and
`vidmake update` installs it from a terminal. Either replaces the whole app, so the studio and the command stay the
same version; see [updating](https://vidmake.app/docs/installation.md#updating).

```bash
vidmake update --check
vidmake update
```

## Upgrading

When a new major version ships, your license keeps covering the version you bought. Nothing stops working,
and vidmake keeps installing its updates. The studio's License window offers the new version, and the command
tells you about it at most once a week:

```output
note: vidmake 2 is out. Your license covers 1.x, which keeps working and keeps getting 1.x updates; upgrade for 50% off with `vidmake license upgrade`
```

To upgrade, choose **Upgrade** in the app (or run `vidmake license upgrade`, or enter your key on the
[license page](https://vidmake.app/license/)): it opens a Stripe checkout with the discount applied. The same key then covers the new
major version, and the app offers it as an update. If you download the new version first, it opens on an upgrade
screen with the same checkout, and unlocks itself once you've paid. Other Macs pick up the upgrade when they next
check in, or at once with `vidmake license status --refresh`.

## Lost key

The app's paywall (**Lost your key?**) and the [license page](https://vidmake.app/license/) email every license key bought with an
address to it. From a terminal:

```bash
vidmake license recover you@example.com
```

## The `license` command

| command | what it does |
|---|---|
| `vidmake license activate [KEY]` | activate this Mac (the key defaults to `VIDMAKE_LICENSE_KEY`) |
| `vidmake license status [--refresh] [--json]` | show the license on this Mac; `--refresh` checks in with the server first |
| `vidmake license deactivate` | give this Mac's seat back and remove the local activation |
| `vidmake license upgrade [--no-open]` | open a checkout for the newest major version at the upgrade discount |
| `vidmake license recover <email>` | email the keys bought with an address to it |

| variable | effect |
|---|---|
| `VIDMAKE_LICENSE_KEY` | license key to activate with when the Mac has none (scripts, agent sandboxes) |
| `VIDMAKE_CONFIG_DIR` | where the activation is kept (`license.json`) |
| `VIDMAKE_LICENSE_SERVER` | the license server's origin (default `https://api.vidmake.app`) |
