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

# Members

> Manage organization members, roles, and access control

<Note>
  **Early Access** - The Dcycle CLI is currently available for enterprise customers.
  [Contact us](/docs/support) to learn more about access.
</Note>

## Overview

The `member` command manages user access within your active organization. You can list current members, invite new users, change roles, and remove access — all from the terminal.

Members can also be managed via `dcy org invite`, which is an alias for the same invitation flow.

### Roles

| Role     | Aliases         | Description                                                  |
| -------- | --------------- | ------------------------------------------------------------ |
| `admin`  | `administrator` | Full access — manage members, settings, and all data         |
| `member` | —               | Standard access — view and manage emissions data             |
| `fund`   | —               | Limited access — view-only for investment portfolio tracking |

***

## List Members

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy member list
```

Output:

```
Showing 4 members in Acme Corp
550e8400-... | Jane Doe      | jane@company.com  | admin  | active
661f9511-... | John Smith    | john@company.com  | member | active
772a0622-... | Alice Brown   | alice@company.com | member | active
883b1733-... | N/A           | bob@company.com   | fund   | pending
```

Members without a first/last name show `N/A`.

| Flag           | Short | Default | Description                                 |
| -------------- | ----- | ------- | ------------------------------------------- |
| `--status`     | —     | —       | Filter by status (e.g. `active`, `pending`) |
| `--sort-by`    | `-s`  | —       | Sort by: `name`, `email`, `role`, `status`  |
| `--sort-order` | `-o`  | `asc`   | Sort order: `asc` or `desc`                 |
| `--org`        | —     | —       | Organization ID override                    |

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Filter by status
dcy member list --status active

# Sort by role
dcy member list --sort-by role

# Sort by name descending
dcy member list -s name -o desc

# JSON output for scripting
dcy member list --format json
```

### JSON Response

```json theme={"theme":{"light":"github-light","dark":"github-dark"}}
[
  {
    "id": "550e8400-e29b-41d4-a716-446655440000",
    "first_name": "Jane",
    "last_name": "Doe",
    "email": "jane@company.com",
    "role": "admin",
    "status": "active",
    "created_at": "2024-01-15T10:30:00Z"
  }
]
```

***

## Show Member Details

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy member show <member-id>
```

Output:

```
ID: 550e8400-e29b-41d4-a716-446655440000
Name: Jane Doe
Email: jane@company.com
Role: admin
Status: active
Created: 2024-01-15
```

| Flag    | Description              |
| ------- | ------------------------ |
| `--org` | Organization ID override |

<Tip>
  The member ID is a UUID. Use `dcy member list --format json` to find member IDs programmatically.
</Tip>

***

## Invite Member

Send an invitation to add a new user to the organization:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy member invite user@example.com
```

Output:

```
ID: 994c2844-e29b-41d4-a716-446655440000
Name: N/A
Email: user@example.com
Role: member
Status: pending
Created: 2024-03-15
```

| Flag           | Short | Default  | Description                                  |
| -------------- | ----- | -------- | -------------------------------------------- |
| `--role`       | `-r`  | `member` | Role to assign: `admin`, `member`, or `fund` |
| `--send-email` | —     | `true`   | Send invitation email                        |
| `--lang`       | —     | `en`     | Email language                               |
| `--org`        | —     | —        | Organization ID override                     |

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Invite as admin
dcy member invite admin@company.com --role admin

# Invite without sending email (manual onboarding)
dcy member invite user@company.com --send-email=false

# Invite in Spanish
dcy member invite user@company.com --lang es

# Invite to a subsidiary without switching context
dcy member invite user@company.com --org a1b2c3d4-...

# Capture the member ID from JSON output
MEMBER_ID=$(dcy member invite user@company.com --format json | jq -r '.id')
echo "Invited member: $MEMBER_ID"
```

***

## Edit Member Role

Change a member's role:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy member edit <member-id> --role admin
```

Output:

```
ID: 550e8400-e29b-41d4-a716-446655440000
Name: Jane Doe
Email: jane@company.com
Role: admin
Status: active
Created: 2024-01-15
```

| Flag     | Short | Description                                       |
| -------- | ----- | ------------------------------------------------- |
| `--role` | `-r`  | New role: `admin`, `member`, or `fund` (required) |
| `--org`  | —     | Organization ID override                          |

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Promote to admin
dcy member edit 550e8400-... --role admin

