Skip to content

michalswi/aicli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

AI CLI - ChatGPT terminal interface

go-based terminal application for interacting with OpenAI's ChatGPT API

Features

  • 💬 Interactive chat with ChatGPT in your terminal
  • 🚀 One-shot mode: ask questions directly from command line in your terminal

Prerequisites

  • Go 1.25 or higher
  • OpenAI API key

Setup

Set your OpenAI API key as an environment variable:

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

To make this permanent, add it to your ~/.zshrc or ~/.bashrc:

export OPENAI_API_KEY="your-api-key-here"
alias aicli='PATH_TO_BINARY/aicli'

Usage

Build

$ make

Usage:
  make <target>

Targets:
  build-mac        Build for mac
  build-linux      Build for linux

Help

aicli --help

One-shot Mode (command-line)

Ask a question directly from the command line:

$ aicli what day is today
⏳ Waiting for ChatGPT...
--------------------------------------------------
Today is Tuesday, February 10, 2026.
--------------------------------------------------
⏱️  Response time: 12.87s | 🪙 Tokens: 97 in, 533 out, 630 total

$ aicli "what's the capital of Poland? short"
⏳ Waiting for ChatGPT...
--------------------------------------------------
Warsaw.
--------------------------------------------------
⏱️  Response time: 2.91s | 🪙 Tokens: 101 in, 76 out, 177 total

Important: For queries with special characters or apostrophes, use quotes:

aicli "what's the capital of poland?"
aicli "how does DNS work?"

Interactive Mode

Run the application without arguments to enter interactive mode:

$ aicli
Welcome to AI CLI - chatGPT terminal interface
Type 'h' for help, 'q' to quit
--------------------------------------------------

[09:01:48] aicli> what's the capital of Poland? short
⏳ Waiting for ChatGPT...

Warsaw.
--------------------------------------------------
⏱️  Response time: 1.90s | 🪙 Tokens: 101 in, 12 out, 113 total

[09:02:10] aicli> q
👋 Exiting. Goodbye!

About

terminal based app for interacting with OpenAI's ChatGPT API

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors