> ## Documentation Index
> Fetch the complete documentation index at: https://capy.sc/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# capy users: Interactive Team & Role Management

> Browse organization members in an interactive table. Change roles, grant or revoke protected-branch access, and expand rows to see per-project assignments.

## Synopsis

```bash theme={null}
capy users
```

## Description

Opens an interactive TUI for the current organization. Lists every member with their role and project count, lets you expand a member to see their per-project roles and protected-branch grants, and lets you change anything from the keyboard.

If stdout isn't a TTY (e.g., piped to a file), Capy falls back to a static rendering of the same table.

## Example

```text theme={null}
  Organization Members (3 users)

  Email                          Role           Added         Projects
  ─────────────────────────────────────────────────────────────────────
> alice@acme.com                 owner          2025-01-15    2 projects
  bob@acme.com                   member         2025-02-03    1 project
  carol@acme.com                 admin          2025-03-10    2 projects
  ─────────────────────────────────────────────────────────────────────
   ↑↓ navigate  Enter expand/collapse  r change role  g grant protected  q quit
```

### Expanding a row

Pressing `Enter` on a row expands it to show that member's project roles and the protected branches they have grants on:

```text theme={null}
> alice@acme.com                 owner          2025-01-15    2 projects
    api-backend          admin
      main               (org-wide)
      production         (granted)
    web-frontend         member
      main               (org-wide)
      production         (no access)
```

`(org-wide)` branches need no grant - anyone in the org can read them. `(granted)` and `(no access)` only appear on protected branches.

### Changing a role

Pressing `r` on a member or project row inline-edits the role with an arrow-key picker. Selections apply on `Enter`:

```text theme={null}
> bob@acme.com                   ❯ admin                      1 project
                                   project-admin
                                   member
                                   remove
   ↑↓ pick role  Enter confirm  Esc cancel
```

Picking `remove` from the org-level role picker has the same effect as `capy kick <email>`. Picking `remove` from a per-project picker only revokes that project's role; the member stays in the org.

### Granting a protected branch

Move the cursor onto a `(no access)` branch row and press `g`. The status flips to `(granted)`. Press `g` again to revoke. Same operation as the non-interactive [`capy grant-branch`](/cli/grant-branch) / [`capy revoke-branch`](/cli/revoke-branch) commands.

## Keys

| Key             | What it does                                                 |
| --------------- | ------------------------------------------------------------ |
| `↑` / `↓`       | Move the cursor                                              |
| `Enter`         | Expand or collapse the row under the cursor                  |
| `r`             | Change the role for the selected row (member or per-project) |
| `g`             | Toggle a protected-branch grant for the selected branch row  |
| `Esc`           | Cancel the current edit                                      |
| `q` or `Ctrl-C` | Quit                                                         |

## Non-interactive use

Pipe the command and Capy writes a static rendering with no footer hints:

```bash theme={null}
capy users | tee members.txt
```

The static output is the same table, no cursor, no prompts. Useful in CI to snapshot org state.
