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.6.tar.gz (15.8 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.6-py3-none-any.whl (15.5 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mango_tui-0.2.6.tar.gz
  • Upload date:
  • Size: 15.8 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.6.tar.gz
Algorithm Hash digest
SHA256 b030962da158632d3a396fcd94e2e44960bc95e56d4c6bebf3f5006ca7e42ac6
MD5 7fd075661c6cf2ac237d9945f7495813
BLAKE2b-256 27d5dc7265bea079847656f192230a39177f2ac31fb1f50e8b14b9755547ff3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mango_tui-0.2.6.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.6-py3-none-any.whl.

File metadata

  • Download URL: mango_tui-0.2.6-py3-none-any.whl
  • Upload date:
  • Size: 15.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.6-py3-none-any.whl
Algorithm Hash digest
SHA256 20b31dd1091132f51bae0984c1bf11b807dfc663af06d31ee000c170ccdb4b3a
MD5 d7174a85962ad9ee51aac48f56a9af43
BLAKE2b-256 51b9de082f007e3cec000b3e8c844d79d03750a24f3621668ee128be004dcecc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mango_tui-0.2.6-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