🤖 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 / directory"
# or
mam rm --iwant "Delete all files under the / directory"
--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
--chat, -c
Enter continuous conversation mode for multi-turn chat.
mam --chat
# or
mam -c
--help, -h
Display help information.
mam --help
# or
mam -h
Roadmap
- Add
-q, --query options to query the LLM about program documentation.
- Add cache functionality for
mam <command>.
- Add
-o, --output options to redirect output to a file.
License
MIT