# Log in and choose a Space (/docs/developer-resources/cli/login-and-spaces)

Commands act as the **Monimeer** you are logged in as, within the **Space** you choose. Logging in takes a browser; for CI and scripts, use an [access token](/docs/developer-resources/cli/ci-and-scripts) instead.

## Log in

1. **Start the login**

   ```bash
   monime login
   ```

   The CLI opens `cli.monime.io` in your browser. `monime login` is a shortcut for `monime account login`.

2. **Approve the login in your browser**

   Sign in to Monime if you are not already, and approve the CLI. The CLI shares this computer's name, operating system and CLI version so you can recognise the login later in the Monime portal.

3. **Choose a Space**

   Back in the terminal, pick the Space to work in. If you belong to a single Space, it is chosen for you.

   ```text
   ✓ Logged in as Monimeer +232 78 123 456.
   ✓ Working in space Salone Shop (sshop).
   ```

`monime account login` accepts these flags:

| Flag                 | What it does                                                                        |
| -------------------- | ----------------------------------------------------------------------------------- |
| `--no-browser`       | Print the login URL instead of opening a browser, for example over SSH              |
| `--device-name NAME` | The name shown for this device in the Monime portal (default: this computer's name) |
| `--skip-space`       | Don't choose a Space after logging in                                               |

## Check who you are

`monime status`, or its alias `monime whoami`, shows the Monimeer that commands act as, whether the login is still valid, and the Space they act in:

```bash
$ monime whoami
Monimeer        +232 78 123 456   ✓ logged in
Space           Salone Shop (sshop)
Configuration   default
```

It exits with a non-zero status when you are not logged in or the login has expired, so you can use it as a check in scripts. Add `-o json` or `-o yaml` for machine-readable output.

## Work in another Space

List the Spaces you belong to, then choose one:

```bash
monime space list
```

```text title="Output"
NAME          ALIAS   ID                                ACTIVE
Salone Shop   sshop   spc-k9Rt4Hw2mQ8vLp3Xn7Yb5Cz1Ds    true
Acme Ltd      acme    spc-k8Y2mzRtXyQ4pLw7Nn3VbC6dHs    false
```

```bash
monime space use acme
```

Pass the Space's alias, ID or name. Without an argument, `monime space use` lets you pick from a list. The choice is saved in the configuration in use; add `--configuration NAME` to save it in another one.

To run a single command in another Space without switching, add `--space`:

```bash
monime space list --space spc-k6Em1Aap25VZ8oWg7ajhxHX3JqF -o json
```

## Stay logged in as several Monimeers

Run `monime login` again to add another Monimeer. Each login gets an **alias**, and one of them is active.

```bash
monime account list
```

| To…                                     | Run                               |
| --------------------------------------- | --------------------------------- |
| Switch the active Monimeer              | `monime config set account ALIAS` |
| Act as another Monimeer for one command | `monime status --account ALIAS`   |
| Log out the active Monimeer             | `monime account logout`           |
| Log out a specific Monimeer             | `monime account logout ALIAS`     |
| Log out every Monimeer                  | `monime account logout --all`     |

> **Tip:** Keep a separate [named configuration](/docs/developer-resources/cli/configuration#named-configurations) for each Monimeer or environment, so switching is a single `monime config configurations activate` away.
