Skip to content

Latest commit

 

History

History
181 lines (119 loc) · 5.86 KB

cli-tools.md

File metadata and controls

181 lines (119 loc) · 5.86 KB

A collection of useful tools for CLI

Terminal

Alacritty

  • Config

    Alacritty looks for configuration files in:

    $XDG_CONFIG_HOME/alacritty/alacritty.toml
    $XDG_CONFIG_HOME/alacritty.toml
    $HOME/.config/alacritty/alacritty.toml # Recommended
    $HOME/.alacritty.toml

Warp

Kitty

  • Install (Linux/Mac)

    curl -L https://sw.kovidgoyal.net/kitty/installer.sh | sh /dev/stdin

    kitty will be install to

    • /Applications/kitty.app on Mac
    • ~/.local/kitty.app on Linux
  • Add icon for kitty to taskbar on Linux

    # Create symbolic links to add kitty and kitten to PATH (assuming ~/.local/bin is in your system-wide PATH)
    ln -sf ~/.local/kitty.app/bin/kitty ~/.local/kitty.app/bin/kitten ~/.local/bin/
    
    # Place the kitty.desktop file somewhere it can be found by the OS
    cp ~/.local/kitty.app/share/applications/kitty.desktop ~/.local/share/applications/
    
    # If you want to open text files and images in kitty via your file manager also add the kitty-open.desktop file
    cp ~/.local/kitty.app/share/applications/kitty-open.desktop ~/.local/share/applications/
    
    # Update the paths to the kitty and its icon in the kitty desktop file(s)
    sed -i "s|Icon=kitty|Icon=/home/$USER/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png|g" ~/.local/share/applications/kitty*.desktop
    sed -i "s|Exec=kitty|Exec=/home/$USER/.local/kitty.app/bin/kitty|g" ~/.local/share/applications/kitty*.desktop
  • Change default icon to kitty-icon dark

    # Fedora
    curl https://raw.githubusercontent.com/DinkDonk/kitty-icon/main/kitty-dark.png -o ~/.local/kitty.app/share/icons/hicolor/256x256/apps/kitty.png
    gtk-update-icon-cache -f -t ~/.local/kitty.app/share/icons/hicolor

    For more information, see Install kitty

  • Shortcuts

    Action Keyboard Shortcut
    Create a new tab Ctrl + Shift + T
    Create a new window Ctrl + Shift + Enter
    Change layout Ctrl + Shift + L
    Close window Ctrl + Shift + W
    Next window ctrl + shift + ]
    Previous window ctrl + shift + [

    For more information, see:

Shell

bash

zsh

oh-my-zsh: Framework for Zsh, comes with plugins, themes, functions, helpers

Antidote: zsh plugin manager (successor of Antibody - successor of Antigen) - Cure to slow zsh loading time

Completion, suggestions & syntax highlight for zsh

fish

Shell Plugins

argc-completions

Argc-completions: Completions for any shell. Supports 1000+ commands. Automatically generate completion definition from help text and man page.

fzf: A command-line fuzzy finder

fzf

  • Key bindings for command-line1:
    • CTRL-T - Get a list of files and directories
    • CTRL-R - Get a list of command history
    • ALT-C - Get a list of directories
  • Fuzzy Complete for files/directories2:
    • **<TAB>: COMMAND [DIRECTORY/][FUZZY_PATTERN]**<TAB>

Shell Prompt

Starship: Cross-shell Prompt

See Starship

CLI tools

File navigate

broot3: A better way to navigate directories 🌟🌟🌟

broot

broot can replace a lot of CLI tools (e.g. ls, cd, tree, df, find...)

Data process

sed, awk, grep

jq4: The original JSON processor 🌟🌟

jq clones:

  • jaq5: Rust clone
  • gojq6: Go clone

yq7: YAML (JSON, XML, CSV, TOML, ...) processor 🌟🌟

xq8: XML, HTML processor

fx9: Interactive JSON/YAML viewer & processor 🌟🌟🌟

fx

Footnotes

  1. https://github.com/junegunn/fzf?tab=readme-ov-file#key-bindings-for-command-line

  2. https://github.com/junegunn/fzf?tab=readme-ov-file#fuzzy-completion-for-bash-and-zsh

  3. https://github.com/Canop/broot

  4. https://github.com/jqlang/jq

  5. https://github.com/01mf02/jaq

  6. https://github.com/itchyny/gojq/

  7. https://github.com/mikefarah/yq

  8. https://github.com/sibprogrammer/xq

  9. https://fx.wtf/