Git Product home page Git Product logo

cli_llm's Introduction

cli_llm

A little tool to use Large Language Models in the cli.

idk how to use Linux sometimes and this is useful :)

Usage:

hugo@hugo-fw:~$ llm how to cat only the last 20 lines of a file?
You can use the `tail` command to display the last lines of a file. To see only the last 20 lines of a file, you can run the following command:

tail -n 20 filename

Replace `filename` with the actual name of the file you want to view. This command will display the last 20 lines of the file on the terminal.
hugo@hugo-fw:~$ 

Installation

  1. Clone the repository:

    git clone https://github.com/yourusername/cli_llm.git
    cd cli_llm
  2. Create and activate a virtual environment:

    python3 -m venv venv
    source venv/bin/activate
  3. Install the required packages:

    pip install -r requirements.txt
  4. Set up your OpenAI API key:

    • Create a .env file in the project root:
      touch .env
    • Add your OpenAI API key to the .env file:
      OPENAI_API_KEY=your_api_key_here
      
  5. Add the following function to your ~/.bashrc file:

    llm() {
        source ~/path/to/cli_llm/venv/bin/activate
        python ~/path/to/cli_llm/cli_llm.py "$@"
        deactivate
    }

    Replace ~/path/to/cli_llm with the actual path where you cloned the repository.

  6. Reload your .bashrc:

    source ~/.bashrc

Now you can use the llm command from anywhere in your terminal!

cli_llm's People

Contributors

hugo0 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.