🤖 Man-Machine
中文
Man-Machine is a command-line tool that uses LLM to help users read documentation for command-line programs easily.
Features
- Let LLM read command manuals for you.
- Let LLM generate commands according to your needs.
Installation
Download the prebuilt binary from the Releases page and add it to your PATH environment variable.
Initialization
mam setup # Create and open the configuration file(~/.config/mam/config.yaml)
Complete the setup in config.yaml. Currently only services compatible with the OpenAI API protocol are supported.
# config.yaml template
# API Key - Replace with your API key from the provider
apiKey: <YOUR_API_KEY_HERE>
# API Base URL - Fill in with your API service address
# If using OpenAI official API, use https://api.openai.com/v1
# For third-party API services, enter the complete base URL
baseURL: <YOUR_BASE_URL_HERE>
# Model Name - Specify which LLM model to use
model: <YOUR_MODEL_HERE>
# Language Setting - Specify which language the AI should use for responses
language: <LANGUAGE_HERE>
Usage
Basic usage:
mam mam # Get the usage of mam
Options
--iwant, -i
Generate commands according to your needs.
mam rm -i "Delete all files under the / dirctory"
# or
mam rm --iwant "Delete all files under the / dirctory"
--bare, -b
Execute the provided command literally to fetch help documentation, bypassing mam's internal attempts.
In the following example, the output of go help build is directly provided to the LLM.
mam -b go help build
# or
mam --bare go help build
--help, -h
Get help document for mam.
mam --help
# or
mam -h
Roadmap
- add
-q, --query options, query the LLM about program documentation.
- Add
-l, --level options to customize the level of detail in the output.
- Cache functionality for
mam <command>
Add -o, --output options, redirect output to a file.
License
MIT