lc
is a command-line tool that converts natural language descriptions into executable fish shell commands. It leverages language models to translate your instructions into properly-formatted shell commands.
- Convert natural language to fish shell commands
- Support for multiple LLM backends:
- OpenAI (GPT models)
- Anthropic (Claude models)
- Ollama (local models)
- Simple, intuitive interface
- Configurable settings
git clone https://github.com/yourusername/lc-cli.git
cd lc-cli
cargo build --release
Then, copy the binary to a location in your PATH:
cp target/release/lc-cli ~/.local/bin/lc
# First time setup
lc --init
# Configuration options
lc --set-openai-key "sk-your-api-key-here"
lc --set-openai-model "gpt-4o"
lc --set-anthropic-key "sk-ant-your-api-key-here"
lc --set-anthropic-model "claude-3-opus-20240229"
lc --set-default-provider "openai"
lc --set-ollama-endpoint "http://localhost:11434"
lc --set-ollama-model "llama3"
# Basic usage
lc find all files modified in the last week
# Use dry run mode to see the command without executing it
lc -n copy all text files to backup folder with progress
# Specify a different provider
lc -p ollama find all large video files
# Show configuration file path
lc --config-path
# Show the current configuration
lc --show-config
# Force reload the configuration (after editing)
lc --reload-config
# Enable debug output
lc -d find all png files
On first run, lc
will create a configuration file at ~/.config/lc-cli/config.toml
. Edit this file to configure your API keys and model preferences:
default_provider = "openai"
[providers.openai]
api_key = "your-api-key-here"
model = "gpt-3.5-turbo"
[providers.anthropic]
api_key = "your-api-key-here"
model = "claude-3-opus-20240229"
[providers.ollama]
endpoint = "http://localhost:11434"
model = "llama3"
lc find large files and show their sizes
→find . -type f -size +10M -exec du -h {} \;
lc create a compressed backup of the logs
→tar czvf logs_backup.tar.gz /var/log
lc find all png images and convert to jpg
→find . -name "*.png" -exec convert {} {}.jpg \;
MIT