Skip to main content

Ask your llm from the command line

Project description

lask

A CLI tool to interact with OpenAI's ChatGPT and other LLMs directly from your terminal.

Usage

Ensure you have OPENAI_API_KEY in your environment variables, then you can use lask to send prompts to the LLM.

lask What movie is this quote from\? \"that still only counts as one\"

Features

  • Simple command-line interface to send prompts to GPT-4.1, or other LLMs
  • Minimal dependencies (only requires the requests library)
  • Easy installation via pip
  • Direct output to your terminal

Installation

Using pip (recommended)

pip install lask

(For dev, do pip install .)

For a user-specific installation:

pip install --user lask

From source

  1. Clone the repository:

    git clone https://github.com/Open-Source-Lodge/lask.git
    
  2. Navigate to the directory:

    cd lask
    
  3. Install the package:

    pip install -e .
    

Setup

Before using lask, you need to set up your OpenAI API key:

  1. Get an API key from OpenAI

  2. Set the environment variable:

    Linux/macOS:

    export OPENAI_API_KEY='your-api-key-here'
    

    To make it permanent, add the above line to your ~/.bashrc, ~/.zshrc, or equivalent shell configuration file.

    Windows (Command Prompt):

    set OPENAI_API_KEY=your-api-key-here
    

    Windows (PowerShell):

    $env:OPENAI_API_KEY='your-api-key-here'
    

API Key Issues

If you see an error about the API key:

  1. Double-check that you've correctly set the OPENAI_API_KEY environment variable
  2. Verify your API key is valid and has enough credits

Developing

Build

To build the package, run:

uv build

Install for development

To install the package in development mode, run:

pip install dist/lask-0.1.0-py3-none-any.whl

License

GNU General Public License v3.0 (GPL-3.0)

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

lask-0.1.5.tar.gz (15.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

lask-0.1.5-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

Details for the file lask-0.1.5.tar.gz.

File metadata

  • Download URL: lask-0.1.5.tar.gz
  • Upload date:
  • Size: 15.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lask-0.1.5.tar.gz
Algorithm Hash digest
SHA256 60c78e3543e389924f718b108a4fb55104130b240c12f9853890b900bf92b04a
MD5 1456e1cf6a8a9427b50e6ca86a8585de
BLAKE2b-256 afc173bcf62aa3970a264041bcf860b4f121e1ab271ddece427eb83ce5a73e06

See more details on using hashes here.

Provenance

The following attestation bundles were made for lask-0.1.5.tar.gz:

Publisher: pypipublish.yml on Open-Source-Lodge/lask

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file lask-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: lask-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 15.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.12.9

File hashes

Hashes for lask-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 bbe2b65dd50044a3c4ea2856852c4b2c300d8eb72b23c6619f06d64edc0b4793
MD5 e913ccbad9d21117f457bcb742d4fa4e
BLAKE2b-256 1995d4b7f1c277e83365f404c30233380a5c47471230dbac17f7ed8dd9209c74

See more details on using hashes here.

Provenance

The following attestation bundles were made for lask-0.1.5-py3-none-any.whl:

Publisher: pypipublish.yml on Open-Source-Lodge/lask

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page