# Sign in and activate

A license covers one kit (development, growth, quality or security), every ezi product, a number
of devices (three for a standard purchase) and one year of updates. Signing in
from the ezi CLI, with the license key or with a code mailed to the license's
address, activates the machine you are on as one of those devices. Licenses
bought earlier keep the number of devices they were sold with.

If one email bought several kits, it holds one license per kit, and one
sign-in covers them all: see [Several licenses on one email](#several-licenses-on-one-email).

## Your license key

After you pay, the key is sent once to the email address you entered for the
license at checkout. That address need not be the one of your PayPal account;
when you are signed in on the site, checkout fills in your account's address
and you can change it. The key starts with `ezi_license_`. Keep that mail: the key cannot be shown
again, not even by support. If you lose it, get a replacement key by email
(see [Lost your key](#lost-your-key)).

## Activate this machine

```bash
ezi login --license-key ezi_license_...
```

```text
[OK] signed in as you@example.com (license_key) on https://api.ezikit.dev
[i] license lic_ndlea7iga3cfhoix: this device is active (1 of 3 devices)
```

Signing in again on the same machine reuses its slot.

The server records the device only by two one-way hashes the CLI computes (a
device id and a machine fingerprint), the license it is active on and when it
was activated or removed. It stores no host name, platform, version or
last-seen time, so `ezi account devices` lists devices by their id. To see
which id belongs to which machine, run this on the machine; it works offline
and without signing in:

```bash
ezi account device-id
```

```text
dev-e46173086fb06186389704a9
```

`ezi account device-id --json` prints `{"deviceId": ...}` in the usual
envelope. It is the same id `ezi account` shows on its `Device` line, never
the raw machine fingerprint.

Typing the key on the command line leaves it in your shell history. Clear that
entry afterwards, or paste the key in a terminal whose history you do not keep.

## Sign in by email

Once your address has a license, you can sign in with a one-time code instead
of the key. It activates the machine exactly like the key does, on a license
issued to that address. This needs an interactive terminal:

```bash
ezi login --email you@example.com
```

```text
[i] if you@example.com has a license or an account, a six-digit sign-in code is on its way; if no mail arrives, sign in with your license key: `ezi login --license-key <key>`
Code: 990614
[OK] signed in as you@example.com (email_otp) on https://api.ezikit.dev
[i] license lic_ndlea7iga3cfhoix: this device is active (1 of 3 devices)
```

The mail has the subject "Your ezi sign-in code" and the code expires in 10
minutes. Only an address that has a license or an account receives a code;
any other address gets the same message and no mail.

On each license of the address, a slot the machine already holds is reused;
otherwise it takes a free one. Signing in on the account page at
<https://ezikit.dev/account/> never takes a slot: a browser is not a device,
and it cannot download kits.

Every sign-in method gives the same session: `ezi account`,
`ezi account devices`, deactivating a device and remote sign-out work the
same way whichever you used.

## Several licenses on one email

An email that bought several kits holds one license per kit, each with its own devices
(three for a standard purchase), replacement limit and update window. Any
sign-in (license key, email code or API key) activates the machine on every
active license of that email that has a free slot, and prints one line per
license:

```text
[OK] signed in as you@example.com (license_key) on https://api.ezikit.dev
[i] license lic_ndlea7iga3cfhoix (Development kit): this device is active (1 of 3 devices)
[i] license lic_q4m2b7xk0c9tdy1s (Growth kit): this device is active (1 of 3 devices)
```

A license whose slots are all taken by other machines is reported with a
warning and the way to free or replace a slot (see
[When every device is in use](#when-every-device-is-in-use)); the machine is
still active on the other license. With the license key, the key's own license
must have room, or the sign-in is refused as described there.

A license bought after this machine signed in needs no new sign-in: the first
download of its kit activates the machine on it, as long as it has a free slot
and the machine is active on another license of the same email. A machine you
removed from a license is not put back that way; sign in again to activate it.

## Sign in with an API key (scripts and CI)

For a machine without an interactive terminal, create an API key on a machine
signed in with the license key or by email:

```bash
ezi account api-keys create --name ci
```

```text
[!] this API key is shown once and cannot be shown again; store it in your secret manager now
[i] API key key_7kq2m4xw9b3c (ci) created; sign in with it using `ezi login --api-key-stdin` or EZI_API_KEY. Each machine that signs in with it uses a device slot of your license
ezi_live_...
```

The key is the only line on stdout, so redirecting stdout to a file keeps it
out of the terminal; `--json` returns it as `data.apiKey`. The server keeps only a hash, so store the key in your CI's
secret store right away. A session that was itself opened with an API key
cannot create keys.

Then pipe the key to the CLI or set `EZI_API_KEY` on the script machine:

```bash
printf '%s\n' "$EZI_API_KEY" | ezi login --api-key-stdin
```

```text
[OK] signed in as you@example.com (api_key) on https://api.ezikit.dev
[i] license lic_ndlea7iga3cfhoix: this device is active (2 of 3 devices)
```

An API-key sign-in activates the machine exactly like the key or an email
code: it reuses the machine's slot, else takes a free one. The device limit
applies to every sign-in method, so each CI machine that downloads kits or
products takes a slot like any other computer. A session that is not
activated (the license was full, or an older client sent no device
fingerprint) still reaches your account, devices, API keys and SkillX
publishing, but kit, product and SkillX package downloads answer
`device_not_activated`. `skillx config set-key` and `SKILLX_API_KEY` sign in
the same way and warn when the machine is not activated.

List your keys (never their secrets) and revoke one you no longer use:

```bash
ezi account api-keys list
ezi account api-keys revoke key_7kq2m4xw9b3c
```

Revoking asks for confirmation (pass `--yes` in a script; `--json` and
`--no-interactive` require it) and ends every session the key opened at once.
The device slots its machines took stay until you deactivate those devices.

## Check your account

```bash
ezi account
```

```text
Signed in as you@example.com (license_key)
Registry:   https://api.ezikit.dev
Device:     dev-e46173086fb06186389704a9
License:    lic_ndlea7iga3cfhoix (active on this device)
Plan:       Development kit (active; updates through 2027-11-14T07:37:51Z; 1 of 3 devices; covers cli, desktop, development, harness, render, skillx)
Kit:        development (pro, active; updates through 2027-11-14T07:37:51Z)
Latest entitled ezi version: 1.0.0
```

A license other than the one this device signed in with ends its Plan line
with `; license <license-id>`. When this machine could not be activated
because the license was full, the License line reads
`(not valid on this device: device_not_activated)`.

`ezi account licenses` lists each license with its status, products, devices
and update window, and the newest kit version the window covers.

## Lost your key

The server keeps only a masked form of your key, so it cannot show or resend
it. Instead, ask for a replacement key: the license gets a new key, which is
emailed once to the address the license was issued to (the license email
entered at checkout).
The old key stops working for new activations at once. Devices already
activated stay activated and signed in.

Sign in with that address, then either use **Email me a replacement key** on
the license on your account page at <https://ezikit.dev/account/>, or run:

```bash
ezi account licenses replace-key lic_ndlea7iga3cfhoix
```

```text
Mail a replacement key for lic_ndlea7iga3cfhoix? The current key stops activating devices; activated devices stay [y/N]: y
[OK] a replacement key for lic_ndlea7iga3cfhoix was mailed to you@example.com (ezi_license_j36i...)
[i] the previous key no longer activates devices; devices already activated stay signed in
```

The license id is on the `License` or `Plan` line of `ezi account` and in
`ezi account licenses`. If the mail cannot be sent, nothing changes and the
current key keeps working; try again later. After three requests for one
license, wait 20 minutes. A revoked license gets no replacement key. If you
can no longer read the license's mailbox, write to support.

## Devices

List the devices on each of your licenses:

```bash
ezi account devices
```

```text
License lic_ndlea7iga3cfhoix (Development kit): 2 of 3 devices active
ID                            ACTIVATED
dev-38b28da53b6132b70fd53004  2026-11-14T07:48:17Z
dev-595b6f7398f87a6c695be90a  2026-11-14T07:50:08Z  (this device)
```

With two licenses, each is listed with its own devices. In
`ezi account devices --json`, `licenses` lists every license; the top-level
`licenseId`, `devices`, `deviceLimit` and `activeDevices` describe the license
this session is bound to.

Free a slot by deactivating a device. You can do this for the machine you are
on or, from any signed-in device, for another one. The **Remove** button next
to a device on your account page at <https://ezikit.dev/account/> does the
same for one license.

```bash
ezi account devices deactivate dev-38b28da53b6132b70fd53004 --yes
```

```text
[OK] device dev-38b28da53b6132b70fd53004 deactivated on license lic_ndlea7iga3cfhoix (Development kit) (1 of 3 devices active)
```

Without `--license`, the device is deactivated on every license it is active
on, one line per license. To free a slot on one license only, name it:
`ezi account devices deactivate dev-38b28da53b6132b70fd53004 --license lic_ndlea7iga3cfhoix --yes`.

A machine that no longer holds any license is signed out. Deactivating the
machine you are on then also clears its session
(`this device's license session was cleared; sign in again with ezi login`);
another machine's next request fails with
`the session for https://api.ezikit.dev has expired; run ezi login`. A machine
still active on another license keeps its session and that license's kits.
Either can be activated again, with the key or by email, while a slot is free.
Deactivating is never limited.

## When every device is in use

Signing in on another machine when every slot of a license is used offers to
replace one of that license's devices. On a terminal, the CLI lists them,
oldest first, and asks which one this machine replaces; with two full
licenses it asks for each in turn, and you can cancel either:

```text
All 3 devices of license lic_ndlea7iga3cfhoix are in use. This device can replace one of them; the replaced device is signed out.
Device ids are hashes, not names: run `ezi account device-id` on a machine to see its id.
  1) dev-38b28da53b6132b70fd53004  activated 2026-11-14
  2) dev-595b6f7398f87a6c695be90a  activated 2026-11-14
  3) dev-0c2e6a91d4b7f35e8a1c2d90  activated 2026-11-15
  0) cancel
Replace which device? [0-3]: 1
[OK] signed in as you@example.com (email_otp) on https://api.ezikit.dev
[i] device dev-38b28da53b6132b70fd53004 was replaced
[i] license lic_ndlea7iga3cfhoix (Development kit): this device is active (3 of 3 devices)
```

The replaced device loses its slot on that license and this machine is
activated, in one step: no one else can take the slot in between. The
replaced device is signed out unless it is still active on another license.
In a script, or to skip the question, name the device to replace; it applies
to the license that device holds a slot of:

```bash
ezi login --license-key ezi_license_... --replace-device dev-38b28da53b6132b70fd53004
ezi login --email you@example.com --replace-device dev-38b28da53b6132b70fd53004
printf '%s\n' "$EZI_API_KEY" | ezi login --api-key-stdin --replace-device dev-38b28da53b6132b70fd53004
```

Each license can replace at most 3 devices in any 30 days. After that the
sign-in is refused with the date the next replacement is possible; you can
still deactivate a device (`ezi account devices deactivate` or the account
page), which is never limited, and then sign in.

If you cancel, or sign in without a terminal and without `--replace-device`:

- `ezi login --license-key` fails and signs nothing in when the key's own
  license is full (another full license of the same email only gets the
  warning shown below):

  ```text
  license lic_ndlea7iga3cfhoix is already active on 3 of 3 devices; replace one with `ezi login --license-key <key> --replace-device <device-id>` (run `ezi account device-id` on a machine to see its id), or deactivate one with `ezi account devices deactivate <device-id>` from a signed-in device or at https://ezikit.dev/account/, then retry
  ```

- `ezi login --email` signs you in, so you can list and deactivate devices, but
  this machine is not active on the full license and cannot download its kit:

  ```text
  [!] license lic_ndlea7iga3cfhoix (Development kit): all 3 devices in use, so this device cannot download the products of this license (active devices: dev-38b28da53b6132b70fd53004 (activated 2026-11-14), ...); replace one with `ezi login --email --replace-device <device-id>` (run `ezi account device-id` on a machine to see its id), or remove one with `ezi account devices deactivate <device-id> --license lic_ndlea7iga3cfhoix` or at https://ezikit.dev/account/, then run `ezi login --email` again
  ```

  Until then, downloads of that license's kit answer `device_not_activated`.

- `ezi login --api-key-stdin` (or `EZI_API_KEY`) behaves like `ezi login
  --email`: it signs you in unactivated, and the warning names
  `ezi login --api-key-stdin --replace-device <device-id>`.

If you no longer have any of your machines, write to support, who can free all
slots at once.

## Sign out

```bash
ezi logout
```

This removes the session from `~/.ezi/auth/session.json`. It does not free the
device slot; deactivate the device first if you want the slot back.

## What a license does not do

Installed kits and products keep working when a license ends or is revoked.
Only new downloads stop: kit installs and updates, product installs and new
releases.
