Skip to main content
Early Access - The Dcycle CLI is currently available for enterprise customers. Contact us to learn more about access.
Admin commands are intended for platform administrators and support engineers. They trigger backend recalculations or directly modify data tables — use with caution.

Overview

Admin commands provide low-level operations for triggering recalculations and inserting energy data directly. Unlike most CLI commands, admin operations take organization IDs as positional arguments rather than using --org.

Available Commands

CommandDescription
dcy admin recalculate-scope3-td <org-id>Recalculate Scope 3 T&D data for organizations
dcy admin recalculate-waste-transport <org-id>Re-split waste emissions into management vs transport
dcy admin energyInsert or update energy records directly (kWh)

Recalculate Scope 3 T&D

Trigger a backend task to recalculate Scope 3 Transmission & Distribution data for one or more organizations:
dcy admin recalculate-scope3-td <org-id>
Output:
Recalculation triggered for 1 organization(s)
Organizations: 550e8400-...
Timeout: 7200s
Task ID: abc123-...
Status: PROVISIONING
Logs URL: https://...
Multiple organizations can be recalculated in a single call:
dcy admin recalculate-scope3-td <org-id-1> <org-id-2> <org-id-3>

Flags

FlagShortDefaultDescription
--timeout-t7200Task timeout in seconds

Examples

# Single org with default timeout (2 hours)
dcy admin recalculate-scope3-td 550e8400-...

# Multiple orgs with custom timeout
dcy admin recalculate-scope3-td 550e8400-... 661f9511-... --timeout 3600

# JSON output to capture task ARN
dcy admin recalculate-scope3-td 550e8400-... --format json | jq '.task_arn'

Recalculate Waste Transport

Re-split waste emissions into management vs transport components for one or more organizations. The backend finds waste records where the split needs recalculating and emits EventBridge events to trigger the recalculation pipeline:
dcy admin recalculate-waste-transport <org-id>
Output:
Waste transport recalculation triggered for 1 organization(s)
Organizations: 550e8400-...
Wastes Matched: 45
Events Emitted: 45

Flags

FlagDefaultDescription
--dry-runfalseCount matching wastes without emitting recalculation events

Examples

# Preview what would be recalculated
dcy admin recalculate-waste-transport 550e8400-... --dry-run

# Trigger recalculation
dcy admin recalculate-waste-transport 550e8400-...

# Multiple orgs
dcy admin recalculate-waste-transport 550e8400-... 661f9511-...

# JSON output
dcy admin recalculate-waste-transport 550e8400-... --format json
Dry-run output:
Waste transport recalculation triggered for 1 organization(s)
Organizations: 550e8400-...
Wastes Matched: 45
Events Emitted: 0
⚠ dry run: no events were emitted

Energy Records

Insert or update energy records directly in the energy table, bypassing the normal calculation flow. Values must be in kWh.

Inline Mode (Single Item)

dcy admin energy <record-id> <record-type> <total-kwh>
Output:
✓ 550e8400-...: inserted 1 energy row(s)
Record types: electricity, heat, vehicle_consumption.

Batch Mode (CSV File)

dcy admin energy --file items.csv
Output:
✓ abc-123: inserted 1 energy row(s)
✓ def-456: updated 1 energy row(s)
✗ ghi-789: record not found

Flags

FlagShortDefaultDescription
--file-fPath to CSV file with columns: record_id, record_type, total_kwh

CSV Format

The CSV file must have a header row with these required columns:
items.csv
record_id,record_type,total_kwh
abc-123,electricity,500.0
def-456,heat,1200.0
ghi-789,vehicle_consumption,350.5
  • Maximum 500 rows per file
  • total_kwh must be non-negative
  • UTF-8 BOM is automatically stripped (Excel on Windows)

Examples

# Insert a single electricity record
dcy admin energy 550e8400-... electricity 500.0

# Batch insert from CSV
dcy admin energy --file energy-records.csv

# JSON output
dcy admin energy 550e8400-... heat 1200.0 --format json

Typical Workflows

Recalculate After Data Migration

# 1. Preview waste transport scope
dcy admin recalculate-waste-transport <org-id> --dry-run

# 2. Run waste transport recalculation
dcy admin recalculate-waste-transport <org-id>

# 3. Trigger Scope 3 T&D recalculation
dcy admin recalculate-scope3-td <org-id> --timeout 3600

Bulk Energy Data Fix

# 1. Prepare the CSV with corrected values
cat > fixes.csv << 'CSV'
record_id,record_type,total_kwh
abc-123,electricity,500.0
def-456,heat,1200.0
CSV

# 2. Apply fixes
dcy admin energy --file fixes.csv

# 3. Verify results
dcy admin energy --file fixes.csv --format json | jq '.results[] | {record_id, action}'

Next Steps

Waste Water

Recalculate waste water treatment emissions

Invoices

Manage energy invoices

Organizations

Find organization IDs

Configuration

Set up environments and API keys