Lanno is a command-line tool designed to enhance code organization and documentation by providing annotations for files, akin to using the ls
command but with additional metadata.
While tools like Copilot are great for auto-completing code, they often fall short in organizing code structure. Lanno simplifies this process by offering a more straightforward solution. It aims to streamline end-to-end project training by providing comprehensive information about each file.
- Improved Code Structure: Lanno helps maintain a clean and well-documented codebase by allowing you to annotate files with tags and descriptions, making it easier to understand the role of each file at a glance.
- Ease of Collaboration: Sharing projects with colleagues or friends can be cumbersome when they're unfamiliar with the purpose of each file. Lanno allows users to document file usage efficiently, eliminating the need to painstakingly explain each file's function individually.
- Enhanced Documentation: Sometimes, writing detailed documentation for every file is time-consuming. Lanno provides a quick way to add relevant information directly to the files, making it accessible and less likely to be overlooked.
brew install anyin233/useful-tools/lanno
or
brew tap anyin233/useful-tools
brew install lanno
-
Download the latest release from GitHub Releases:
# For macOS ARM (Apple Silicon) wget https://github.com/Chivier/lanno/releases/latest/download/lanno_MacOS_Arm # For x86_64 systems wget https://github.com/Chivier/lanno/releases/latest/download/lanno_x86_64
-
Make the binary executable and move it to your local bin directory:
# For macOS ARM (Apple Silicon) chmod +x lanno_MacOS_Arm mv lanno_MacOS_Arm ~/.local/bin/lanno # For x86_64 systems chmod +x lanno_x86_64 mv lanno_x86_64 ~/.local/bin/lanno
-
Ensure
~/.local/bin
is in your PATH. If not, add the following to your shell profile (.bashrc
,.zshrc
, etc.):export PATH="$HOME/.local/bin:$PATH"
-
Restart your terminal or run
source ~/.bashrc
(or equivalent) to apply changes. -
Verify the installation:
lanno --version
To view annotations for files, simply run:
lanno
This command will list all files in the directory along with their associated annotations.
You can add or remove tags for a file using the following command format:
lanno file +tag1 +tag2 -tag3
+tag
: Adds a tag to the file.-tag
: Removes a tag from the file.
To add a description to a file, use the following command format:
lanno file "This is a description"
This will attach the provided description to the specified file.
-
View Annotations:
lanno
This will display a list of files with their annotations.
-
Add Tags to a File:
lanno example.py +script +utility
This will add the tags
script
andutility
toexample.py
. -
Remove a Tag from a File:
lanno example.py -utility
This will remove the tag
utility
fromexample.py
. -
Add a Description to a File:
lanno example.py This script processes data.
This will add the description "This script processes data." to
example.py
.
By using Lanno, you can ensure your projects are well-documented and easily understandable by anyone who accesses your code. Happy coding!
- Tag files with custom labels
- Add descriptions to files
- Interactive file browser with search capabilities
- Command-line interface for quick tagging
- Vim-style navigation and paging
lanno <file> <command>
Commands:
+<tag>
- Add a tag to a file-<tag>
- Remove a tag from a file<description>
- Set description for a file (use empty string to remove)
Examples:
lanno document.txt +work # Add #work tag to document.txt
lanno document.txt -work # Remove #work tag from document.txt
lanno document.txt "Important work document" # Set description
lanno document.txt +urgent "Important work document" # Add tag and description
lanno document.txt "" # Remove description
Launch the interactive file browser:
lanno
Navigation:
- Arrow keys to navigate files
h
andl
for page navigationgg
to jump to the first pageG
to jump to the last page/
to search filesctrl+e
to edit selected file's tags or descriptionf5
orr
to refresh the file listq
orctrl+c
to quit
When editing (after pressing ctrl+e
):
- Type commands like
+tag
to add tags - Type
-tag
to remove tags - Type any text without
+
or-
prefix to set description - Press Enter to submit
- Press Esc to cancel
Lanno stores file metadata in a .lanno.json
file in the current directory.