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/yourusername/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.2.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.2-py3-none-any.whl (15.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: lask-0.1.2.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.2.tar.gz
Algorithm Hash digest
SHA256 0d39a92078cbaa60329b67a3f8a5457ab2c958a54776b27b0e0e96d490933483
MD5 2d071ad62d80ec1f0629aeb2dce40901
BLAKE2b-256 b95b7d691344bf4775eeb69327f4b1c8a2300cfd75e40b59f70bb0e5ef57b9d4

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: lask-0.1.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 3d86d71402112fe33d22f581094419049837defe4155d24fd7af3efc6d225c85
MD5 992c22ccb9db8c7a07789453ed6e139b
BLAKE2b-256 d393b2aa4b5019fac8e8a2d1766e48719ef24026e0cabb354e1a6d88c105cca7

See more details on using hashes here.

Provenance

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