trimsec helps you plan your content consumption with two primary functions:
- Fit-checking contents for the remainder of the day, or a specific time-budget, and
- Trimming the content using multipliers and calculating how much time you'll save.
Everything else is cherry-on-top.
Development happens on Codeberg and merged onto GitHub for deploying to the release pipeline.
To calculate saved time, you run a pattern like this:
ts 1h 2xtrimsec can receive an arbitrary amount of inputs and can output trims based on that:
ts 1h30m 1.5x 3h 2x
ts 1h30m 1.5x 1.2x 3h 2m
ts 3x 2h 2h 2h 1.25x 1h 2x 3.5hNearby durations based on the cursor are combined and checked against their common multipliers. This allows checking a huge number of durations in a matter of seconds. trimsec will daisy-chain these commands and also output how much time you'll save by the end of the day/budget.
You can also explicitly combine two durations like this:
ts 1h30m+2h50m 1.25xNote
You must set your Google Cloud Console API key first for the YouTube Data API (v3):
ts key set <API_KEY_HERE>trimsec can also receive YouTube URLs as arguments alongside all the other durations and multipliers:
ts "https://www.youtube.com/watch?v=D4iiKkjGJmU" 1.25xThis leads to an infinite amount of combinations and daisy-chaining that you can do:
ts <URL> 1h30m 1.25x 2h <URL> 2xYouTube playlist URLs are also supported and can be combined with other durations too if needed:
ts 1.8x "https://www.youtube.com/watch?v=rdXw7Ps9vxc&list=PLHXZ9OQGMqxersk8fUxiUMSIx0DBqsKZS"You can also prefix the playlist URL with max:<n>:: to only calculate for the first n elements of the playlist. Here we demonstrate this by grabbing the first 5:
ts 1.8x "max:5::https://www.youtube.com/watch?v=rdXw7Ps9vxc&list=PLHXZ9OQGMqxersk8fUxiUMSIx0DBqsKZS"For fit-checking, you may use the patterns mentioned below.
Combination rules explained in 1. Trimming apply here as well, so other combinations of arguments are also possible outside of this collection.
# budget is today
ts 1h24m
ts "https://youtube.com/..."
# fixed budget: 2 hours and 4 minutes
ts 1h24m 2h4m
ts "https://youtube.com/..." 2h4m
# two items, explicit budget of 2h4m
ts 1h24m 15m b2h4m
# multiple args, budget is today
ts <URL> 1h30m 2h <URL> 3h
# multiple args, explicit budget of 15h
ts <URL> 1h30m 2h <URL> 3h b15h
# youtube playlist, budget of 5h
ts "https://youtu.be/..." 5h
# youtube playlist, item cap, and other content
ts "max:5::https://youtu.be/..." 3h20m b5htrimsec uses the hybrid of a deterministic parser and clap, so explicit commands are also possible just like any typical command-line interface.
Some notable commands are:
ts list <PLAYLIST_URL>- Lists the contents of a YouTube playlist.
A few configuration-related commands are:
ts path- Shows the path to the configuration file.ts key <subcommand>(used for Google Cloud Console API configuration for YouTube support)ts key show- Shows the configured API key.ts key set <API_KEY>- Sets a new API key.ts key unset- Unsets the configured API key.
These are the most commonly-used ones. For viewing all of the commands, run ts help and see "Commands".
Note
The deterministic parser will most likely have different grammar from clap's logic. For example, setting an item-cap for trimming would look something like ts "max::10::https://youtube.com/...", but for the ts list command, it would look like ts list --max-items 10 "https://youtube.com/....
Note
This is an expanding list as of now.
Pipes are supported just like any other well-built Unix/Linux command-line interface.
echo "1h2m 1.25x" | ts 2h 3xThe configuration file for trimsec lies in the home directory of the user:
- Linux:
$HOME/.trimsecrc(e.g./home/alice/.trimsecrc) - macOS:
$HOME/.trimsecrc(e.g./Users/hitblast/.trimsecrc) - Windows:
C:\Users\<username>\.trimsecrc
The primary use of the configuration file is to store the API key (see "For YouTube videos/playlists") for Google Cloud Console, and to store configuration options for trimsec itself, which are described below.
trimsec provides partial modifications of its features through the options table.
For example, if you need to set a default time-budget for fit-checks, you can use:
[options]
default_fit_budget = "2h4m"- Using Homebrew:
brew tap hitblast/tap
# Optional (if Homebrew does not trust the tap): brew trust hitblast/tap
brew install trimsec- Using
cargo:
cargo install trimsec- Using cargo-binstall:
cargo binstall trimsec- Using mise:
mise use -g cargo:trimsec- Or,
Get platform-based binaries here: https://github.com/hitblast/trimsec/releases
git clone https://github.com/hitblast/trimsec.git
cd trimsec && cargo build --releaseThis project is licensed under the MIT License.

