ask-ai

module
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 12, 2024 License: Apache-2.0

README

ask-ai

Description

The utility everyone has written for themselves, a basic CLI tool for asking LLMs questions without bothering with a mouse.

Full disclosure: this is my first Go project. I mainly write in Ruby, C and Python.

Installation

Just build the program and run it:

$ go mod tidy
$ go build ask-ai.go

Or, as I'm doing now (bc I'm old):

$ make build

Usage

Set the API Key
  1. Set {OPENAI,ANTHROPIC}_API_KEY in your environment; or
  2. Put the key in a file located at $HOME/.config/ask-ai/{openai,anthropic,google}-api-key
Ask a model a question
$ bin/ask-ai "What is the best chess opening for a beginner?"
  • If no query is provided, ask-ai will prompt for one:
$ bin/ask-ai
> What is the best chess opening for a checkers player?
  • You can provide a model with --model <model>:
$ bin/ask-ai --model gemini "Why do you pull in so many modules for th Go API?"
[NOTE]

This is a work in progress and not all functionality has been added.

I also plan to provide a flag for context - that is, use the last n queries to send to the LLM for context.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL