Skip to main content
Early Access - The Dcycle CLI is currently available for enterprise customers. Contact us to learn more about access.

Overview

The vehicle command manages your organization’s fleet of vehicles, covering GHG Protocol Scope 1 direct emissions from owned/rented vehicles. The related vehicle-fuel command provides reference data for fuel types and vehicle categories.
dcy vehicle <subcommand> [flags]
dcy vehicle-fuel <subcommand> [flags]

Available Commands

CommandDescription
vehicle listList vehicles
vehicle showShow vehicle details
vehicle createCreate a vehicle
vehicle editEdit a vehicle
vehicle deleteDelete a vehicle
vehicle uploadUpload vehicles from CSV
vehicle diagnoseDiagnose emission calculation issues
vehicle recalculateTrigger emission recalculation
vehicle delete-consumptionsBulk delete consumption records in a date range
vehicle-fuel listList available fuel types
vehicle-fuel list-typesList vehicle type categories

List Vehicles

dcy vehicle list [flags]

# Aliases
dcy vehicle ls

Examples

# List all vehicles
dcy vehicle list

# Filter by type
dcy vehicle list --type freight

# Filter by ownership
dcy vehicle list --ownership owned

# By license plate (partial match)
dcy vehicle list --license-plate "1234"

# Filter by status
dcy vehicle list --status active

# Search text
dcy vehicle list --search "Tesla"

# Sort by name descending
dcy vehicle list --sort-by name --sort-order desc

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

# JSON output for scripting
dcy vehicle list --format json | jq '.[] | {name, license_plate, type}'

Flags

FlagShortDefaultDescription
--type-tFilter by vehicle type (passenger, freight)
--ownership-oFilter by ownership (owned, rented)
--license-plate-lFilter by license plate (partial match)
--statusFilter by status (active, inactive, archived)
--searchFull-text search
--sort-by-sSort by: name, type, ownership, country, status, created, updated
--sort-orderascSort order: asc or desc
--page1Page number
--size50Items per page
--orgOrganization ID override

Output

Showing 3 of 3 vehicles in Acme Corp
v1-abc123-... | Fleet Car 1  | passenger | owned   | 1234 ABC | active
v2-def456-... | Delivery Van | freight   | rented  | 5678 DEF | active
v3-ghi789-... | (not set)    | passenger | owned   | 9012 GHI | active
Columns: ID, name, type, ownership, license plate, status. Vehicles without a name show (not set).

Show Vehicle Details

dcy vehicle show <vehicle-id>

Examples

dcy vehicle show 00000000-0000-0000-0000-000000000000

# JSON output
dcy vehicle show <vehicle-id> --format json

Flags

FlagDescription
--orgOrganization ID override

Output

ID: v1-abc123-...
Name: Fleet Car 1
Type: passenger
Ownership: owned
License Plate: 1234 ABC
Country: ES
Status: active
Vehicle Type Label: Turismo medio
Fuel: Diesel
Registration Year: 2022
Market Segment: upper_medium
Size: medium
Created: 2024-01-15
Updated: 2024-06-01

Create Vehicle

dcy vehicle create [flags]

Examples

dcy vehicle create \
  --type passenger \
  --ownership owned \
  --license-plate "1234 ABC" \
  --unknown-vehicle-id <unknown-vehicle-id> \
  --vehicle-fuel-id <fuel-id>

# With optional fields
dcy vehicle create \
  --name "Company Car" \
  --type passenger \
  --ownership owned \
  --license-plate "1234 ABC" \
  --unknown-vehicle-id <unknown-vehicle-id> \
  --vehicle-fuel-id <fuel-id> \
  --country ES \
  --registration-year 2022 \
  --market-segment upper_medium \
  --size medium

Flags

FlagShortRequiredDefaultDescription
--type-tYespassenger or freight
--ownership-oYesowned or rented
--license-plate-lYesLicense plate (min 3 chars)
--unknown-vehicle-id-uYesUnknown vehicle type ID
--vehicle-fuel-id-fYesVehicle fuel ID
--name-nNoDisplay name
--countryNoESCountry ISO-2 code
--registration-yearNoRegistration year
--market-segmentNoMarket segment (see table below)
--sizeNoVehicle size (see table below)
--custom-emission-factor-idNoCustom emission factor ID
--orgNoOrganization ID override

