A command line tool for quick concept lookups
Project description
LiteLookup 🔎
LiteLookup is a command-line tool developed in Python that fetches beginner-level information about any concept directly from the command line.
When working on the terminal, I often had the need for quick references about concepts or commands depending on what I'm working on. I didn't like the idea of having to juggle browser tabs and context-switch because of some beginner information. I built LiteLookup so I could access quick, concise information and accessible explanations without leaving the terminal.
Features
- Command-Line Interface (CLI): Uses
argparseto handle user inputs. - Error Handling: Validates user input to ensure meaningful queries. Catches special characters and raises appropriate errors.
- API Integration: Utilizes the Groq LLM API to generate concise explanations of the concepts provided.
- Caching: Implements Redis for persistent caching of API responses, reducing unnecessary API calls and improving response times.
- Interactive Shell Session: Launches an intractive shell for faster, continuous lookups after the initial connection establishment. This mode is ideal for making multiple queries in a single session without the overhead of reconnecting for each request.
- HTTP/2 Support: Uses
httpxwith connection pooling and HTTP/2 for efficient API communication. - Expandable: Designed to be easily extended with new features and enhancements.
Installation
Prerequisites
- Python 3.11 or higher
- Redis server installed and running
- Groq LLM API access — You will need to store a valid Groq API Key as a secret. You can generate one for free here.
Setup
-
Install LiteLookup via pip or pipx:
pip install litelookuporpipx install litelookupCheck if LiteLookup is correctly installed with
lookup --version -
Configure the environment variables:
Enter the API Key from Groq in the prompt from the first usage:
>>Enter API KEY here: your-api_key hereReplace "your_api_key_here" with the API key to begin interacting with the tool.
Select the desired model from the list of available models as shown below:
pick one of the models using the arrow keys and press enter. Press tab to move to the OK button and press enter to confirm your choice.
-
*Ensure Redis is running:
redis-cli pingYou should get
PONGwhich indicates redis is up and running.
Usage
Basic Usage
To fetch information about a concept, use the following command:
lookup "concept"
For example, lookup "git rebase"
For queries with special characters (such as '&', '|', '', etc), please make sure to wrap your queries in quotes. Otherwise, the shell may interprete these characters.
Programming Mode
lookup "programming concept" -p
For example, lookup "print() in python" -p
Interactive Shell Mode
Enter the interactive mode for continuous lookups without reconnecting:
lookup -i
If you wish to generate verbose responses while in the interactive mode, use
-
lookup -i -por `lookup -ip The responses you get with this will be more finetuned for programming. -
lookup -i -dorlookup -idThis combines interactive mode with direct mode for quick, concise command-related answers.
To exit the interactive mode, type:
quitorq
Direct Mode
Get concise, direct answers for command-related queries:
lookup -d "command to ..."orlookup --direct "how to ..."
For example, lookup -d "command to delete a file in Linux" or lookup -d "how to rollback a commit in Git"
This mode provides brief, actionable responses without additional explanations. For best results, start your query with "command to" or "how to".
Conversational or Chat Mode
Get conversational with the tool! LiteLookup offers a chat feature that allows you to go back and forth with it on an idea. To toggle this mode, use:
lookup -ic
Now you have a terminal buddy to brainstorm with.
Flags
- -p or --programming: Programming-focused responses
- -d or --direct: Concise, command-related answers
- -i or --interactive: Interactive shell mode
- -ic or --interactive --chat: conversational mode
Contributing
If you'd like to contribute to LiteLookup, please fork the repository and submit a pull request. For any issues or suggestions, feel free to open an issue on the GitHub repository.
Contact
For any questions or support, please contact Abdulmumin at [lanreywaju97@gmail.com]
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file litelookup-0.20.0.tar.gz.
File metadata
- Download URL: litelookup-0.20.0.tar.gz
- Upload date:
- Size: 13.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d71d0dd2c473ed790d815b58b37cf1a6a86386e9bd9d0c3b6fc40f52dfd26356
|
|
| MD5 |
d320611c5488a4cfce8e14a037104e97
|
|
| BLAKE2b-256 |
788be55886648e89302a87c9cf74dc181bb581e8a620699a53bac71180284615
|
Provenance
The following attestation bundles were made for litelookup-0.20.0.tar.gz:
Publisher:
release.yml on Lanrey-waju/lite-lookup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litelookup-0.20.0.tar.gz -
Subject digest:
d71d0dd2c473ed790d815b58b37cf1a6a86386e9bd9d0c3b6fc40f52dfd26356 - Sigstore transparency entry: 201312542
- Sigstore integration time:
-
Permalink:
Lanrey-waju/lite-lookup@affece6de6230b70508e329141f885e7047a13eb -
Branch / Tag:
refs/tags/0.20.0 - Owner: https://github.com/Lanrey-waju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@affece6de6230b70508e329141f885e7047a13eb -
Trigger Event:
push
-
Statement type:
File details
Details for the file litelookup-0.20.0-py3-none-any.whl.
File metadata
- Download URL: litelookup-0.20.0-py3-none-any.whl
- Upload date:
- Size: 11.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.12.9
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a909d7034622d0cc17bd0353889d8aceb5c11115cca1a24dc7708d0f36a6327
|
|
| MD5 |
67c5d2df246d1654f1ae4dccae6826a1
|
|
| BLAKE2b-256 |
552c5f2d51d0362d8de586b938de2bfdc66db9abbeaebf34c5f813d1fdc8ea42
|
Provenance
The following attestation bundles were made for litelookup-0.20.0-py3-none-any.whl:
Publisher:
release.yml on Lanrey-waju/lite-lookup
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
litelookup-0.20.0-py3-none-any.whl -
Subject digest:
4a909d7034622d0cc17bd0353889d8aceb5c11115cca1a24dc7708d0f36a6327 - Sigstore transparency entry: 201312547
- Sigstore integration time:
-
Permalink:
Lanrey-waju/lite-lookup@affece6de6230b70508e329141f885e7047a13eb -
Branch / Tag:
refs/tags/0.20.0 - Owner: https://github.com/Lanrey-waju
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@affece6de6230b70508e329141f885e7047a13eb -
Trigger Event:
push
-
Statement type: