---
title: luna orgs
description: List, make and choose organisations, and invite, change and remove the people in one.
related:
  - /organisation/invite-members
  - /concepts/organisations-projects-and-environments
  - /cli/projects
---

`luna orgs` lists and makes your organisations, chooses the one commands act on, and manages who is in it.

```bash
luna orgs list
```

## Reference

```bash
luna orgs <COMMAND>
```

`luna org` is the same command. The subcommands that act on one organisation take these options.

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `--org <ORG>` | text | `LUNA_ORG`, then the folder's project's, then the one `luna orgs use` chose | The organisation, by name. |
| `--token <TOKEN>` | text | `LUNA_TOKEN`, then your login | An API token or account key to act with. |

### luna orgs list

Prints the organisations you belong to, with your role in each. A `*` marks the one commands act on.

```bash
luna orgs list [OPTIONS]
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `--json` | flag | Off | Prints the answer as JSON. |

### luna orgs create

Makes an organisation. You become its owner, and later commands act on it.

```bash
luna orgs create [OPTIONS] <NAME>
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `<NAME>` | text | Required | The organisation's name. |
| `--json` | flag | Off | Prints the answer as JSON. |

### luna orgs use

Chooses the organisation later commands act on, on this machine.

```bash
luna orgs use <NAME>
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `<NAME>` | text | Required | The organisation, by name. |

### luna orgs members

Prints who is in the organisation: each one's account id, email and role.

```bash
luna orgs members [OPTIONS]
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `--json` | flag | Off | Prints the answer as JSON. |

### luna orgs invite

Invites someone, and prints the invitation link once.

```bash
luna orgs invite [OPTIONS]
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `--email <EMAIL>` | text | None | The address the invitation is for. |
| `--role <ROLE>` | text | `viewer` | The role they get: `owner`, `admin`, `developer`, `viewer` or `billing`. |

### luna orgs invites

Prints the invitations not yet answered, with their id, email, role and expiry.

```bash
luna orgs invites [OPTIONS]
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `--json` | flag | Off | Prints the answer as JSON. |

### luna orgs revoke-invite

Takes back an invitation. `luna orgs uninvite` is the same subcommand.

```bash
luna orgs revoke-invite [OPTIONS] <ID>
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `<ID>` | text | Required | The invitation's id, from `luna orgs invites`. |

### luna orgs set-role

Changes someone's role.

```bash
luna orgs set-role [OPTIONS] <ACCOUNT> <ROLE>
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `<ACCOUNT>` | text | Required | Their email, or their account id from `luna orgs members`. |
| `<ROLE>` | text | Required | `owner`, `admin`, `developer`, `viewer` or `billing`. |

### luna orgs remove

Removes someone from the organisation. It asks first.

```bash
luna orgs remove [OPTIONS] <ACCOUNT>
```

| Option | Type | Default | Does |
| --- | --- | --- | --- |
| `<ACCOUNT>` | text | Required | Their email, or their account id from `luna orgs members`. |
| `--yes` | flag | Off | Removes them without asking. |

### Roles

A role is the same in every project of the organisation. [Invite members](/organisation/invite-members) lists every permission each role holds.

| Role | Can |
| --- | --- |
| `owner` | Do everything, delete the organisation and manage owners. |
| `admin` | Do everything in projects, members and billing. |
| `developer` | Make projects and deploy to any project. |
| `viewer` | View projects, logs and usage. |
| `billing` | Manage billing and view usage. |

## Good to know

- Anyone in the organisation can list its members. `invite`, `invites`, `revoke-invite`, `set-role` and `remove` need the `owner` or `admin` role. You can remove yourself without either role.
- Only an owner can invite, make, change or remove an owner. An organisation always keeps at least one owner.
- An invitation lasts seven days. A new invitation to the same address replaces the last one.
- An account can be in at most 20 organisations. An API token cannot make or list organisations.
- With `LUNA_TOKEN` set, the CLI keeps no chosen organisation. Pass `--org` or set `LUNA_ORG`.
- Without a terminal to ask at, `remove` stops with exit code 6 unless you pass `--yes`.

## Examples

### Make an organisation and use it

```bash
luna orgs create Acme
```

### Switch to another organisation

```bash
luna orgs use Globex
```

### Invite a developer

```bash
luna orgs invite --email dev@example.com --role developer
```

### Make someone an admin

```bash
luna orgs set-role ada@example.com admin
```

### Remove someone in a script

```bash
luna orgs remove ada@example.com --yes --org acme
```
