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

# Automation & AI Overview

> From manual processes to automated, AI-assisted operational data management

# Automation & AI Overview

Traditional data tools were built for manual workflows: export data, upload spreadsheets, click through interfaces. But modern operational data management demands more—automated pipelines, multi-organization management, and AI-assisted analysis.

Dcycle provides three complementary interfaces to match your automation needs:

<CardGroup cols={3}>
  <Card title="REST API" icon="code" href="/api-reference/introduction">
    Programmatic access for custom integrations and applications
  </Card>

  <Card title="CLI" icon="terminal" href="/cli/overview">
    Command-line interface for scripts, automation, and power users
  </Card>

  <Card title="MCP Server" icon="robot" href="/mcp/overview">
    AI assistant integration for natural language queries
  </Card>
</CardGroup>

## The Automation Gap

Most organizations start with manual processes:

```
Manual Workflow (typical)
─────────────────────────
1. Export data from ERP/TMS         → 15 min
2. Transform to required format     → 30 min
3. Upload via web interface         → 20 min
4. Verify and fix errors            → 45 min
5. Generate reports                 → 15 min
                                    ─────────
                            Total:  ~2 hours/month
```

With automation, this becomes:

```
Automated Workflow
──────────────────
1. Scheduled script pulls from ERP  → automatic
2. CLI uploads and validates        → automatic
3. Errors flagged for review        → 5 min
4. Reports generated on schedule    → automatic
                                    ─────────
                            Total:  ~5 min/month
```

## When to Automate

<AccordionGroup>
  <Accordion title="High-volume data uploads">
    **Signs you need automation:**

    * Uploading more than 100 records manually per month
    * Multiple data sources (fleet, facilities, purchases)
    * Regular data refresh cycles (weekly, monthly)

    **Solution:** CLI bulk upload with scheduled scripts

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    # Monthly automation example
    dc logistics upload /data/viajes_$(date +%Y%m).csv --type requests
    dc logistics upload /data/consumos_$(date +%Y%m).csv --type recharges
    ```
  </Accordion>

  <Accordion title="Multi-organization management">
    **Signs you need automation:**

    * Managing 5+ subsidiaries or business units
    * Consolidated reporting requirements
    * Different teams uploading to different organizations

    **Solution:** CLI with organization switching + centralized scripts

    ```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
    # Consolidate data across organizations
    for org_id in $ORG_IDS; do
      dc org set $org_id
      dc vehicle list --format json >> all_vehicles.json
    done
    ```
  </Accordion>

  <Accordion title="CI/CD integration">
    **Signs you need automation:**

    * Data validation before upload
    * Audit trail requirements
    * Integration with existing DevOps pipelines

    **Solution:** CLI in GitHub Actions, GitLab CI, or similar

    ```yaml theme={"theme":{"light":"github-light","dark":"github-dark"}}
    # .github/workflows/upload-emissions.yml
    - name: Upload emissions data
      env:
        DCYCLE_API_KEY: ${{ secrets.DCYCLE_API_KEY }}
      run: dc logistics upload data/viajes.csv --type requests
    ```
  </Accordion>

  <Accordion title="Ad-hoc analysis and reporting">
    **Signs you need automation:**

    * Frequent questions from stakeholders
    * Need for quick insights without navigating UI
    * Sustainability team spending time on repetitive queries

    **Solution:** MCP Server with AI assistant

    ```
    User: "How do our Q3 emissions compare to last year?"

    Claude: Your Q3 2024 emissions were 312 tCO2e, down 18%
    from Q3 2023 (380 tCO2e). The reduction is primarily
    from Scope 2 (-25%) due to your renewable energy switch.
    ```
  </Accordion>
</AccordionGroup>

## Automation Maturity Model

Most organizations progress through these stages:

<Steps>
  <Step title="Level 1: Manual">
    **Characteristics:**

    * All data entry via web interface
    * Export/import with spreadsheets
    * Ad-hoc reporting

    **Typical effort:** 2-4 hours/week on data management
  </Step>

  <Step title="Level 2: Scripted">
    **Characteristics:**

    * CLI for bulk uploads
    * Scheduled scripts for regular data
    * JSON exports for analysis

    **Typical effort:** 30 min/week on data management

    **Key enablers:** CLI, `--format json`, cron jobs
  </Step>

  <Step title="Level 3: Integrated">
    **Characteristics:**

    * Data flows from source systems automatically
    * CI/CD pipelines validate and upload
    * Alerts on data quality issues

    **Typical effort:** Exception handling only

    **Key enablers:** API, webhooks, CI/CD integration
  </Step>

  <Step title="Level 4: AI-Assisted">
    **Characteristics:**

    * Natural language queries for insights
    * AI-generated reports and analysis
    * Proactive recommendations

    **Typical effort:** Strategic decisions only

    **Key enablers:** MCP Server, AI assistants
  </Step>
</Steps>

## Key Automation Features

### Structured Output

All CLI commands support machine-readable output:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# JSON for programmatic processing
dc vehicle list --format json | jq '.[] | {plate, emissions}'

# CSV for spreadsheet tools
dc facility list --format csv > facilities.csv
```

### Non-Interactive Mode

Skip confirmation prompts for automated pipelines:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Delete without confirmation
dc vehicle delete $VEHICLE_ID --yes

# Upload without prompts
dc logistics upload data.csv --type requests --yes
```

### Environment-Based Authentication

No credentials in scripts:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export DCYCLE_API_KEY=your_api_key
export DCYCLE_ORG_ID=your_org_id

# Commands use environment automatically
dc vehicle list
```

### Composable Operations

Chain commands for complex workflows:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
# Find high-emission vehicles and export details
dc vehicle list --format json | \
  jq '.[] | select(.emissions_tco2e > 50)' | \
  dc vehicle show --format json
```

## Choosing the Right Tool

| Need                  | Best Tool      | Why                               |
| --------------------- | -------------- | --------------------------------- |
| Bulk data upload      | CLI            | Designed for batch operations     |
| Custom integration    | API            | Full programmatic control         |
| Quick queries         | MCP            | Natural language, no coding       |
| Scheduled jobs        | CLI + cron     | Simple, reliable automation       |
| Real-time sync        | API + webhooks | Event-driven architecture         |
| Stakeholder questions | MCP            | Accessible to non-technical users |

## Next Steps

<CardGroup cols={2}>
  <Card title="Reporting Pipelines" icon="clock" href="/guides/automation/reporting-pipelines">
    Set up automated reporting pipelines
  </Card>

  <Card title="Multi-Organization" icon="sitemap" href="/guides/automation/multi-organization">
    Manage holdings and subsidiaries
  </Card>

  <Card title="AI-Assisted Analysis" icon="robot" href="/guides/automation/ai-assisted-analysis">
    Use AI for operational data insights
  </Card>

  <Card title="CLI Examples" icon="terminal" href="/cli/examples">
    Practical automation scripts
  </Card>
</CardGroup>
