Skip to content

Lexy is a lightweight CLI tool that fetches programming tutorials from "Learn X in Y Minutes" directly into your terminal. Quickly search, learn, and reference code examples without leaving your workflow.

License

Notifications You must be signed in to change notification settings

antoniorodr/lexy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

32 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
lexy

Β 

Github top language Github language count Repository size License Github issues Github forks Github stars

🚧 lexy πŸš€ Under developing... 🚧


About Β  | Β  Demo Β  | Β  Features Β  | Β  Technologies Β  | Β  Requirements Β  | Β  Installation Β  | Β  Documentation Β  | Β  License


🎯 About

Lexy is a lightweight CLI tool that fetches programming tutorials from Learn X in Y Minutes directly into your terminal. Quickly search, learn, and reference code examples without leaving your workflow.

Lexy saves a local copy of the documentation, so you can access it even when you're offline. It also provides syntax highlighting using bat and fuzzy search using fzf.

This project would not be possible without the amazing work of the Learn X in Y Minutes community. A huge thanks to all contributors for making high-quality learning resources freely available!

πŸ’» Demo

asciicast

✨ Features

βœ”οΈ Check documentation from "Learn X in Y minutes" directly from the terminal
βœ”οΈ Syntax highlighting using bat
βœ”οΈ Local copy to speed up the process and avoid too many requests to the "Learn X in Y minutes" server
βœ”οΈ Auto-update every 60 days
βœ”οΈ Searching powered by fzf

πŸš€ Technologies

The following tools were used in this project:

βœ… Requirements

Before starting 🏁, you need to have bat and fzf installed.

Important for Linux users

When installing bat via apt, the executable may be installed as batcat instead of bat. In this case, you should follow these steps to create the necessary symlink to make lexy work properly. Note: creating an alias will not work, as aliases are not visible to subprocesses started by Python.

🏁 Installation

Manual Installation

git clone https://github.com/antoniorodr/lexy

cd lexy

pip install .

Homebrew Installation

brew tap antoniorodr/lexy
brew install antoniorodr/lexy/lexy

AUR Installation

yay -S lexy

Installation using uv

uv tool install git+https://github.com/antoniorodr/lexy

πŸ“‘ Documentation

First, make sure you have bat and fzf installed. Lexy requires it for syntax highlighting and searching.

You can use the command lexy --help to see all available options.

lexy --help
Usage: lexy [OPTIONS] <LANGUAGE>

  Display <LANGUAGE> documentation using bat.

  <LANGUAGE> refers to the language name or the following options:

  - Use "list" to view all available languages.

  - Use "update" to force update Lexy.

  - Use "modified" to view the last modified date of Lexy.

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Lexy keeps a local copy of the documentation in $HOME/.config/lexy, which is created automatically the first time you run Lexy, and it will be updated every 60 days. You can force an update using "update" as <LANGUAGE>.

You can find the full documentation here.

🎨 Theming in Lexy (from v0.4.2)

Starting from Lexy v0.4.2, you can customize the appearance of the fzf interface used in the lexy list command.

By default, Lexy applies a color palette inspired by Catppuccin Mocha, but you can override it by creating a config.toml file in your Lexy config directory:

If you want to modify syntax highlighting for file previews powered by bat, refer to the bat documentation.


πŸ›  Default Configuration
[fzf]
preview_percent = "60"
input_label = " Input "
border_label = " Enter: Open with bat β”‚ Ctrl-D/U: scroll preview "

[colors]
border = "#aaaaaa"
label = "#cccccc"
preview_border = "#9999cc"
preview_label = "#ccccff"
list_border = "#669966"
list_label = "#99cc99"
input_border = "#996666"
input_label = "#ffcccc"
header_border = "#6699cc"
  • preview_percent changes the size of the file preview window
  • input_label changes the text of the input label
  • border_label changes the text of the top of the window

Lexy, with redimensioned preview window

Lexy, with another theme

Below is the configuration used in the second screenshot:

[colors]
border = "#ff0000"         # Red
label = "#00ff00"          # Green
preview_border = "#0000ff" # Blue
preview_label = "#ffff00"  # Yellow
list_border = "#ff00ff"    # Magenta
list_label = "#00ffff"     # Cyan
input_border = "#ffa500"   # Orange
input_label = "#800080"    # Lila
header_border = "#008000"  # Dark green

You can include only the parameters you'd like to override, Lexy will fall back to defaults for the rest.

πŸ“ License

This project is under license from MIT. For more details, see the LICENSE file.

πŸ‘€ Do you like my work?

Buy Me A Coffee

Made with ❀️ by Antonio Rodriguez

Β 

Back to top


About

Lexy is a lightweight CLI tool that fetches programming tutorials from "Learn X in Y Minutes" directly into your terminal. Quickly search, learn, and reference code examples without leaving your workflow.

Topics

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Contributors 5

Languages