> ## 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.

# Employees

> Track employee commuting data for Scope 3 emissions calculations

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

## Overview

The `employee` command tracks how employees travel to and from work, covering GHG Protocol Scope 3 Category 7 (Employee Commuting). Employees have commuting periods that define their transport mode, distance, and frequency.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee <subcommand> [flags]
```

### Available Commands

| Command                 | Description                                      |
| ----------------------- | ------------------------------------------------ |
| `list`                  | List employees                                   |
| `show`                  | Show employee details                            |
| `create employee`       | Create an employee (with optional inline period) |
| `create add-period`     | Add a commute period to an existing employee     |
| `create import-periods` | Bulk import employee periods from CSV            |
| `set info`              | Update employee name, email, or situation        |
| `set update-historic`   | Bulk update historic periods from CSV            |
| `delete`                | Delete an employee                               |

***

## List Employees

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee list [flags]

# Aliases
dcy employee ls
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# List all employees
dcy employee list

# Filter by year
dcy employee list --year 2024

# Pagination
dcy employee list --page 2 --size 100

# JSON output
dcy employee list --format json
```

### Flags

| Flag     | Short | Default | Description              |
| -------- | ----- | ------- | ------------------------ |
| `--year` | —     | —       | Filter by year           |
| `--page` | —     | `1`     | Page number              |
| `--size` | —     | `50`    | Page size                |
| `--org`  | —     | —       | Organization ID override |

***

## Show Employee Details

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

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee show 00000000-0000-0000-0000-000000000000

# JSON output
dcy employee show <employee-id> --format json
```

### Flags

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

***

## Create Employee

Create an employee with optional inline commuting period data.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee create employee [flags]
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Basic employee
dcy employee create employee --name "Jane Doe" --email jane@company.com

# With inline commuting period
dcy employee create employee \
  --name "Jane Doe" \
  --email jane@company.com \
  --transport car \
  --start-date 2024-01-01 \
  --end-date 2024-12-31 \
  --total-km 4800 \
  --fuel diesel \
  --vehicle-size medium
```

### Flags

| Flag          | Short | Default    | Description                                             |
| ------------- | ----- | ---------- | ------------------------------------------------------- |
| `--name`      | `-n`  | —          | Employee name                                           |
| `--email`     | `-e`  | —          | Employee email                                          |
| `--situation` | —     | `active`   | Employee situation (`active`, `inactive`, `terminated`) |
| `--status`    | —     | `uploaded` | Employee status                                         |
| `--org`       | —     | —          | Organization ID override                                |

#### Period Flags (optional — creates period if `--transport` is set)

| Flag                 | Short | Default      | Description                                   |
| -------------------- | ----- | ------------ | --------------------------------------------- |
| `--transport`        | `-t`  | —            | Commute transport mode                        |
| `--start-date`       | —     | —            | Period start date (YYYY-MM-DD)                |
| `--end-date`         | —     | —            | Period end date (YYYY-MM-DD)                  |
| `--total-km`         | —     | —            | Total km per period                           |
| `--weekly-travels`   | —     | —            | Comma-separated days worked per week          |
| `--daily-trips`      | —     | `2`          | Number of daily trips                         |
| `--vehicle-size`     | —     | —            | Vehicle size (`small`, `medium`, `large`)     |
| `--fuel`             | `-f`  | —            | Fuel type                                     |
| `--renewable-energy` | —     | —            | Renewable energy (`yes`, `no`, `do_not_know`) |
| `--carpool`          | —     | `false`      | Enable carpooling                             |
| `--commuting-type`   | —     | `in_itinere` | Commuting type                                |
| `--response-medium`  | —     | `manual`     | Response medium                               |
| `--period-situation` | —     | `active`     | Period situation                              |

***

## Add Period to Employee

Add a commuting period to an existing employee.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee create add-period <employee-id> [flags]
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee create add-period <employee-id> \
  --transport car \
  --start-date 2024-01-01 \
  --end-date 2024-12-31 \
  --total-km 4800

dcy employee create add-period <employee-id> \
  --transport bus \
  --start-date 2024-01-01 \
  --end-date 2024-06-30 \
  --total-km 2400 \
  --weekly-travels "1,2,3,4,5"
```

### Flags

Required: `--transport`, `--start-date`, `--end-date`. All period flags from `create employee` apply.

***

## Import Employees from CSV

Bulk import employee commute periods from a CSV file.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee create import-periods <file.csv> [flags]
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Dry run (preview)
dcy employee create import-periods employees.csv --dry-run

# Import
dcy employee create import-periods employees.csv

# Skip overlapping periods
dcy employee create import-periods employees.csv --skip-overlap
```

### Flags

| Flag             | Short | Default | Description                             |
| ---------------- | ----- | ------- | --------------------------------------- |
| `--dry-run`      | —     | `false` | Preview changes without importing       |
| `--skip-overlap` | —     | `false` | Skip periods that overlap existing ones |
| `--yes`          | `-y`  | `false` | Skip confirmation prompt                |
| `--org`          | —     | —       | Organization ID override                |

### CSV Columns

Required: `employee_id`, `transport_type`, `start_date`, `end_date`.
Optional: `total_km`, `weekly_travels`, `daily_trips`, `vehicle_size`, `fuel_type`, `renewable_energy`, `commuting_type`, `response_medium`, `situation`, `carpool`.

***

## Edit Employee

Update employee name, email, or situation.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee set info <employee-id> [flags]
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee set info <employee-id> --name "Jane Smith"
dcy employee set info <employee-id> --email jane.smith@company.com
dcy employee set info <employee-id> --situation inactive
```

### Flags

| Flag          | Short | Description                                        |
| ------------- | ----- | -------------------------------------------------- |
| `--name`      | `-n`  | New name                                           |
| `--email`     | `-e`  | New email                                          |
| `--situation` | `-s`  | New situation (`active`, `inactive`, `terminated`) |

***

## Update Historic Periods

Bulk update employee historic periods from a CSV file.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee set update-historic <file.csv> [flags]
```

### Examples

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Preview changes
dcy employee set update-historic periods.csv --dry-run

# Apply updates (interactive confirmation)
dcy employee set update-historic periods.csv
```

### Flags

| Flag        | Default | Description                      |
| ----------- | ------- | -------------------------------- |
| `--dry-run` | `false` | Preview changes without updating |
| `--yes`     | `false` | Skip confirmation prompt         |
| `--org`     | —       | Organization ID override         |

### CSV Columns

Required: `employee_historic_id`. At least one of: `total_km`, `start_date`, `end_date`.

***

## Delete Employee

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
dcy employee delete <employee-id> [flags]

# Aliases
dcy employee rm <employee-id>
```

### Examples

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

# Skip confirmation
dcy employee delete <employee-id> --yes
```

### Flags

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

***

## Common Options

All employee commands support:

| Flag            | Description                        |
| --------------- | ---------------------------------- |
| `--format json` | JSON output (default: `text`)      |
| `--verbose`     | Show HTTP request/response details |
| `--timeout`     | Request timeout in seconds         |
