Skip to main content

Keyboard-driven TUI for running multi-step shell command sequences defined in YAML

Project description

🥭 mango

A keyboard-driven TUI for running your shell command sequences — no more copy-pasting the same commands.

PyPI version Python versions License


mango TUI — main view


Install

pip install mango-tui

Requires Python 3.10+.

Run

mango

That's it. On first run mango creates its config at ~/.config/mango/ and opens the TUI.


How it works

mango lets you define macros — named sequences of shell commands — grouped by category. You pick one from the TUI and it runs, streaming output to the bottom panel in real time.

Macros that need input (a branch name, a service, a version tag) show a prompt dialog before running.

mango TUI — param dialog


Keyboard reference

Key Action
/ Move through the list
/ Switch between category and macro panels
Enter Run the selected macro
Tab / Shift+Tab Cycle focus (categories → macros → shortcut bar)
q Quit

Shortcut mode

Type <category>><macro> at any time to jump straight to a macro without using the menus:

g>bs   →  git › switch-and-pull
g>bc   →  git › create-branch-push
d>cu   →  docker › up

Built-in macros

mango ships with a set of common macros ready to use:

g — Git

Shortcut Description
g>bc branch | create and push
g>bd branch | delete local, remote and prune
g>br branch | rename local and remote
g>bs branch | switch and pull
g>cf clean | remove untracked files
g>gl git | show recent commits
g>gs git | show status
g>mb merge | branch into current
g>rh reset | hard to HEAD
g>ru reset | undo last commit
g>sc stash | create
g>sp stash | pop
g>tc tag | create and push

d — Docker

Shortcut Description
d>cb container | build and start
d>cd container | stop
d>ce container | exec shell
d>cl container | follow service logs
d>cp container | prune stopped
d>cr container | restart service
d>cu container | start

n — Node

Shortcut Description
n>nc ncu | check outdated deps
n>nd ncu | doctor mode (safe upgrade)
n>nu ncu | upgrade all deps

m — Mango

Shortcut Description
m>mu mango | upgrade

Adding your own macros

Create ~/.config/mango/config.local.yaml. Your macros are merged with the built-in defaults and survive package upgrades.

categories:
  git:
    shortcut: "g"          # must match an existing category exactly to add macros into it
    macros:
      cleanup:
        shortcut: "cl"
        description: "Delete merged branches"
        steps:
          - git branch --merged | grep -v main | xargs git branch -d

  tools:                   # a new category — key and shortcut must not exist in the defaults
    shortcut: "t"
    macros:
      hello:
        shortcut: "hi"
        description: "Say hello"
        steps:
          - echo "hello world"

Macros with parameters

Use params to collect input before the steps run. Reference each param in steps as {name}:

categories:
  tools:
    shortcut: "t"
    macros:
      deploy:
        shortcut: "dp"
        description: "Deploy to an environment"
        params:
          - name: env
            prompt: "Environment (staging/prod)"
        steps:
          - ./deploy.sh {env}
          - echo "Deployed to {env}"

Config files

mango manages three files under ~/.config/mango/ (respects $XDG_CONFIG_HOME):

File What it is
config.default.yaml Built-in macros — overwritten on each update
config.local.yaml Your macros — edit this one
commands.yaml Merged result read by the app — do not edit

Merge rules

  • To add macros into an existing category: use the same category key and shortcut as the default.
  • To add a new category: both the key and shortcut must not conflict with any default.
  • Within a shared category, each local macro key and shortcut must be unique.

Conflicts are skipped and reported before the TUI opens:

[mango] config conflict: macro 'git>status' — key already defined in default (skipped)

YAML schema reference

categories:
  <category-key>:
    shortcut: "g"            # unique globally; one or more chars
    macros:
      <macro-key>:
        shortcut: "su"       # unique within its category
        description: "..."
        params:              # optional
          - name: branch
            prompt: "Branch name"
        steps:               # run sequentially; first non-zero exit aborts
          - git checkout {branch}
          - git fetch
          - git pull

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mango_tui-0.2.5.tar.gz (14.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mango_tui-0.2.5-py3-none-any.whl (14.5 kB view details)

Uploaded Python 3

File details

Details for the file mango_tui-0.2.5.tar.gz.

File metadata

  • Download URL: mango_tui-0.2.5.tar.gz
  • Upload date:
  • Size: 14.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mango_tui-0.2.5.tar.gz
Algorithm Hash digest
SHA256 3e11c4680da689a8aed248da4fcda05bcec3ea25be31f3d038b14114c8e8edba
MD5 ee4adb48c64e92cec34c7c331f1f21f2
BLAKE2b-256 d9aba28282357d3e46083351c285a9292c8306c93c497b4d6ce0b2a679d33e3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mango_tui-0.2.5.tar.gz:

Publisher: publish.yml on juanleon8581/mango-assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mango_tui-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: mango_tui-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 14.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mango_tui-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0a72fda7d30355bde8a43eaee6417f63ab998919570d65c6d5191549e03bfeec
MD5 11ae0340eab6580cddd2216765657609
BLAKE2b-256 a8249bd25b21346e2ebf7ad75c9fc21b65191e532dd47ecf9cecf270c233a82b

See more details on using hashes here.

Provenance

The following attestation bundles were made for mango_tui-0.2.5-py3-none-any.whl:

Publisher: publish.yml on juanleon8581/mango-assistant

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page