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>su   →  git › switch-and-pull
g>cb   →  git › create-branch-push
d>up   →  docker › up

Built-in macros

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

g — Git

Shortcut Description
g>cb Create a new branch and push it to origin
g>su Switch to a branch, fetch and pull
g>db Delete branch locally and on remote, then prune
g>nt Create a new tag and push it
g>st Show git status
g>lo Show the last 10 commits

d — Docker

Shortcut Description
d>up docker compose up -d
d>dn docker compose down
d>lg Follow logs for a service

m — Mango

Shortcut Description
m>up Upgrade mango to the latest version

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.4.tar.gz (14.1 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.4-py3-none-any.whl (13.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mango_tui-0.2.4.tar.gz
  • Upload date:
  • Size: 14.1 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.4.tar.gz
Algorithm Hash digest
SHA256 aa3ae52dd8a934b69744b479fa8e484c679003df03cfd258e754393f4f378fa1
MD5 6d5d0d9f575b3ce5ce1681e19da7900e
BLAKE2b-256 8ba62e9054848260e5e1b3e9889c392514f8dbd39e8f3a87d564cac8a0e1305e

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: mango_tui-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 13.8 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.4-py3-none-any.whl
Algorithm Hash digest
SHA256 f7ce57ce82bfa96b3c83b97a9d22c9844af99d2e64bc22a2d6acb08172304803
MD5 e58d3969aece8ccef3d45d97d52ddf20
BLAKE2b-256 c4eea7eaed245f2b2267bca9ac839aaa0366bf6b5d37e53610ca8d026a698247

See more details on using hashes here.

Provenance

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