A collection of CLI tools leveraging language models
Project description
LMtoolbox
LMtoolbox is an collection of CLI tools using language models designed to modernize your workflow in the terminal. Built using OpenAI's ChatGPT, the tools in this toolbox can generate automatic commit messages, perform dictionary and thesaurus queries, translate text, proofread content, enrich language learning, and automate shell commands, among others. Obviously, you can also interact with ChatGPT directly.
Table of Contents
Prompt Templates
For those less experienced with terminal interfaces or those preferring the convenience of a web interface, the ChatGPT web interface templates in the LMtoolbox can prove incredibly useful. These templates offer a broad spectrum of pre-structured prompts designed to enhance your engagement with ChatGPT, particularly in the context of longer chat interactions with GPT-4 in order to avoid expensive API costs.
These templates, found in the prompt-templates/
directory, cater to various situations and are an excellent resource if you're uncertain about structuring prompts or seek to improve the effectiveness of your existing ones.
Installation
pip
python3 -m pip install lmtoolbox
pipx
, the Easy Way
pipx install lmtoolbox
Getting Started
Configuring your OpenAI API key
For LMtoolbox to work properly, it is necessary to acquire and configure an OpenAI API key. Follow these steps to accomplish this:
-
Acquire the OpenAI API key: You can do this by creating an account on the OpenAI website. Once registered, you will have access to your unique API key.
-
Set usage limit: Before you start using the API, you need to define a usage limit. You can configure this in your OpenAI account settings by navigating to Billing -> Usage limits.
-
Configure the OpenAI API key: Once you have your API key, you can set it up by running the
lmt key set
command.lmt key set
With these steps, you should now have successfully set up your OpenAI API key, ready for use with the LMtoolbox
Tools
Instructions on how to use each of the tools are included in the individual directories under tools/. This is also where I give some tricks and tips on their usage 💡👀💭.
Note that LMterminal (lmt
) is the main tool in the LMtoolbox. All of its options apply to (almost) all of the other tools. For instance, you change the model to GPT-4o with -m 4o
or add emojis with --emoji
. Refer to the LMterminal's documentation for more information.
-
Reading from
stdin
: Almost all of the tools can read fromstdin
. For instance:cat my_text.md | summarize
. -
Output Redirection: You can use output redirections with the tools. For instance:
cat my_text.md | critique --raw > critique_of_my_text.md
Here's a brief overview of the tools:
LMterminal (lmt
)
LMterminal (lmt
) empowers you to interact directly with ChatGPT from the comfort of your terminal. One of the core features of lmt
is its ability to facilitate the creation of custom templates, enabling you to design your personalized toolbox of CLI applications. You can easily install its standalone version from the project's repository.
ShellGenius
ShellGenius is an intuitive CLI tool designed to enhance your command-line experience by turning your task descriptions into efficient shell commands. Check out the project on its dedicated repository.
Commitgen
The commitgen
tool is designed to automatically generate a meaningful git
commit messages for your code changes.
Codereview
The codereview
tool accepts a file or a piece of text as input and provides an in-depth analysis of the code. It can identify potential issues, suggest improvements, and even detect security vulnerabilities. The Codereview tool is capable of handling a variety of programming languages, and its feedback can serve as an invaluable resource for developers seeking to enhance the quality of their code.
VocabMaster
Master new languages with VocabMaster, a CLI tool designed to help you record vocabulary, access translations and examples, and seamlessly import them into Anki for an optimized language learning experience. Check out the project on its dedicated repository.
Thesaurus
The thesaurus
tool takes a word or a phrase as input and provides a list of synonyms and antonyms.
Define
The define
tool takes a word as input and provides its definition along with an example sentence using the word.
Proofread
The proofread
tool takes a sentence as input and provides a corrected version of it, if needed, along with an explanation of the corrections.
Translate
The translate
tool takes a sentence and a target language as input and provides the translated sentence in the target language.
Cheermeup
The cheermeup
tool is designed to uplift your spirits based on your current mood. Whether you're feeling down or just need a little pick-me-up, this tool uses a variety of methods to bring a smile to your face and brighten your day.
Critique
The critique
tool is your personal constructive text critic, designed to analyze a given piece of text and provide detailed, insightful feedback. It enables users to enhance their writing by addressing potential shortcomings and improving the overall quality.
Explain
The explain
tool helps to clarify complex concepts. When given a concept, it presents a comprehensive and straightforward explanation, aiding in understanding and knowledge retention.
Lessonize
The lessonize
tool transforms any piece of text into an informative lesson. Whether you're a teacher looking for instructional material or a student looking to further understand a subject, this tool makes learning more accessible.
Life
The life
tool offers a unique perspective on the passage of time, presenting thoughtful messages based on your life expectancy statistics. Whether you're seeking a novel way to reflect on your life journey or need a gentle reminder of the beauty and preciousness of life's uncertainty, this tool provides insightful outputs to provoke meaningful contemplation.
Pathlearner
The pathlearner
tool provides a comprehensive study plan for a given topic. Whether you're studying for an exam or learning a new subject, this tool creates a structured, step-by-step plan that aids in understanding and mastering the material.
Study
The study
tool is a comprehensive guide that generates study material for a particular topic or content. It helps students to better prepare for exams, giving them access to tailored study material designed to enhance their learning experience.
Summarize
The summarize
tool provides succinct summaries of a web page, lengthy texts, a YouTube video (via URL), or the content of given files.
Teachlib
The teachlib
tool is designed to provide comprehensive lessons on various libraries. By simplifying complex aspects and focusing on the core functionalities, this tool helps users to understand and effectively utilize different libraries.
License
This project is licensed under the terms of the Apache License 2.0.
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
File details
Details for the file lmtoolbox-0.5.8.tar.gz
.
File metadata
- Download URL: lmtoolbox-0.5.8.tar.gz
- Upload date:
- Size: 20.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ab314a938e8176889dc5e3db053c92c9eaba89734251dee2dc1fc854f61a8d20 |
|
MD5 | a7fd5b0a5e1806a7c788cd09b97f49cd |
|
BLAKE2b-256 | ada472ab4b6b1d7253d3e222a37e490bbc3c694605a93abd8f756051312f3e39 |
File details
Details for the file LMtoolbox-0.5.8-py3-none-any.whl
.
File metadata
- Download URL: LMtoolbox-0.5.8-py3-none-any.whl
- Upload date:
- Size: 24.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.12.7
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1c7a10050ef4e54ee7b7f92a892503293d33039375e9b66da45d3ffc95492712 |
|
MD5 | 40ff9dd8e6ee7ea0e9550b1929b8cdea |
|
BLAKE2b-256 | dbcd1b00deecb3f22170a8bb3e1d65adc34526551fa4da65d4ec8af248e3c17e |