Skip to content

bleugreen/lc-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lc - Natural Language to Fish Shell Command Converter

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.

Features

  • 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

Installation

Build from source

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

Usage

# 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

Configuration

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"

Examples

  • lc find large files and show their sizesfind . -type f -size +10M -exec du -h {} \;
  • lc create a compressed backup of the logstar czvf logs_backup.tar.gz /var/log
  • lc find all png images and convert to jpgfind . -name "*.png" -exec convert {} {}.jpg \;

License

MIT

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages