felko / sluggo

Smart shell that can handle mutliple REPLs

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

sluggo

sluggo is a shell that can handle multiple REPLs.

It provides a few REPLs implementations, including a git REPL, a Python REPL, and a general command REPL.

Demo

asciicast

Features

sluggo features a few basic commands that allow you to switch between REPLs:

  • !go [repl]: switch to the specified REPL
  • @[repl] [cmd]: executes the command from the specified REPL
  • $[cmd]: executes a system command
  • !open [repl]: opens a REPL session without switching
  • !close [repl]: closes the specified REPL
  • !alias [name] [cmd]: Creates an alias to a command that can be called with ![name]
  • !quit: closes the current one if no argument is given
  • !exit: exits sluggo
  • !cls: clears the console
  • !reload: reloads the configuration file and the plugins

Modularity

sluggo is extensible. That means you can define your own REPLs easily:

import sluggo

class parrot(sluggo.REPL):
    def eval(self, input):
        print(input)

You just need to put this in your ~/.sluggo/plugins directory for it to be loaded automatically:

$ !go parrot
parrot> hey
hey
parrot> it's annoying
it's annoying

About

Smart shell that can handle mutliple REPLs

License:MIT License


Languages

Language:Python 100.0%