# Downgrade to fund (view-only)
dcy member edit 550e8400-... -r fund
```

<Warning>
  You must provide `--role` — there are no other editable fields. The command returns an error if no role is specified.
</Warning>

***

## Delete Member

Remove a member from the organization:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Interactive confirmation
dcy member delete <member-id>
```

Confirmation prompt:

```
Remove member jane@company.com (550e8400-...)? [y/N]
```

Output after confirmation:

```
member removed successfully: jane@company.com
```

| Flag    | Short | Default | Description              |
| ------- | ----- | ------- | ------------------------ |
| `--yes` | `-y`  | `false` | Skip confirmation prompt |
| `--org` | —     | —       | Organization ID override |

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Skip confirmation
dcy member delete 550e8400-... --yes

# Delete from a subsidiary
dcy member delete 550e8400-... --org a1b2c3d4-... --yes
```

***

## Typical Workflows

### Batch Onboard New Team Members

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
#!/bin/bash
# Invite a list of employees with a default role

ROLE="member"
LANG="en"
EMAILS=(
  alice@company.com
  bob@company.com
  carol@company.com
  dave@company.com
)

for email in "${EMAILS[@]}"; do
  echo "Inviting $email as $ROLE..."
  dcy member invite "$email" --role "$ROLE" --lang "$LANG"
done

# Verify invitations
echo ""
echo "Pending invitations:"
dcy member list --status pending
```

### Audit Organization Access

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Export all members as JSON
dcy member list --format json > members.json

# List admins
dcy member list --format json | jq -r '.[] | select(.role == "admin") | .email'

# Count members by role
dcy member list --format json | \
  jq 'group_by(.role) | map({role: .[0].role, count: length})'

# Count by status
dcy member list --format json | \
  jq 'group_by(.status) | map({status: .[0].status, count: length})'

# Find pending invitations older than 30 days
dcy member list --status pending --format json | \
  jq '.[] | select(.created_at < "2024-06-01") | {email, created_at}'
```

### Cross-Organization Member Management

Use `--org` to manage members in a different organization without switching context:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# List members in a subsidiary
dcy member list --org <subsidiary-org-id>

# Invite to a subsidiary
dcy member invite user@company.com --org <subsidiary-org-id> --role member

# Invite the same user across multiple organizations
for org_id in $(dcy org list --format json | jq -r '.[].id'); do
  dcy member invite shared-admin@company.com --org "$org_id" --role admin
done
```

### Bulk Remove Inactive Members

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
#!/bin/bash
# Remove all pending members that haven't accepted

PENDING=$(dcy member list --status pending --format json | jq -r '.[].id')

if [ -z "$PENDING" ]; then
  echo "No pending members to remove"
  exit 0
fi

COUNT=$(echo "$PENDING" | wc -w)
echo "Removing $COUNT pending member(s)..."

for id in $PENDING; do
  dcy member delete "$id" --yes
done

echo "Done"
```

### Compare Members Across Organizations

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
#!/bin/bash
# Find users who are members of multiple organizations

ORGS=$(dcy org list --format json | jq -r '.[].id')
ALL_EMAILS=$(mktemp)

for org_id in $ORGS; do
  dcy member list --org "$org_id" --format json | \
    jq -r '.[].email' >> "$ALL_EMAILS"
done

echo "Users in multiple organizations:"
sort "$ALL_EMAILS" | uniq -d
rm "$ALL_EMAILS"
```

***

## Aliases

The `list` subcommand supports `ls` as a short alias:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy member ls          # same as dcy member list
dcy member ls -s role  # same as dcy member list --sort-by role
```

## Next Steps

<CardGroup cols={2}>
  <Card title="Organizations" icon="sitemap" href="/cli/organizations">
    Manage organization settings and hierarchy
  </Card>

  <Card title="Authentication" icon="key" href="/cli/authentication">
    Configure authentication and API keys
  </Card>

  <Card title="Facilities" icon="warehouse" href="/cli/facilities">
    Manage physical locations and their emissions
  </Card>

  <Card title="Examples" icon="code" href="/cli/examples">
    Complete workflow examples
  </Card>

  <Card title="MCP Tools" icon="robot" href="/mcp/members">
    Query members from AI assistants via MCP
  </Card>
</CardGroup>
