Skip to content

CLI Commands

MediaMoth binaries use Cobra subcommands. Use this page to choose a command, then run <binary> --help and <binary> <command> --help against the exact build you deploy; the tables below reflect mediamoth main at commit 481899a.

Service processes

BinaryCommandsNotes
media-serviceserveThe server includes its in-memory event handling.
workflow-serviceserve, ctlserve accepts MCP flags.
job-serviceserve, ctlserve accepts MCP and MQTT flags.
search-serviceserve, worker, dual, migrate, ctldual runs server and worker.
video-conversion-serviceserve, worker, dualThe executable's Cobra name is video-conversion-service.
chapter-inserterserve, worker, dualdual runs server and worker.
vhs-serviceserve <service>, worker <service>, hybrid <service>Valid service tokens are tbc-decode and vhs-decode.

Media, Workflow, and Job Service no longer have a dual command. Their serve process includes the event handlers that were previously separate.

MCP and MQTT flags

Workflow, Job, Media, and Search server commands accept:

FlagDefaultMeaning
--mcpfalseStart the MCP SSE server.
--mcp-addr:8080MCP SSE listen address.

Job Service also accepts --mqtt to enable its Mosquitto listener.

Projection rebuilds

Job, Search, and Workflow Service expose the following command form for rebuilding one projection handler or every aggregate handled by that projection:

bash
<service> ctl rebuildProjection <handler> (--all | --aggregate-id <id>) [flags]

Handlers differ by service:

ServiceHandlers
job-serviceJob
search-serviceJobs, Services
workflow-servicePipeline, Service, ServiceInfo

Useful flags:

FlagShortDefaultMeaning
--all-AfalseRebuild every aggregate.
--aggregate-id-aRebuild one aggregate.
--dry-run-dfalseResolve configuration and show the mode without replaying.
--yes-yfalseSkip the confirmation prompt.
--db-uriconfigured DBOverride the event-store URI.
--batch-size-b1000Events per batch; maximum 10,000.
--count-timeout30Seconds allowed to count events.

WARNING

Rebuilding a projection replays stored events through its handler and can create significant database and downstream load. Start with --dry-run; omit --yes until you have reviewed the selected handler and scope.

Run a command such as the following after choosing the service and handler:

bash
job-service ctl rebuildProjection Job --all --dry-run
workflow-service ctl rebuildProjection Pipeline --aggregate-id pipeline-123
search-service ctl rebuildProjection Jobs --all --yes

Job node-data backfill

Job Service can repair missing node metadata in legacy jobs:

bash
job-service ctl backfillNodeData (--all | --aggregate-id <id>) [flags]

It supports --dry-run, --yes, and --timeout (default 30 seconds). The command resolves historical pipeline information and applies corrections through ApplyJobCorrection.

Search migration

Run Search Service database migrations before starting it:

bash
search-service migrate

The development Compose file runs this as a one-shot dependency of Search Service.

VHS process selection

Exactly one VHS module runs per process:

bash
vhs-service serve vhs-decode
vhs-service worker vhs-decode
vhs-service hybrid tbc-decode

The command token selects the matching section under services: in vhs-service/config.yaml.

Repository task commands

For source development, prefer mise tasks over invoking binaries manually:

bash
mise tasks
mise run dev:chapter-inserter
mise run test:vhs-service
mise run lint:video-service

See Getting Started for setup.

Released under the MIT License.