Skip to main content

bgpt - Bash GPT CLI Tool

A command-line tool that translates natural language commands into bash commands using OpenAI's language models.

Installation

pip install bgpt

Usage

Before using bgpt, make sure you have the OPENAI_API_KEY environment variable set with your OpenAI API key. You can also set the OPENAI_BASE_URL environment variable if you are using a custom OpenAI endpoint, and the LLM_MODEL environment variable to change the model. The default model is GPT-4.1-mini.

Example:

export OPENAI_API_KEY="sk-..."
export OPENAI_BASE_URL="https://api.openai.com/v1"
export LLM_MODEL="GPT-4.1-mini"
bgpt <natural language command>

Examples:

bgpt create a folder named my-folder
bgpt list all files in the current directory
bgpt show me the contents of my_file.txt

The tool will then:

  1. Generate a bash command based on your input.
  2. Display the generated command and ask for confirmation.
  3. Execute the command if you confirm.
  4. Show the output of the command.

Configuration

  • OPENAI_API_KEY: You must set this environment variable to your OpenAI API key.
  • OPENAI_BASE_URL: (Optional) Set this environment variable if you are using a custom OpenAI endpoint.
  • LLM_MODEL: (Optional) Set this environment variable to change the model.

Dependencies

  • Python 3.8+
  • openai Python library

License

MIT License

Contributing

Contributions are welcome! Please submit a pull request with your changes.

Code of Conduct

Please note that this project is released with a Contributor Covenant Code of Conduct. By participating in this project you agree to abide by its terms.


Note: This tool uses the OpenAI API, so usage will incur costs based on your OpenAI API billing. Please use responsibly.

Metadata

Release files for bgpt 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bgpt 0.2.0
File Size Uploaded
bgpt-0.2.0.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for bgpt 0.2.0
File Interpreter ABI Platform
bgpt-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 10.4 kB

Release files / bgpt-0.2.0.tar.gz

Download URL bgpt-0.2.0.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
58db1e90d0901983eaa88557e9dfec05a714846cf35595d3e05331f0b1e0b045
BLAKE2b-256 checksum
How to use checksums
ffdec9aa7c2a0eaf614af92eb24e0559ce876e633991a62068e7fe15838794bf
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.

Transparency log

Release files / bgpt-0.2.0-py3-none-any.whl

Download URL bgpt-0.2.0-py3-none-any.whl
Size 5.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
4161efd51a944c2be19814982b825f6bf393cfab7da6e43d9184f02d0ea33285
BLAKE2b-256 checksum
How to use checksums
a9a2f4367b4487787954e89740d3fa9e73bb1c4f251059984894225dc939d0d1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Apr 17, 2025.

Transparency log

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.1

2 release files

0.1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page