Mimir

Fast and minimal shell prompt
Alternatives To Mimir
Project NameStarsDownloadsRepos Using ThisPackages Using ThisMost Recent CommitTotal ReleasesLatest ReleaseOpen IssuesLicenseLanguage
Devops Exercises41,661
2 days ago20otherPython
Linux, Jenkins, AWS, SRE, Prometheus, Docker, Python, Ansible, Git, Kubernetes, Terraform, OpenStack, SQL, NoSQL, Azure, GCP, DNS, Elastic, Network, Virtualization. DevOps Interview Questions
Onedev10,973
2 days agomitJava
Self-hosted Git Server with CI/CD and Kanban
Devops Guide6,318
21 days ago5mitHTML
DevOps Guide - Development to Production all configurations with basic notes to debug efficiently.
Gitkube3,181
3 years ago1April 09, 202043apache-2.0Go
Build and deploy docker images to Kubernetes using git push
K8s_paas3,125
a month ago7mitShell
如何基于K8s(Kubernetes)部署成PaaS/DevOps(一套完整的软件研发和部署平台)--教程/学习(实战代码/欢迎讨论/大量注释/操作配图),你将习得部署如:K8S(Kubernetes)、Dashboard、Harbor、Jenkins、本地Gitlab、Apollo框架、Promtheus、Grafana、Spinnaker等。
Agola1,247
6 days ago9March 28, 202277apache-2.0Go
Agola: CI/CD Redefined
Awesome Gitops1,120
a month ago4mit
A curated list for awesome GitOps resources
Devops1,095
2 days ago8gpl-3.0Go
This repo contains all my learning related to DevOps
Devops Bash Tools1,079
14 days ago1mitShell
800+ DevOps Bash Scripts - AWS, GCP, Kubernetes, Docker, CI/CD, APIs, SQL, PostgreSQL, MySQL, Hive, Impala, Kafka, Hadoop, Jenkins, GitHub, GitLab, BitBucket, Azure DevOps, TeamCity, Spotify, MP3, LDAP, Code/Build Linting, pkg mgmt for Linux, Mac, Python, Perl, Ruby, NodeJS, Golang, Advanced dotfiles: .bashrc, .vimrc, .gitconfig, .screenrc, .tmux.conf, .psqlrc ...
Learn Devops1,049
5 days ago1HCL
I am using this repository to document my devops journey. I follow the process of learning everything by tasks. Every task has an associated objective that encompasses an underlying concept. Concepts including CloudProviders, Containers, ContainersOrchestration, Databases, InfrastructureAsCode, Interview, VersionControl etc in progress
Alternatives To Mimir
Select To Compare


Alternative Project Comparisons
Readme

Archived project. No maintenance.

What does this mean? No further code will be committed and the repository will remain in a read-only state. Releases will still be available for download.

Current status: Mmir is stable (as far as I know).

Why? I no longer use Mmir personally, I've switched to using Starship.

Mmir

GitHub Release Build Status Go Report Card Software License

Mmir is a fast and minimal shell prompt written in Go. The look of Mmir is inspired by Pure and the functionality is inspired by prettyprompt.

asciicast

The Mmir Go binary only displays the (pre) prompt line with all the information. The actual prompt line used for input is configured in the shell's config file. This allows for flexibility:

  • You can configure the prompt line to your preference, e.g. you can specify a prompt symbol of your choice, add user or host name info, etc.
  • You can use Mmir with any shell of your choosing. The description says Bash and Zsh because these are the shells which I have tested Mmir on but technically you can use Mmir with any shell as long as it allows you to load a binary as a prompt.

Features

  • It is very fast: loads under 5ms with everything turned on (benchmark).
  • Shows current Git branch name.
  • Long directory paths are shortened and inaccessible paths are highlighted in red.
  • Kubernetes context and namespace info is shown using KUBECONFIG environment variable. If multiple config files are specified in the variable value then the first one with current context info is used. You can overwrite the K8s info by exporting the CURRENT_KUBE_CTX variable with an arbitrary value.
  • OpenStack cloud info is shown using the standard OpenStack environment variables that begin with OS_. Variables that specify IDs are used if name specifying variables are not available. E.g. OS_PROJECT_DOMAIN_ID would be used if OS_PROJECT_DOMAIN_NAME is not available. You can overwrite the cloud info by exporting the CURRENT_OS_CLOUD variable with an arbitrary value.

Installation

Installer script

The simplest way to install Mmir on Linux or macOS is to run:

$ sh -c "$(curl -sL git.io/getmimir)"

This will put the binary in /usr/local/bin/mimir

Pre-compiled binaries

Pre-compiled binaries for Linux and macOS are avaiable on the releases page.

The binaries are static executables.

Homebrew

$ brew install talal/tap/mimir

Building from source

The only required build dependency is Go 1.11 or above.

$ git clone https://github.com/talal/mimir.git
$ cd mimir
$ make install

This will put the binary in /usr/local/bin/mimir

Alternatively, you can also build Mmir directly with the go get command without manually cloning the repository:

$ go get -u github.com/talal/mimir

This will put the binary in $GOPATH/bin/mimir

Usage

The following usage examples are just one example of how Mmir can be configured. The examples below will result in a setup similar to the one shown in the demo above: the prompt symbol (``) changes to red if the previous command exited with an error.

Bash

Add this to your .bashrc file:

prompt_mimir_cmd() {
  if [ $? != 0 ]; then
    local prompt_symbol="\[\e[0;31m\]\[\e[0m\]"
  else
    local prompt_symbol="\[\e[0;35m\]\[\e[0m\]"
  fi

  PS1="$(/path/to/mimir)\n${prompt_symbol} "
}
PROMPT_COMMAND=prompt_mimir_cmd

Zsh

Add this to your .zshrc file:

autoload -Uz add-zsh-hook
prompt_mimir_cmd() { /path/to/mimir }
add-zsh-hook precmd prompt_mimir_cmd

prompt_symbol=''
PROMPT="%(?.%F{magenta}.%F{red})${prompt_symbol}%f "

Options

Option Description Usage
MIMIR_DISABLE_KUBE Disable Kubernetes context and namespace info. export MIMIR_DISABLE_KUBE=1
MIMIR_DISABLE_CLOUD Disable OpenStack cloud info. export MIMIR_DISABLE_CLOUD=1
CURRENT_KUBE_CTX Display arbitrary info for K8s. export CURRENT_KUBE_CTX='custom info'
CURRENT_OS_CLOUD Display arbitrary info for OpenStack. export CURRENT_OS_CLOUD='custom info'

Credits

Most of the source code is borrowed from prettyprompt.

Popular Git Projects
Popular Kubernetes Projects
Popular Version Control Categories
Related Searches

Get A Weekly Email With Trending Projects For These Categories
No Spam. Unsubscribe easily at any time.
Shell
Go
Git
Kubernetes
Bash
Zsh
Openstack