pls is a lightweight CLI tool that converts natural language into shell commands using local Large Language Models via Ollama. Heavily inspired by uwu (which now support custom providers, which make this 2 repo too similar but oh well). Unlike cloud-based alternatives, pls runs entirely on your machine, ensuring privacy and offline functionality. It supports multiple shell types.
pls find all log files larger than 10MB
# ↓ generates and suggests:
find . -name "*.log" -size +10MAfter a response is generated, you can edit it before pressing enter to execute the command. The command is automatically added to your shell history for easy retrieval.
- 🔒 Privacy-first: Uses local Ollama models, no data sent to external services
- 🐚 Multi-shell support: Works with Fish, Bash, and Zsh
- ⚙️ Highly configurable: Custom models, prompts, and settings
- 🎯 Shell-aware: Generates commands appropriate for your specific shell
- 📝 History integration: Commands are automatically added to shell history
- 🎨 Live streaming: Real-time command generation with animated feedback
- 📋 Safe execution: Review and edit commands before execution
- Ollama: Install from ollama.ai
- A code model: Download a suitable model (e.g.,
ollama pull gemma3:4b) - jq: JSON processor (
sudo pacman -S jqon Arch Linux)
git clone https://github.com/GaelicThunder/pls.git
cd pls
chmod +x install.sh
./install.sh-
Clone the repository:
git clone https://github.com/GaelicThunder/pls.git cd pls -
Install the engine:
sudo cp bin/pls-engine /usr/local/bin/ sudo chmod +x /usr/local/bin/pls-engine
-
Set up shell integration:
For Fish (add to
~/.config/fish/config.fish):cat shell-integrations/fish.fish >> ~/.config/fish/config.fish
For Bash (add to
~/.bashrc):cat shell-integrations/bash.sh >> ~/.bashrc
For Zsh (add to
~/.zshrc):cat shell-integrations/zsh.sh >> ~/.zshrc
-
Reload your shell configuration:
# Fish source ~/.config/fish/config.fish # Bash source ~/.bashrc # Zsh source ~/.zshrc
Once installed and configured:
pls compress all jpg files in this directory into a zip archive
# ↓ Streams and generates:
zip images.zip *.jpg
pls show me disk usage sorted by size
# ↓ Generates:
du -h | sort -hr
pls kill all python processes
# ↓ Generates:
pkill pythonYou'll see the generated command appear in your shell's input line with a streaming animation. Press Enter to run it, edit it first, or Ctrl+C to cancel. All suggested commands are automatically added to your shell history.
The first time you run pls, it creates a configuration file at ~/.config/pls/config.json.
{
"model": "gemma3:4b",
"ollama_url": "http://localhost:11434",
"temperature": 0.1,
"stream": true,
"max_tokens": 100,
"system_prompt": "You are a helpful shell command generator. Generate only the command, no explanations.",
"shell_specific_prompts": {
"fish": "Generate Fish shell commands. Use Fish-specific syntax when appropriate.",
"bash": "Generate Bash shell commands. Use standard POSIX syntax.",
"zsh": "Generate Zsh shell commands. You can use Zsh-specific features."
}
}See docs/configuration.md for detailed configuration options.
pls automatically detects your shell and generates appropriate commands:
- Fish: Uses Fish-specific syntax for variables, functions, and conditionals
- Bash: Standard POSIX-compliant commands
- Zsh: Can leverage Zsh-specific features and expansions
Any Ollama model that can generate code works well. Recommended models:
gemma3:4b- Faster and best, actually the default modelcodellama:13b- Best balance of speed and accuracycodegemma:7b- Faster, good for basic commandsdeepseek-coder:6.7b- Excellent for complex shell scriptingllama3.1:8b- General purpose, works well for commands
Contributions are welcome! Please feel free to submit a Pull Request.
MIT License - see LICENSE file for details.
- "jq not found": Install jq with your package manager
- "Connection refused": Make sure Ollama is running (
ollama serve) - "Model not found": Pull the model first (
ollama pull gemma3:4b) - Slow responses: Try a smaller model like
gemma3:4b
Run with debug output:
pls --debug your command here- uwu - Uses OpenAI GPT models
- shell_gpt - Another AI shell assistant
- butterfish - CLI tools for LLMs
Made with ❤️ for the terminal enthusiasts
