# wyattblue/auto-editor architecture

> Architecture diagram of the GitHub repository wyattblue/auto-editor, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-17). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/wyattblue/auto-editor
- Repository: https://github.com/wyattblue/auto-editor

## Overview

Auto-Editor is a command-line audio/video editor whose main workflow analyzes media to identify active and inactive sections, turns those labels into timeline edits, and renders or exports the result. The README also documents motion-based editing, configurable actions, transcription-related commands, and exports for several editing applications. The graph preserves these capabilities, plus the WebCodecs bridges and macOS speech shim identified in the source index. Most runtime modules were not sampled, so their likely connections are shown only as unverified dashed edges.

Main entry points: [`src/cli.nim`](https://github.com/wyattblue/auto-editor/blob/master/src/cli.nim) (CLI options), [`src/media.nim`](https://github.com/wyattblue/auto-editor/blob/master/src/media.nim) (Media handling), [`src/edit.nim`](https://github.com/wyattblue/auto-editor/blob/master/src/edit.nim) (Edit expressions), [`src/conductor.nim`](https://github.com/wyattblue/auto-editor/blob/master/src/conductor.nim) (Render orchestration)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["CLI and editing"]
  node_main["Application entry<br/>[main.nim]"]
  node_cli["CLI options<br/>[cli.nim]"]
  node_media["Media handling<br/>[media.nim]"]
  node_edit["Edit expressions<br/>[edit.nim]"]
  node_editparse["Edit parsing<br/>[editparse.nim]"]
  node_action["Edit actions<br/>[action.nim]"]
  node_timeline["Timeline<br/>[timeline.nim]"]
end

subgraph group_analysis["Media analysis"]
  node_analyzeaudio["Audio analysis<br/>[audio.nim]"]
  node_analyzemotion["Motion analysis<br/>[motion.nim]"]
  node_analyzesubtitle["Subtitle analysis<br/>[subtitle.nim]"]
  node_transcribe["Transcription<br/>[transcribe.nim]"]
end

subgraph group_output["Render and export"]
  node_render["Render orchestration<br/>[conductor.nim]"]
  node_rendervideo["Video rendering<br/>[video.nim]"]
  node_renderaudio["Audio rendering<br/>[audio.nim]"]
  node_encoders["Encoder selection<br/>[encoders.nim]"]
  node_exports["Editor exports"]
end

subgraph group_integration["Codec and speech bridges"]
  node_speechshim["Apple speech shim<br/>[ae_speech.swift]"]
  node_webdec_c["WebCodecs decoder<br/>[webcodecsdec.c]"]
  node_webdec_js["Decoder JS bridge<br/>[webcodecs.js]"]
  node_webenc_c["WebCodecs encoder<br/>[webcodecsenc.c]"]
  node_webenc_js["Encoder JS bridge<br/>[webcodecsenc.js]"]
end

node_user(("CLI user"))

node_user -->|"runs"| node_main
node_main -.->|"dispatches"| node_cli
node_cli -.->|"opens media"| node_media
node_media -.->|"analyzes audio"| node_analyzeaudio
node_media -.->|"analyzes motion"| node_analyzemotion
node_media -.->|"analyzes subtitles"| node_analyzesubtitle
node_cli -.->|"configures edits"| node_edit
node_edit -.->|"parses expression"| node_editparse
node_edit -.->|"sets actions"| node_action
node_edit -.->|"produces timeline"| node_timeline
node_cli -.->|"requests transcription"| node_transcribe
node_transcribe -.->|"calls shim"| node_speechshim
node_timeline -.->|"supplies edit"| node_render
node_render -.->|"renders video"| node_rendervideo
node_render -.->|"renders audio"| node_renderaudio
node_render -.->|"selects encoders"| node_encoders
node_cli -->|"requests export"| node_exports
node_webdec_c -->|"calls bridge"| node_webdec_js
node_webenc_c -->|"calls bridge"| node_webenc_js

click node_main "https://github.com/wyattblue/auto-editor/blob/master/src/main.nim"
click node_cli "https://github.com/wyattblue/auto-editor/blob/master/src/cli.nim"
click node_media "https://github.com/wyattblue/auto-editor/blob/master/src/media.nim"
click node_edit "https://github.com/wyattblue/auto-editor/blob/master/src/edit.nim"
click node_editparse "https://github.com/wyattblue/auto-editor/blob/master/src/editparse.nim"
click node_action "https://github.com/wyattblue/auto-editor/blob/master/src/action.nim"
click node_timeline "https://github.com/wyattblue/auto-editor/blob/master/src/timeline.nim"
click node_analyzeaudio "https://github.com/wyattblue/auto-editor/blob/master/src/analyze/audio.nim"
click node_analyzemotion "https://github.com/wyattblue/auto-editor/blob/master/src/analyze/motion.nim"
click node_analyzesubtitle "https://github.com/wyattblue/auto-editor/blob/master/src/analyze/subtitle.nim"
click node_transcribe "https://github.com/wyattblue/auto-editor/blob/master/src/transcribe.nim"
click node_speechshim "https://github.com/wyattblue/auto-editor/blob/master/src/ae_speech.swift"
click node_render "https://github.com/wyattblue/auto-editor/blob/master/src/conductor.nim"
click node_rendervideo "https://github.com/wyattblue/auto-editor/blob/master/src/render/video.nim"
click node_renderaudio "https://github.com/wyattblue/auto-editor/blob/master/src/render/audio.nim"
click node_encoders "https://github.com/wyattblue/auto-editor/blob/master/src/encoders.nim"
click node_exports "https://github.com/wyattblue/auto-editor/tree/master/src/exports"
click node_webdec_c "https://github.com/wyattblue/auto-editor/blob/master/src/webcodecsdec.c"
click node_webdec_js "https://github.com/wyattblue/auto-editor/blob/master/src/webcodecs.js"
click node_webenc_c "https://github.com/wyattblue/auto-editor/blob/master/src/webcodecsenc.c"
click node_webenc_js "https://github.com/wyattblue/auto-editor/blob/master/src/webcodecsenc.js"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_main,node_cli,node_media,node_edit,node_editparse,node_action,node_timeline,node_user toneBlue
class node_analyzeaudio,node_analyzemotion,node_analyzesubtitle,node_transcribe toneAmber
class node_render,node_rendervideo,node_renderaudio,node_encoders,node_exports toneMint
class node_speechshim,node_webdec_c,node_webdec_js,node_webenc_c,node_webenc_js toneRose
```

## Components

### CLI and editing

- [Application entry](https://github.com/wyattblue/auto-editor/blob/master/src/main.nim): `src/main.nim`
- [CLI options](https://github.com/wyattblue/auto-editor/blob/master/src/cli.nim): `src/cli.nim`
- [Media handling](https://github.com/wyattblue/auto-editor/blob/master/src/media.nim): `src/media.nim`
- [Edit expressions](https://github.com/wyattblue/auto-editor/blob/master/src/edit.nim): `src/edit.nim`
- [Edit parsing](https://github.com/wyattblue/auto-editor/blob/master/src/editparse.nim): `src/editparse.nim`
- [Edit actions](https://github.com/wyattblue/auto-editor/blob/master/src/action.nim): `src/action.nim`
- [Timeline](https://github.com/wyattblue/auto-editor/blob/master/src/timeline.nim): `src/timeline.nim`

### Media analysis

- [Audio analysis](https://github.com/wyattblue/auto-editor/blob/master/src/analyze/audio.nim): `src/analyze/audio.nim`
- [Motion analysis](https://github.com/wyattblue/auto-editor/blob/master/src/analyze/motion.nim): `src/analyze/motion.nim`
- [Subtitle analysis](https://github.com/wyattblue/auto-editor/blob/master/src/analyze/subtitle.nim): `src/analyze/subtitle.nim`
- [Transcription](https://github.com/wyattblue/auto-editor/blob/master/src/transcribe.nim): `src/transcribe.nim`

### Render and export

- [Render orchestration](https://github.com/wyattblue/auto-editor/blob/master/src/conductor.nim): `src/conductor.nim`
- [Video rendering](https://github.com/wyattblue/auto-editor/blob/master/src/render/video.nim): `src/render/video.nim`
- [Audio rendering](https://github.com/wyattblue/auto-editor/blob/master/src/render/audio.nim): `src/render/audio.nim`
- [Encoder selection](https://github.com/wyattblue/auto-editor/blob/master/src/encoders.nim): `src/encoders.nim`
- [Editor exports](https://github.com/wyattblue/auto-editor/tree/master/src/exports): `src/exports`

### Codec and speech bridges

- [Apple speech shim](https://github.com/wyattblue/auto-editor/blob/master/src/ae_speech.swift): `src/ae_speech.swift`
- [WebCodecs decoder](https://github.com/wyattblue/auto-editor/blob/master/src/webcodecsdec.c): `src/webcodecsdec.c`
- [Decoder JS bridge](https://github.com/wyattblue/auto-editor/blob/master/src/webcodecs.js): `src/webcodecs.js`
- [WebCodecs encoder](https://github.com/wyattblue/auto-editor/blob/master/src/webcodecsenc.c): `src/webcodecsenc.c`
- [Encoder JS bridge](https://github.com/wyattblue/auto-editor/blob/master/src/webcodecsenc.js): `src/webcodecsenc.js`

### Other components

- **CLI user**

## Connections

- CLI user → Application entry: runs (evidence: `README.md`)
- Application entry → CLI options: dispatches
- CLI options → Media handling: opens media
- Media handling → Audio analysis: analyzes audio
- Media handling → Motion analysis: analyzes motion
- Media handling → Subtitle analysis: analyzes subtitles
- CLI options → Edit expressions: configures edits
- Edit expressions → Edit parsing: parses expression
- Edit expressions → Edit actions: sets actions
- Edit expressions → Timeline: produces timeline
- CLI options → Transcription: requests transcription
- Transcription → Apple speech shim: calls shim
- Timeline → Render orchestration: supplies edit
- Render orchestration → Video rendering: renders video
- Render orchestration → Audio rendering: renders audio
- Render orchestration → Encoder selection: selects encoders
- CLI options → Editor exports: requests export (evidence: `README.md`)
- WebCodecs decoder → Decoder JS bridge: calls bridge (evidence: `src/webcodecsdec.c`)
- WebCodecs encoder → Encoder JS bridge: calls bridge (evidence: `src/webcodecsenc.c`)
