Skip to content

cjccjj/pls

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pls: Lightweight AI CLI Tool

Stop switching contexts. Many AI CLI tools are heavy, Node.js-based, and trap you in their interface. They might go back and forth just to run a simple ls, cutting off real access to your command line.

pls is different: lightweight, fast, and built for everyday CLI tasks, keeping you fully in the command line while letting you seamlessly switch between AI and shell commands.

Examples of seamlessly switching between AI and shell commands

  • You are working on a file, and use pls to help process it:
image
  • You cat the result, are happy with it, and move on something else
  • You logout ... and login back
  • Then you cd to another working folder where you want to continue the task,
  • By simple type pls, the AI picks up the task, and through interative chats you provide new input:
image
  • The AI generated shell commands for you to run,
  • And you decided to further tweek the commands,
  • Finally, the command runs successfully.

Tips for using pls

  • Use cat, tail, or any command pipe to feed data into pls.
  • You can also feed "knowhow" like my_app --help | pls learn it
  • Or generate data for your app pls generate some markdown demo | python my_markdown_render.py
  • Give orders in chat mode, refine your request as many times until satisfied.
  • Quit chat at any time to run any command you want, and pick it up again anywhere, anytime, by typing pls.
  • Use AI for its flexibility to handle anything; for simple commands, run them yourself for efficiency.
  • For short context, let AI do it directly; for large datasets, ask AI to generate commands or scripts for you to run.
  • If not satisfied with anything, simply provide your feedback.
  • You can apply the workflow to tasks like system administration, config file tweaking, log analysis, and script writing and testing.
  • It will make your command-line work easier and more fun, while still keeping the traditional command-line style and feel.

Key Capabilities

  • Generate chat messages and shell commands in a single request, it never “thinks twice.”
  • Switch effortlessly between interactive mode and command mode with shared memory.
  • Keep a short-term history, allowing you to pick up anytime without session management.
  • Run as a single Bash script, with no extra tools or MCP needed, consumes very few tokens.
  • (Experimental) Configure via chat: update yourself, edit config, delete chat history.

Features

  • AI chat and shell command generation
  • Inline command regeneration and editing
  • Supports pipes and command chaining, clean output in piped mode
  • Works on Linux and macOS
  • Compatible with OpenAI API and Gemini API

Usage

pls v0.56

Usage:    pls [messages...]                       # Chat with an input
          > what is llm                           # Continue chat, q or empty input to quit
                                                
Examples: pls                                     # Start without input 
          pls count files                         # ls -1 | wc -l           # shell cmd wait for run
          > include subdirs                       # find . -type f | wc -l  # shell cmd update

Pipe and Chain:          
          echo how to cook rice | pls             # Use input from pipe
          echo rice | pls how to cook             # Args + pipe (task from args, data from pipe)
          pls name a dish | pls -p how to cook    # Chain commands and show piped input with -p

Settings: pls -h                                  # Show this help
          pls edit config                         # config pls and AI model via chat

To install

  • install jq if not installed already
  • run the follow script to install or update
curl -sSL https://raw.githubusercontent.com/cjccjj/pls/main/install.sh | bash
  • Export OPENAI_API_KEY or GEMINI_API_KEY in your shell config
  • Optional: install glow for prettier markdown output in chat

To config

  • To config and choose AI profile say edit config to pls or nano ~/.pls/pls.conf

To update

  • Say update yourself or use install script

to uninstall

  • run
sudo rm /usr/local/bin/pls # remove the bin
rm -rf ~/.pls # remove config file and chat history

About

pls - AI powered cli helper

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages