bnlin

command module
v0.0.0-...-047f94a Latest Latest
Warning

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

Go to latest
Published: Aug 25, 2024 License: MIT Imports: 23 Imported by: 0

README

bnlin - AI-Powered Bash Script Generator

bnlin (short of Bagaking Nature Language bINary), is an innovative command-line tool that leverages AI to automatically generate and execute bash scripts based on natural language input. It seamlessly translates user requests into precise bash commands, making complex system operations accessible to users of all skill levels.

Features

  • Natural Language Processing: Convert plain English instructions into executable bash scripts.
  • Cross-Platform Compatibility: Supports Windows, Linux, and MacOS.
  • Flexible Configuration: Set up via command-line flags or environment variables.
  • Intelligent OS Detection: Adapts commands to the specific operating system environment.
  • Real-time Execution: Generates and runs scripts on-the-fly.
  • User-Friendly Output: Provides clear, formatted results for easy understanding.

Installation

To install bnlin, ensure you have Go installed, then run:

go install github.com/bagaking/bnlin@latest

Usage

The basic syntax for using bnlin is:

bnlin run <your command in natural language>
Examples
  1. List uncommitted files and their line counts:
   bnlin run find all uncommitted files and list their line counts
  1. View folders in the parent directory:
   bnlin run "show me all folders in the parent directory"
Configuration

driver can be configured using command-line flags

bnlin run --driver doubao <your command in natural language>

by default, the driver is doubao, therefor the following command is equivalent to the previous one

bnlin run <your command in natural language>
Ollama

when using the ollama driver, endpoint is required, it stands for the model to use, for example, it can be llama3.1

you can configure the endpoitn using command-line flags:

bnlin run --driver ollama -e llama3.1 "your command here"
Doubao

bnlin can be configured using command-line flags or environment variables:

  • Access Key:

    • Flag: -ak or --access_key
    • Env: VOLC_ACCESS_KEY
  • Secret Key:

    • Flag: -sk or --secret_key
    • Env: VOLC_SECRET_KEY
  • API Endpoint:

    • Flag: -e or --endpoint
    • Env: DOUBAO_ENDPOINT

Example with flags:

bnlin run -ak your_access_key -sk your_secret_key -e your_endpoint "your command here"

For more detailed information and advanced usage, run:

bnlin --help

License

This project is licensed under the MIT License.

Acknowledgements

bnlin is built with the following excellent libraries:

Support

If you encounter any issues or have questions, please open an issue on our GitHub repository.

Documentation

Overview

Package main provides a command-line tool for generating commit comments based on diff information.

Jump to

Keyboard shortcuts

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