Loz Project: Integrating AI with Unix Tools
Loz is an innovative command-line tool that combines the power of your chosen Language Learning Model (LLM) with the capability to execute system commands and use Unix pipes. It allows users to leverage AI features alongside conventional Unix tools, making it a unique and versatile utility for tech enthusiasts and developers alike.
Latest Updates
Version 0.3.1 - Released on March 18, 2024
- Enhanced Git Commit Logging: Git commit logs can now be stored in a dedicated
.loz_log
file within each Git repository where Loz operates. - Customizable Attribution: Users can choose to append a 'generated by ${model name}' note at the end of Git commit messages. This feature can be enabled or disabled via configuration commands (
config attribution true
orconfig attribution false
). Additionally, a runtime argument--attribution
(-a
) allows overriding the default attribution setting.
Version 0.3.0 - Released on February 24, 2024
- Run Commands with Natural Language: Users can now execute Linux commands by providing natural language instructions. For example, instructing Loz to "find the largest file in the current directory" will translate to the appropriate Linux command execution to achieve this task.
Version 0.2.13 - Released on February 22, 2024
- Improved Git Commit Formatting: Enhancements have been made to how Git commit messages are structured, ensuring they follow best practices for clarity between the title and the body.
Getting Started with Loz
To start using Loz, it can be installed globally via npm or cloned directly from the repository. Users must have NodeJS and npm installed on their system, particularly if they are using a Linux operating system.
Setting Up LLM
Loz allows users to choose between the OpenAI API and the Ollama service for LLM support, offering flexibility in how the AI interacts with system commands.
-
Using Ollama:
- Install the necessary llama2 and codellama models on your local system.
-
Using the OpenAI API:
- Setup requires an OpenAI API key to be added to the environment or configuration files, and users must ensure they do not exceed API request limits without a payment method.
Using Loz
Loz opens up a wide range of functionalities:
-
Interactive Mode: Users can engage with Loz in an interactive chat-like environment to execute or inquire about Unix commands.
-
Running Commands: With natural language processing, users can simply instruct Loz on tasks like identifying system processes or checking hardware specs.
-
Safe Mode: This mode adds a layer of security by requiring user confirmation before executing potentially harmful commands.
-
Pipe Mode: Loz can integrate with other command-line outputs using Unix pipes, allowing complex data manipulation tasks, such as counting files or checking for spelling errors in text.
Git Integration
Loz offers features to enhance Git workflow:
-
Automatic Git Commit Messages: By running
loz commit
, users can generate commit messages based on the current Git status. -
Customizable Git Hooks: It is possible to automate the inclusion of Loz-generated commit messages in your workflow for efficiency.
Accessing Chat Histories
Loz keeps detailed records of interactions within the .loz
directory in the user's home or Git repository's log directory, providing easy access to previous commands and interactions.
Contributing to Loz
The project is open for contributions, and interested developers are encouraged to submit pull requests to enhance and expand its capabilities.
Loz stands as a testament to the growing synergy between artificial intelligence and traditional command-line tools, offering versatile and powerful tooling for users looking to exploit the full potential of AI in their everyday tech environments.