duckeye for the terminal
…read anything that quacks like a doc, however you want: webpages, data, docs, code & more.
Read documents in your terminal: Markdown, HTML, PDF, DOCX, EPUB, LaTeX, Jupyter notebooks, source code and an offline Wikipedia. Each format is a DuckDB extension. duckeye is one script that needs only DuckDB, with pandoc for a few gaps.
Install
curl -fsSL https://raw.githubusercontent.com/teaguesterling/duckeye/main/install.sh | bash
The script puts duckeye in ~/.local/bin, adds the short names de, dep (paged) and der (raw table), and installs the DuckDB extensions. duckeye --update keeps everything current. Source and full docs: github.com/teaguesterling/duckeye (MIT licence).
Read what you can't cat
duckeye proposal.docx # a Word document, in the terminal duckeye -T book.epub # the outline of a book duckeye -S 'Results' paper.tex # one section of a LaTeX paper duckeye -P 1-5 manual.pdf # pages 1 to 5 of a PDF duckeye analysis.ipynb # notebook prose and code, no Jupyter
Code, by its structure
duckeye -T server.go # outline classes, functions and methods duckeye -S handle_request server.go # one function, with its body duckeye -Q .fn#foo test.py # select code by CSS selector (experimental)
Code is read by sitting_duck as a syntax tree, in more than 20 languages.
Data files are tables
duckeye events.parquet duckeye -w "level = 'ERROR'" events.parquet # filter rows duckeye spreadsheet.xlsx
Parquet, CSV, TSV, JSON, YAML, TOML, XLSX, zip archives and a git history open as tables.
And more
- Offline Wikipedia: search a ZIM archive of 19 million articles, for example
duckeye -s photosynthesis wikipedia.zim. - Old versions: read a file at any git revision, such as
duckeye 'git://README.md@v0.12.0'. - Convert:
-t md,-t htmlor-t pandocwrites what you selected, such as one section of a Word file, as Markdown. - Pipes:
curl -s $URL | duckeye -reads standard input and works out its format. - AI agents: the installer adds a skill that teaches coding agents to use duckeye.
The same engine as the app
duckeye for the terminal and duckeye for Android read with the same DuckDB extensions. The terminal tool reads more today, such as PDF, ZIM archives and code syntax trees. Read about the approach.