Market Segments

mini, supermini, lower_medium, upper_medium, executive, luxury, sports, dual_purpose_4x4, mpv

Vehicle Sizes

small_car, medium, large_car, average_car
Use dcy vehicle-fuel list to browse available fuel IDs, and dcy vehicle-fuel list-types for vehicle type IDs.

Edit Vehicle

dcy vehicle edit <vehicle-id> [flags]

Examples

dcy vehicle edit <vehicle-id> --name "Updated Name"
dcy vehicle edit <vehicle-id> --type freight --status active
dcy vehicle edit <vehicle-id> --ownership rented --license-plate "NEW 1234"

Flags

Accepts the same flags as create (all optional). Additionally supports:
FlagShortDescription
--statusVehicle status: active, inactive, archived
--orgOrganization ID override

Delete Vehicle

dcy vehicle delete <vehicle-id> [flags]

# Aliases
dcy vehicle rm <vehicle-id>

Examples

# Interactive confirmation
dcy vehicle delete <vehicle-id>

# Skip confirmation
dcy vehicle delete <vehicle-id> --yes

Flags

FlagShortDefaultDescription
--yes-yfalseSkip confirmation prompt
--orgOrganization ID override

Output

Confirmation prompt:
Delete vehicle Fleet Car 1 (v1-abc123-...)? [y/N]
vehicle deleted successfully: Fleet Car 1

Upload Vehicles from CSV

Bulk upload vehicles with validation and CSV templates.
dcy vehicle upload [file.csv] [flags]

Examples

# Generate template
dcy vehicle upload --template

# Generate template with real UUIDs from your organization
dcy vehicle upload --template-with-data

# Validate only (default behavior)
dcy vehicle upload vehicles.csv

# Validate and upload
dcy vehicle upload vehicles.csv --no-dry-run

# Verbose validation output
dcy vehicle upload vehicles.csv --no-dry-run --verbose

Flags

FlagShortDefaultDescription
--templatefalseGenerate example CSV template
--template-with-datafalseGenerate template with real UUIDs from your org
--dry-runtrueValidate without uploading
--no-dry-runfalseUpload after validation
--verbose-vfalseShow detailed validation results
--orgOrganization ID override

CSV Template Columns

name,license_plate,country,type,ownership,unknown_vehicle_id,vehicle_fuel_id
Fleet Vehicle 1,ABC1234,ES,passenger,owned,uuid-for-car-type,uuid-for-diesel-fuel
Delivery Van,XYZ5678,ES,freight,rented,uuid-for-van-type,uuid-for-gasoline-fuel
The CSV upload also accepts Spanish column names (nombre, matricula, pais, tipo_vehiculo, combustible, propiedad) and normalizes type/ownership values from Spanish (pasajero->passenger, carga->freight, propio->owned, alquiler->rented).
Use --template-with-data to get real UUIDs for unknown_vehicle_id and vehicle_fuel_id pre-filled from your organization’s data.

Diagnose Vehicle Issues

Scan a vehicle’s consumption records for emission calculation issues.
dcy vehicle diagnose <vehicle-id> [flags]

Examples

# Basic diagnosis
dcy vehicle diagnose <vehicle-id>

# Detailed output with error messages
dcy vehicle diagnose <vehicle-id> --verbose

# JSON output
dcy vehicle diagnose <vehicle-id> --format json

Flags

FlagDefaultDescription
--verbosefalseShow detailed error messages
--orgOrganization ID override

Output

Vehicle: Fleet Car 1 (v1-abc123-...)
Status: active
Total CO2e: 1250.00 kg
Consumptions: 12

2024-01 | 150.00 | 85.30 | success
2024-02 | 160.00 | 0.00  | success | zero emissions with non-zero quantity
2024-03 | 0.00   | 0.00  | error   | Missing emission factor

Issues found: 2
- 2024-02: zero emissions with non-zero quantity
- 2024-03: Missing emission factor

Recalculate Vehicle Emissions

Trigger a recalculation of vehicle consumption emissions.
dcy vehicle recalculate <vehicle-id> [flags]

Examples

# With confirmation prompt
dcy vehicle recalculate <vehicle-id>

# Force recalculation without confirmation
dcy vehicle recalculate <vehicle-id> --force --yes

Flags

