Skip to content

zmsp/ask-bash

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 

Repository files navigation

ask-AI

Generate and run Bash commands using OpenAI’s GPT models.

Demo

Requirements

Install

curl -fsSL https://raw.githubusercontent.com/zmsp/ask-bash/main/ask -o /tmp/ask
chmod +x /tmp/ask
sudo mv /tmp/ask /usr/local/bin/
ask --help

Usage

Generate a bash command for a task and optionally run it:

ask your task description

Send a direct question or prompt to the API (skips “run this command” behavior with - flag):

ask -q Explain the ls command options

Set your API key by exporting OPENAI_API_KEY or let the script prompt and save it.

Options

ask --help

Env Variables

  • OPENAI_API_KEY — your OpenAI key (required). You can either:

    • Export it in your current shell:

      export OPENAI_API_KEY="your_api_key_here"
    • Or run the script once and it will prompt you to paste the key and save it securely to ~/.openai_api_key.

  • VERBOSE=true — enable debug output (optional)

License

MIT © Zobair

About

simple bash script that helps you with terminal commands with the power of chatgpt

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages