Code Monkey home page Code Monkey logo

super_prompt's Introduction

Super Prompt for Shell Interface

Keep track of the current Git branch, Terraform workspace an so on with a fast, easy and extensible way.

Note

This program is in early stage of development and is subject to change.

However, good ideas are always welcome. Use issue to give me some feedback.

System Requirements

  • Python 3.7+

Install

This project has not been published to PyPI yet.

Thus, you can install by referencing this Git repo:

pip3 install git+https://github.com/jacky9813/super_prompt
# Install and enable plugins

Usage

Open the shell resource file (for example: ~/.bashrc) and modify the PS1 prompt variable like:

# Original: PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ '
PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]($(super-prompt run))\$ '
# Added Part:                                                                                        ^^^^^^^^^^^^^^^^^^^^^

After restarting the shell or reload resource file with source ~/.bashrc, we should get a prompt like:

user@my-workstation:~/super_prompt(๐Ÿœ‰ master)$

Supported Plugins

The plugin needs to be enable manually after installation:

super-prompt config enable-plugin PLUGIN_NAME

You can also disable the plugin:

super-prompt config disable-plugin PLUGIN_NAME

You can check installed plugins with command:

super-prompt config list-plugins

Configuration

The configuration is saved at ~/.config/super-prompt.toml.

Although you can edit it manually, the program also provides basic configuration Interface for users not familiar with toml file.

For example:

super-prompt config set core.context_color 31

Options

Option Name Type Description
core.context_color color

The text color for showing current context. You can either use ANSI 3-bit color code or RGB color if your terminal support it.

For example: - 31 means red foreground in ANSI. - [255, 0, 0] means red in RGB.

super_prompt's People

Contributors

jacky9813 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.