FlagShortDefaultDescription
--forcefalseForce recalculation even if data exists
--yes-yfalseSkip confirmation prompt
--orgOrganization ID override

Output

vehicle recalculation triggered successfully
event_id: evt-12345-...

Delete Vehicle Consumptions

Bulk delete vehicle consumption records within a date range for an organization. Optionally includes subsidiary organizations.
dcy vehicle delete-consumptions [flags]

Examples

# Delete consumptions for a date range
dcy vehicle delete-consumptions \
  --org <org-id> \
  --start-date 2024-01-01 \
  --end-date 2024-12-31 \
  --yes

# Include subsidiary organizations
dcy vehicle delete-consumptions \
  --org <org-id> \
  --start-date 2024-01-01 \
  --end-date 2024-12-31 \
  --include-subsidiaries \
  --yes

Flags

FlagShortDefaultDescription
--orgOrganization ID
--start-dateStart date YYYY-MM-DD (required)
--end-dateEnd date YYYY-MM-DD (required)
--include-subsidiariesfalseInclude all subsidiary organizations
--yes-yfalseSkip confirmation prompts

Output

done. deleted: 45 | failed: 0 | skipped (no consumptions): 3
This deletes consumption data permanently. Without --yes, the command prompts for confirmation including whether to include subsidiaries.

Vehicle Fuels

List available fuel types for your organization.
dcy vehicle-fuel list [flags]

# Aliases
dcy vehicle-fuel ls

Examples

# List all fuels
dcy vehicle-fuel list

# Search by fuel name
dcy vehicle-fuel list --search diesel

# JSON output
dcy vehicle-fuel list --format json | jq '.[] | {id, fuel, fuel_type}'

Flags

FlagShortDefaultDescription
--search-sSearch by fuel name
--page1Page number
--size50Page size
--orgOrganization ID override

Output

Showing 5 of 5 vehicle fuels in Acme Corp
f1-abc123-... | Diesel                | diesel   | units=Liters, Kilometers
f2-def456-... | Gasoline              | gasoline | units=Liters, Kilometers
f3-ghi789-... | Electric (100%)       | electric | units=kWh, Kilometers
f4-jkl012-... | Hybrid (diesel/elec)  | hybrid   | units=Liters, Kilometers
f5-mno345-... | Compressed Natural Gas| cng      | units=kg, Kilometers

Vehicle Types

List available vehicle type categories (unknown vehicles). Use these IDs for the --unknown-vehicle-id flag when creating vehicles.
dcy vehicle-fuel list-types [flags]

Examples

dcy vehicle-fuel list-types

# JSON output
dcy vehicle-fuel list-types --format json

Flags

FlagDescription
--orgOrganization ID override

Output

Showing 3 vehicle types
uv-abc123-... | Turismo medio | ES
uv-def456-... | Furgoneta     | ES
uv-ghi789-... | Camion pesado | ES

Common Options

All vehicle commands support:
FlagDescription
--format jsonJSON output (default: text)
--verboseShow HTTP request/response details
--timeoutRequest timeout in seconds

Workflows

Fleet Setup from CSV

# 1. Get real UUIDs for your organization
dcy vehicle upload --template-with-data

# 2. Fill the template with your fleet data

# 3. Validate first
dcy vehicle upload fleet.csv

# 4. Upload
dcy vehicle upload fleet.csv --no-dry-run

# 5. Verify
dcy vehicle list

Diagnose and Fix Emission Issues

# 1. List vehicles with issues
dcy vehicle list --format json | \
  jq '.[] | select(.co2e == 0) | {id, name: .name, plate: .license_plate}'

# 2. Diagnose a specific vehicle
dcy vehicle diagnose <vehicle-id> --verbose

# 3. Fix and recalculate
dcy vehicle recalculate <vehicle-id> --force --yes

Export Fleet Data

# Export all vehicles as JSON
dcy vehicle list --format json --size 1000 > vehicles.json

# Export fuel types
dcy vehicle-fuel list --format json > fuels.json

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

Piping with jq

# Find vehicles with zero emissions
dcy vehicle list --format json | jq '[.[] | select(.co2e == 0)] | length'

# List license plates
dcy vehicle list --format json | jq -r '.[].license_plate'

# Group by ownership
dcy vehicle list --format json | jq 'group_by(.ownership) | map({ownership: .[0].ownership, count: length})'