caniuse.com tui interfaceCani — a
Cani is a small command-line wrapper around the data of caniuse.
It uses fzf and curses to display results.
This wrapper aims to be easy to use out of the box. To achieve this it ships with completions
zsh. Caniuse data (1.7MB) is fetched and updated automatically
on a regular interval together with completions.
dates are in dd-mm-yyyy format older changes can be found in the changelog
16-09-2019 VERSION 0.5.9
- Fix glitch where current era border would be drawn incorrectly at certain widths.
- Do not print an empty era row if none of the visible browsers show anything.
28-07-2019 VERSION 0.5.8
- Fix line overflow issue when terminal is too small for "widest" display
- Allow titles to become slightly more compact again
28-07-2019 VERSION 0.5.7
- Titles shown in
cani usemay take up to 50 characters if the terminal is wide enough.
Add this line to your application's Gemfile:
And then execute:
Or install it yourself as:
$ gem install cani
Cani depends on fzf to display most menu's and Curses for displaying the feature support table.
After installation, running the command (
cani) for the first time will create some files and directories:
~/.config/cani/config.yml- default configuration
~/.config/cani/caniuse.json- caniuse api data
~/.config/cani/completions/_cani.bash- bash completion
~/.config/cani/completions/_cani.zsh- zsh completion
~/.config/fish/completions/cani.fish- fish completions
Existing shell configuration files will also be modified by default:
~/.bashrc- A source line to bash completions will be added, or updated if it exists
~/.zshrc- A source line to zsh completions will be added, or updated if it exists
This behavior can be permanently disabled at any time by adding the
option at the end of the
cani command. A built-in command is provided to print
the completion paths for each shell:
cani completion_paths. This allows
you to add the path manually.
After running the command for the first time, please restart your shell or
~/.*rc file to load completions.
There are some commented settings that can be adjusted in the
cani without arguments yields the help description.
Cani supports the following actions:
use [FEATURE]- show browser support for selected feature
show [BROWSER [VERSION]]- show feature support based on selected browser / version
help- show help
version- print the version number
update- force update data and completions
install_completions- install shell completions
completion_paths- prints paths to shell completion files (for sourcing)
purge- purge files and directories created by
edit- edit the default configuration file with
cani supports the following command line flags / options:
--no-modify- permanently disable automatic addition / deletion of shell config files.
--modify- permanently enable automatic addition / deletion of shell config files.
Show a list of features with fzf. Features are shown with their current W3C status, percentage of support, title and each individual browser's support on a single row.
This command may be invoked with a feature and supports tab completion in
cani use grid-layout # or: # cani use 'grid layout' # cani use 'gridlayout'
The above command will show the following table:
The table is responsive and will show browsers that fit in available space, everything else wraps accordingly.
The current era has a light-black border. Browser versions with less than
0.5% usage aren't shown.
At the bottom there is a legend that provides an abbreviated status color overview. Below that, additional notes can be found.
Notes are shown based on relevant and visible browsers, all other notes are hidden (this can be changed in the config).
If your display height is
<= 40 lines, era's will be displayed in a more compact manner while still allowing space for notes:
Show a list of browsers. Selecting a browser will take you to the versions for that browser. Selecting a version shows the final window with feature support for that specific browser version. Navigating to the previous window is possible by pressing escape, this will move you up one level. When escape is pressed at the browser selection menu, the command will exit. Selecting a feature using enter will show you the current support table for that feature regardless of selected version.
This command may be invoked with a browser and / or version and supports tab completion in
# show all versions of chrome cani show chr # show all features with support level in chrome 70 cani show chr 70
Displays short help for the
Displays the current version e.g:
Force update dataset and completions.
Completions are supported for
fish shells (currently).
They are automatically installed upon first invocation of the
This command is only a fallback in case there were any issues with permissions etc..
--no-modify is applied the completion paths are no longer automatically inserted
in your shell configuration files. In order to figure out where the files you need to
source are located, you can run this command. It will output something like this:
fish: /home/sidofc/.config/fish/completions/cani.fish bash: /home/sidofc/.config/cani/completions/_cani.bash zsh: /home/sidofc/.config/cani/completions/_cani.zsh
The fish completions are autoloaded and do not need to be sourced manually.
Purges all files created by this command, removing every trace except the executable itself.
It will also remove source lines added that pointed to the completions in
--no-modify was supplied at any point in time prior to running
After running a
purge, all that remains is running
gem uninstall cani to completely purge it.
Edit the configuration file located at
$EDITOR env variable.
Last but not least, all
cani commands can be piped. This will skip running
fzf and print uncolored output.
use (the output of
cani use ft-name cannot be piped)
cani use | head -3 [rc] 97.11% PNG alpha transparency +chr +ff +edge +ie +saf +saf.ios +op +and +bb [un] 75.85% Animated PNG (APNG) +chr +ff -edge -ie +saf +saf.ios +op -and -bb [ls] 94.32% Video element +chr +ff +edge +ie +saf +saf.ios +op +and +bb
cani show | head -3 ie usage: 3.1899% edge usage: 1.8262% firefox usage: 5.0480%
cani show firefox | head -3 63 usage: 0.0000% 62 usage: 0.0131% 61 usage: 0.2184%
show BROWSER VERSION
cani show firefox 63 | head -3 [rc] [+] PNG alpha transparency [un] [+] Animated PNG (APNG) [ls] [+] Video element
Bug reports and pull requests are welcome on GitHub at https://github.com/sidofc/cani. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
Special thanks to the following users and contributors:
The gem is available as open source under the terms of the MIT License.
Code of Conduct
Everyone interacting in the Cani project’s codebases, issue trackers, chat rooms and mailing lists is expected to follow the code of conduct.