Skip to content
Edith

Docs

Command reference

Viewer

Viewer has no command group of its own. Everything its page and Home card do is an operation of the running extension, sent through ed invoke with a JSON payload. Results are JSON on stdout; a refused request prints a JSON error on stderr and exits non-zero.

Paths are absolute. A leading ~ is expanded and a file:// URL is accepted. Files macOS cannot play are repackaged or converted with FFmpeg, which Edith installs from Settings > Tools; until it is installed, inspect reports needsFFmpeg and prepare refuses those files.

Terminal
ed invoke viewer open --json '{"path":"/tmp/synthetic/Film.mkv"}'ed invoke viewer control --json '{"control":"togglePlay"}'ed invoke viewer control --json '{"control":"seek","value":90}'ed invoke viewer control --json '{"control":"speed","value":1.5}'ed invoke viewer control --json '{"control":"search","text":"invoice"}'ed invoke viewer inspect --json '{"path":"/tmp/synthetic/Film.mkv"}'ed invoke viewer prepare --json '{"path":"/tmp/synthetic/Film.mkv"}'ed invoke viewer subtitles --json '{"path":"/tmp/synthetic/Film.mkv"}'ed invoke viewer subtitle --json '{"path":"/tmp/synthetic/Film.mkv","stream":3}'ed invoke viewer table --json '{"path":"/tmp/synthetic/rows.csv","sort":1,"descending":true,"limit":20}'ed invoke viewer playlist --json '{"path":"/tmp/synthetic/Episode 2.mkv"}'ed invoke viewer recented invoke viewer clearRecent --json '{"confirm":true}'

Operations

Operation Input Output
open path path, name, kind and the event sequence. Adds the file to the recent files and brings the Viewer page forward
viewer.open path The same as open. Edith sends it when a file is opened with Edith from Finder
status {} current, playback, conversion, recent, ffmpegAvailable, privacy, settings and sequence
poll after Events newer than after (open and control), privacy, conversion and musicPlaying. The page uses it to follow the commands below
control control, value, text The open file's path, name, kind and the event sequence. Refused when nothing is open or the control does not apply to the open file
recent {} Recent files, newest first, with path, kind and openedAt. Files that no longer exist are dropped
forget path removed: 1 when the file was in the recent files
clearRecent confirm removed, the number of recent files forgotten. Refused without "confirm": true. The files themselves are not touched
inspect path kind, ffmpegAvailable, needsFFmpeg, the FFmpeg probe (streams, chapters, container) and the playback plan, plus subtitle files found next to a video
prepare path, burnSubtitle state (ready, converting, failed, cancelled), engine (native, remux, transcode), playablePath once ready, notice and fraction
cancelPrepare {} removed: 1 when a conversion was running
subtitles path embedded subtitle streams and sidecars (SRT, VTT and ASS files named like the video)
subtitle path, stream or file cues with start, end, text and style, read from an embedded text stream or a subtitle file
resume path position to resume from, or none, and whether resuming is enabled
saveResume path, position, duration ok
forgetResume path ok
playlist path items, the files of the same family in the folder in natural name order, and the index of this one
table path, sort, descending, query, limit, offset columns, rows (500 by default, at most 5000), total, matching, delimiter and encoding of a CSV or TSV file
report path, title, kind, playing, position, duration, speed ok. The page reports playback here for the notch and the Home card; without path it clears the report

Controls

control takes one of these names. Those marked with a value need value; search needs text.

Applies to Controls
Video and audio togglePlay, play, pause, seek (seconds), seekBy (seconds), jumpPercent (0 to 100), faster, slower, resetSpeed, speed (0.25 to 4), loopCycle, loopA, loopB, loopClear, volumeUp, volumeDown, volume (0 to 1), mute, audioTrack (index), cycleAudio, nextChapter, previousChapter, chapter (index)
Video frameForward, frameBackward, subtitleTrack (index in the subtitle menu, 0 is off), cycleSubtitles, subtitleDelayUp, subtitleDelayDown, subtitleDelay (seconds), pictureInPicture, still
PDF and presentations pageNext, pagePrevious, page (page number, PDF), present
PDF, images and tables zoomIn, zoomOut, zoomFit, zoomActual
PDF and tables search
Images rotateLeft, rotateRight, slideshow
Every file nextFile, previousFile, fullScreen, exitFullScreen, close

Playback engine

plan.engine says how a file plays:

  • native: AVFoundation plays the file as it is (MP4, MOV, M4V, MP3, AAC, ALAC, WAV, AIFF, FLAC, H.264, HEVC, ProRes, AC3 and E-AC3, and AV1 on Macs that decode it in hardware).
  • remux: the streams are copied into an MP4 or M4A without changing them, and lossless audio such as FLAC or PCM becomes Apple Lossless. Fast, and nothing is lost.
  • transcode: the video is encoded to HEVC with the Mac's media engine (VP8, VP9, AV1 without hardware decoding, WMV, MPEG-2 and others), or the audio to AAC or E-AC3 (Opus, Vorbis, DTS, TrueHD). Picture subtitles (PGS, VobSub) chosen with burnSubtitle are drawn into the video. The page shows a notice.

Prepared files are kept in Viewer's data folder up to the size set in Viewer settings, oldest first out, so a file opens instantly the next time. The original file is never changed.