Television
repository·main·Indexed 27 days ago
https://github.com/alexpasmantier/televisionA fast, portable, and hackable fuzzy finder for the terminal (tv) that enables real-time searching through files, git repositories, and environment variables. It features a powerful TOML-based custom channel system, a flexible template engine for data transformation, shell integration for Zsh and Bash, and plugins for Neovim, Vim, VSCode, Zed, and JetBrains IDEs.
What's inside television
- Television is a fast, portable, and hackable fuzzy finder designed for the terminal. It allows for real-time searching through various data sources using built-in 'channels' (e.g., finding files, searching git repositories, browsing environment variables) or custom-defined channels for any data source.
Overview of available Television Channels
mainTelevision includes a wide variety of built-in channels for navigating different data sources and system components. Some notable channels include:
- System & Shell:
procs(manage running processes),sesh(session manager),ssh(ssh hosts),distrobox(manage containers),path(select PATH directories). - Development Tools:
git(diff, log, reflog),gh(GitHub),kubernetes(deployments, pods, services),justfile(Justfile recipes),tldr(tldr pages),man(man pages). - Cloud & Infrastructure:
aws(Buckets and Instances). - Package Managers:
guix(Guix packages). - File System:
files(includesgoto_parent_diraction).
- System & Shell:
Explore television community extensions
mainThe community has developed several integrations for
television:- VSCode Extension: Available on the VSCode Marketplace.
- Vim/Neovim Plugin:
tv.vim(https://github.com/prabirshrestha/tv.vim). - Yazi Plugin: Available at https://github.com/cap153/tv.yazi.
Create a custom channel
mainTo create a new channel, create a TOML file in your
televisioncable directory (typically~/.config/television/cable/). A minimal channel requires a[metadata]section with anameand a[source]section with acommand.Example of a minimal channel file:
[metadata] name = "my-awesome-channel" [source] command = "aws s3 ls my-bucket"Use default input editing keybindings
mainWhen editing input within Television, the following default keybindings are available:
Backspace: Delete the previous characterCtrl+w: Delete the previous wordCtrl+u: Delete the current lineDelete: Delete the next character←/→: Move the cursor left / rightHome/End: Move to the start / end of inputCtrl+a/e: Move to the start / end of input
Extend Television with Custom Cable Channels
mainTelevision supports custom cable channels which can be used to define your own data sources.
Key capabilities:
- Overriding Builtins: Custom cable channels can be configured to override built-in channels.
- Action Support: You can add support for
execactions within your channels. - Preview Integration: Use builtin previewers inside cable channel prototypes. You can also make previews optional for specific cable channels.
Create custom channels with TOML
mainYou can create custom channels for any workflow by defining a TOML file in
~/.config/television/cable/. A channel definition includes metadata, a source command, a preview command, and optional keybindings and actions.Example
tldr.tomlconfiguration:# ~/.config/television/cable/tldr.toml [metadata] name = "tldr" description = "Browse TLDR pages" [source] command = "tldr --list" [preview] command = "tldr '{}'" [keybindings] ctrl-e = "actions:open" [actions.open] command = "tldr '{}'" mode = "execute"Debug templates with --source-command and --preview-command
mainTo debug complex templates, use the
tvCLI flags to test your templates against controlled input.--source-command: Provides the input string that the template will process.--preview-command: Allows you to see how the template expands in a preview context.
Example Debugging Command:
tv --source-command "echo 'a:b:c'" --preview-command "echo 'Field 0: {split:\::0}, Field 1: {split:\::1}'"Browse system manual pages with man-pages channel
mainThe
man-pageschannel lets you browse and preview system manual pages usingaproposandman.Requirements:
apropos,manUsage:
- Use
enterto open the selected man page in your system pager.
[metadata] name = "man-pages" description = "Browse and preview system manual pages" requirements = [ "apropos", "man",] [source] command = "apropos ." [preview] command = "man '{0}'" [keybindings] enter = "actions:open" [ui] layout = "portrait" [preview.env] MANWIDTH = "80" [actions.open] description = "Open the selected man page in the system pager" command = "man '{0}'" mode = "execute" [ui.preview_panel] header = "{0}"- Use
Locate the television configuration file
mainTelevision uses a single configuration file in TOML format. The application looks for this file in the following locations depending on your platform:
- Linux:
$HOME/.config/television/config.toml - macOS:
$HOME/.config/television/config.toml - Windows:
%LocalAppData%\television\config\config.toml
If
$XDG_CONFIG_HOMEis set, the application will look in$XDG_CONFIG_HOME/television/config.toml.You can override the default configuration path by setting the
TELEVISION_CONFIGenvironment variable to the directory containing yourconfig.toml(e.g.,TELEVISION_CONFIG=/path/to/dirwill cause the app to look for/path/to/dir/config.toml).- Linux:
Install Television on Arch Linux
mainUse
pacmanto install the package.pacman -S televisionBasic usage of Television (tv)
mainTelevision (tv) is a fuzzy finder for the terminal. After installation, runningtvlaunches the tool with the default channel (usuallyfiles). The interface includes an input bar for searching, a results panel, and an optional preview panel.tv