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.6.tar.gz (15.2 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.6-py3-none-any.whl (15.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lask-0.1.6.tar.gz
  • Upload date:
  • Size: 15.2 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.6.tar.gz
Algorithm Hash digest
SHA256 1ddd2fdc0cd00a655596d3aa29bd4cce298f96b2307bc22dab3e0349445608ce
MD5 d109ca5da0e99245c508b4d88a1c16c9
BLAKE2b-256 2e7c657f7611022a2852431168ff96c30a75fc857d93c21015baf5552fcb8736

See more details on using hashes here.

Provenance

The following attestation bundles were made for lask-0.1.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: lask-0.1.6-py3-none-any.whl
  • Upload date:
  • Size: 15.4 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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 9ff1edda1d383efab831ef70a53ff3fd4d693355f57caf6cf33d34a2d9136f8f
MD5 4e55ac0a74b68b838943a373252f9eb3
BLAKE2b-256 89d5d0ed1c9ef570e962b270de94fe7d94436966f01303c3d0c53cd64237bea9

See more details on using hashes here.

Provenance

The following attestation bundles were made for lask-0.1.6-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