Commands config

The commands config file decides what options (that will run a certain command on select) to be display in the video and playlist page respectively, it is located in ~/.config/youtube-tui/commands.yml.

Example commands config

launch_command: loadpage library ;; flush ;; history clear ;; key Esc 0 ;; key Up 0 ;; key Up 0 ;; key Left 0 ;; key Enter 0 # the key commands select the searchbar on launch
video:
- Reload updated video: run rm '~/.cache/youtube-tui/info/${id}.json' ;; video ${id} # remove the cached info first, then reload the page
- Play video: parrun ${video-player} '${embed-url}'
- Play audio: mpv stop ;; resume ;; mpv sprop loop-file no ;; mpv loadfile '${embed-url}' ;; echo mpv Player started
- Play audio (loop): mpv stop ;; resume ;; mpv sprop loop-file inf ;; mpv loadfile '${embed-url}' ;; echo mpv Player started
- View channel: channel ${channel-id}
- Subscribe to channel: sync ${channel-id}
- Open in browser: parrun ${browser} '${url}'
- Toggle bookmark: togglemark ${id}
- Save video to library: bookmark ${id} ;; run rm -rf '${save-path}${id}.*' ;; parrun ${terminal-emulator} ${youtube-downloader} '${embed-url}' -o '${save-path}%(title)s[%(id)s].%(ext)s'
- Save audio to library: bookmark ${id} ;; parrun rm -rf '${save-path}${id}.*' ;; parrun ${terminal-emulator} ${youtube-downloader} '${embed-url}' -x -o '${save-path}%(title)s[%(id)s].%(ext)s'
- 'Mode: ${provider}': switchprovider

# ...

The few required fields are:

  • video
  • saved_video
  • playlist
  • saved_playlist
  • channel

Env variables

Notice that a lot of the commands contains the ${label} pattern, this actually replaces the text with the env variables set in main.yml, or is added by the current page (video or playlist) on-the-go.

Env reference

Does not include custom env set in main.yml.

NamePageValue
urlsearch, popular, trending, video, playlist, channel (main)String url to the web page
idvideo, playlist, channel (main)String id of the video, playlist or channel
titlevideo, playlistTitle of video or playlist
namechannelName of channel
channel-idvideo, playlistString id of the channel
embed-urlvideoString url to the embed video (required to play video using mpv from Invidious)
all-videosplaylistString urls separated by space to all embed videos in a playlist
hover-urltrending, popular, searchUrl of the currenly hovering item.
hover-idtrending, popular, searchUrl of the currenly hovering item.
hover-titletrending, popular, searchTitle of the currenly hovering item.
hover-channeltrending, popular, searchChannel name of the currenly hovering item.
hover-channel-idtrending, popular, searchChannel ID of the currenly hovering item.
hover-channeltrending, popular, searchUrl of the currenly hovering item.
hover-channel-idtrending, popular, searchUrl of the currenly hovering item.
hover-channel-urlfeedUrl of the currenly hovering channel.
hover-channel-idfeedID of the currenly hovering channel.
hover-video-urlfeedUrl of the currenly hovering video.
hover-video-idfeedID of the currenly hovering video.
all-idsplaylistIDs of all videos in a playlist, separated with space.
offline-pathSaved video and playlist onlyDirect path to saved file.
mpv-queuelistOnline playlists onlyValid mpv command to queue all videos in the list.
offline-queuelistSaved playlists onlyValid mpv command to queue all saved videos in the list.