{"id":457,"date":"2026-11-27T11:38:46","date_gmt":"2026-11-27T10:38:46","guid":{"rendered":"https:\/\/www.netlabor.it\/?p=457"},"modified":"2026-11-27T11:40:31","modified_gmt":"2026-11-27T10:40:31","slug":"come-aggiornare-oh-my-pi-plugin-e-skill-con-un-unico-script-bash","status":"publish","type":"post","link":"https:\/\/www.netlabor.it\/en\/come-aggiornare-oh-my-pi-plugin-e-skill-con-un-unico-script-bash\/","title":{"rendered":"How to Update Oh My Pi, Plugins, and Skills with a Single Bash Script"},"content":{"rendered":"\n<div class=\"wp-block-bogo-language-switcher\"><\/div>\n\n\n\n<p class=\"wp-block-paragraph\">When you use Oh My Pi every day for coding and writing, its ecosystem quickly expands: beyond the core OMP binary, you end up with marketplace plugins (like Arsenal), shared skills (like Hallmark), and Git-cloned extensions (like Caveman). The friction shows up at update time\u2014each component relies on a different package manager, and running four separate commands by hand gets old fast.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">To keep maintenance simple, I put together a single Bash script that queries every source in sequence, previews what has changed, and lets you decide whether to apply updates step by step or all at once.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">What the Script Checks<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The script runs four sequential checks across the entire Oh My Pi stack without external dependencies:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Oh My Pi Core:<\/strong> compares your installed version against the latest release via <code>npm<\/code> or <code>omp update<\/code>.<\/li>\n\n\n\n<li><strong>Marketplace Plugins:<\/strong> refreshes registered indexes and checks packages installed through <code>omp plugin<\/code>.<\/li>\n\n\n\n<li><strong>Agent Skills:<\/strong> runs <code>npx skills check<\/code> to spot newer releases of globally installed skills.<\/li>\n\n\n\n<li><strong>Local Git Repositories:<\/strong> scans OMP plugin and skill directories for standalone Git checkouts and fetches any pending upstream commits.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\">The Complete Script<\/h3>\n\n\n\n<p class=\"wp-block-paragraph\">The script automatically detects your OS locale (English or Italian) and supports three modes: read-only inspection (<code>--dry-run<\/code>), interactive confirmation, or unattended execution (<code>--yes<\/code>).<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#!\/usr\/bin\/env bash\nset -euo pipefail\nIFS=$'\\n\\t'\n\nSCRIPT_NAME=\"$(basename \"${BASH_SOURCE&#091;0]}\")\"\nDRY_RUN=0\nAUTO_YES=0\n\ndetect_lang() {\n  local locale=\"${LC_ALL:-${LC_MESSAGES:-${LANG:-en}}}\"\n  case \"$locale\" in\n    it*|IT*) printf 'it' ;;\n    *)       printf 'en' ;;\n  esac\n}\nUI_LANG=\"$(detect_lang)\"\n\nmsg() {\n  if &#091;&#091; \"$UI_LANG\" == \"it\" ]]; then\n    printf '%s' \"$2\"\n  else\n    printf '%s' \"$1\"\n  fi\n}\n\nlog_info()  { printf '&#091;INFO]  %s\\n' \"$*\" &gt;&amp;2; }\nlog_warn()  { printf '&#091;WARN]  %s\\n' \"$*\" &gt;&amp;2; }\nlog_error() { printf '&#091;ERROR] %s\\n' \"$*\" &gt;&amp;2; }\n\nusage() {\n  if &#091;&#091; \"$UI_LANG\" == \"it\" ]]; then\n    cat &lt;&lt;EOF\nUso: $SCRIPT_NAME &#091;opzioni]\n\nVerifica, mostra e applica gli aggiornamenti per OMP, plugin marketplace, skill e repo Git locali.\n\nOpzioni:\n  -n, --dry-run   Controlla e mostra gli aggiornamenti disponibili senza installarli\n  -y, --yes       Applica tutti gli aggiornamenti senza chiedere conferma\n  -h, --help      Mostra questo messaggio\nEOF\n  else\n    cat &lt;&lt;EOF\nUsage: $SCRIPT_NAME &#091;options]\n\nCheck, preview, and apply updates for OMP, marketplace plugins, skills, and local Git plugins.\n\nOptions:\n  -n, --dry-run   Check and show available updates without installing them\n  -y, --yes       Apply all updates without prompting\n  -h, --help      Show this help message\nEOF\n  fi\n}\n\nconfirm() {\n  local prompt=\"$1\"\n  if &#091;&#091; \"$DRY_RUN\" -eq 1 ]]; then\n    return 1\n  fi\n  if &#091;&#091; \"$AUTO_YES\" -eq 1 ]]; then\n    return 0\n  fi\n  local answer=\"\"\n  read -r -p \"$prompt &#091;y\/N]: \" answer\n  &#091;&#091; \"$answer\" =~ ^&#091;YySs]$ ]]\n}\n\ncheck_omp_core() {\n  log_info \"$(msg \"1\/4 Checking Oh My Pi core...\" \"1\/4 Controllo Oh My Pi...\")\"\n  if ! command -v omp &gt;\/dev\/null 2&gt;&amp;1; then\n    log_warn \"$(msg \"'omp' command not found in PATH.\" \"Comando 'omp' non trovato nel PATH.\")\"\n    return\n  fi\n\n  local current\n  current=\"$(omp --version 2&gt;\/dev\/null || echo \"unknown\")\"\n  printf '  - %s: %s\\n' \"$(msg \"Installed version\" \"Versione installata\")\" \"$current\"\n\n  if command -v npm &gt;\/dev\/null 2&gt;&amp;1; then\n    local outdated\n    outdated=\"$(npm outdated -g @oh-my-pi\/pi-coding-agent 2&gt;\/dev\/null || true)\"\n    if &#091;&#091; -n \"$outdated\" ]]; then\n      printf '%s\\n' \"$outdated\"\n      if confirm \"$(msg \"Update Oh My Pi core now?\" \"Aggiornare Oh My Pi ora?\")\"; then\n        omp update || npm install -g @oh-my-pi\/pi-coding-agent@latest\n      fi\n    else\n      log_info \"$(msg \"Oh My Pi core is up to date.\" \"Oh My Pi \u00e8 gi\u00e0 aggiornato.\")\"\n    fi\n  else\n    if confirm \"$(msg \"Run 'omp update' to check and update OMP?\" \"Eseguire 'omp update' per verificare e aggiornare OMP?\")\"; then\n      omp update\n    fi\n  fi\n}\n\ncheck_omp_plugins() {\n  log_info \"$(msg \"2\/4 Checking OMP marketplace plugins (e.g. Arsenal)...\" \"2\/4 Controllo plugin marketplace OMP (es. Arsenal)...\")\"\n  if ! command -v omp &gt;\/dev\/null 2&gt;&amp;1; then\n    return\n  fi\n\n  omp marketplace update &gt;\/dev\/null 2&gt;&amp;1 || true\n  omp plugin list 2&gt;\/dev\/null || true\n\n  if confirm \"$(msg \"Update OMP marketplace plugins?\" \"Aggiornare i plugin marketplace di OMP?\")\"; then\n    omp plugin update\n  fi\n}\n\ncheck_skills() {\n  log_info \"$(msg \"3\/4 Checking Agent Skills (e.g. Hallmark)...\" \"3\/4 Controllo Agent Skills (es. Hallmark)...\")\"\n  if ! command -v npx &gt;\/dev\/null 2&gt;&amp;1; then\n    log_warn \"$(msg \"'npx' not found, skipping skills check.\" \"'npx' non trovato, salto il controllo delle skill.\")\"\n    return\n  fi\n\n  local check_out\n  check_out=\"$(npx --yes skills check 2&gt;&amp;1 || true)\"\n  printf '%s\\n' \"$check_out\"\n\n  if printf '%s' \"$check_out\" | grep -qiE 'update|outdated|available|\u2192'; then\n    if confirm \"$(msg \"Apply available skill updates?\" \"Applicare gli aggiornamenti delle skill?\")\"; then\n      npx --yes skills update\n    fi\n  fi\n}\n\ncheck_git_dirs() {\n  log_info \"$(msg \"4\/4 Checking local Git plugins\/skills (e.g. Caveman)...\" \"4\/4 Controllo plugin\/skill Git locali (es. Caveman)...\")\"\n  local search_roots=(\n    \"$HOME\/.omp\/agent\/plugins\"\n    \"$HOME\/.omp\/agent\/skills\"\n    \"$HOME\/.agents\/skills\"\n  )\n\n  local found_any=0\n  for root in \"${search_roots&#091;@]}\"; do\n    &#091;&#091; -d \"$root\" ]] || continue\n    while IFS= read -r -d '' gitdir; do\n      found_any=1\n      local repo_dir\n      repo_dir=\"$(dirname \"$gitdir\")\"\n      local name\n      name=\"$(basename \"$repo_dir\")\"\n\n      git -C \"$repo_dir\" fetch --quiet 2&gt;\/dev\/null || {\n        log_warn \"$(msg \"Cannot fetch $name\" \"Impossibile verificare $name\")\"\n        continue\n      }\n\n      local behind\n      behind=\"$(git -C \"$repo_dir\" rev-list HEAD..@{u} --count 2&gt;\/dev\/null || echo \"0\")\"\n      if &#091;&#091; \"$behind\" -gt 0 ]]; then\n        printf '  - %s (%s): %s commit(s) behind\\n' \"$name\" \"$repo_dir\" \"$behind\"\n        git -C \"$repo_dir\" log --oneline HEAD..@{u}\n        if confirm \"$(msg \"Pull updates for $name?\" \"Scaricare gli aggiornamenti per $name?\")\"; then\n          git -C \"$repo_dir\" pull --ff-only\n        fi\n      else\n        printf '  - %s: %s\\n' \"$name\" \"$(msg \"up to date\" \"aggiornato\")\"\n      fi\n    done &lt; &lt;(find -L \"$root\" -maxdepth 2 -name \".git\" -print0 2&gt;\/dev\/null)\n  done\n\n  if &#091;&#091; \"$found_any\" -eq 0 ]]; then\n    log_info \"$(msg \"No standalone Git repos found in OMP directories.\" \"Nessun repository Git autonomo trovato nelle cartelle OMP.\")\"\n  fi\n}\n\nmain() {\n  while &#091;&#091; $# -gt 0 ]]; do\n    case \"$1\" in\n      -n|--dry-run) DRY_RUN=1; shift ;;\n      -y|--yes)     AUTO_YES=1; shift ;;\n      -h|--help)    usage; exit 0 ;;\n      *)\n        log_error \"$(msg \"Unknown option: $1\" \"Opzione non riconosciuta: $1\")\"\n        usage &gt;&amp;2\n        exit 2\n        ;;\n    esac\n  done\n\n  if &#091;&#091; \"$DRY_RUN\" -eq 1 ]]; then\n    log_info \"$(msg \"Running in check-only mode (--dry-run).\" \"Esecuzione in sola verifica (--dry-run).\")\"\n  fi\n\n  check_omp_core\n  printf '\\n'\n  check_omp_plugins\n  printf '\\n'\n  check_skills\n  printf '\\n'\n  check_git_dirs\n\n  log_info \"$(msg \"Check completed.\" \"Verifica completata.\")\"\n}\n\nmain \"$@\"<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">Installation and Usage<\/h3>\n\n\n\n<h4 class=\"wp-block-heading\">1. Save and Make Executable<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Save the script as <code>~\/bin\/omp-update.sh<\/code> and grant execute permissions:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>mkdir -p ~\/bin\nchmod +x ~\/bin\/omp-update.sh<\/code><\/pre>\n\n\n\n<h4 class=\"wp-block-heading\">2. Shell Aliases<\/h4>\n\n\n\n<p class=\"wp-block-paragraph\">Add two shortcuts to your <code>~\/.bashrc<\/code> or <code>~\/.zshrc<\/code> so you have both a quick status check and an interactive updater ready:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>alias omp-check='~\/.local\/bin\/omp-update.sh --dry-run'\nalias omp-up='~\/.local\/bin\/omp-update.sh'<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Reload your shell configuration with <code>source ~\/.bashrc<\/code>. From then on, run <code>omp-check<\/code> to inspect pending updates without making changes, <code>omp-up<\/code> to approve each step interactively, or <code>omp-up -y<\/code> to update everything in one pass.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>When you use Oh My Pi every day for coding and writing, its ecosystem quickly expands: beyond the core OMP binary, you end up with marketplace plugins (like Arsenal), shared skills (like Hallmark), and Git-cloned extensions (like Caveman). The friction shows up at update time\u2014each component relies on a different package manager, and running four [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"full-width-page-template.php","format":"standard","meta":{"_locale":"en_US","_original_post":"https:\/\/www.netlabor.it\/?p=455","footnotes":""},"categories":[24,6,7],"tags":[],"class_list":["post-457","post","type-post","status-publish","format-standard","hentry","category-ai","category-informatica","category-programmazione","en-US","missing-thumbnail"],"_links":{"self":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/457","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/comments?post=457"}],"version-history":[{"count":3,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/457\/revisions"}],"predecessor-version":[{"id":461,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/posts\/457\/revisions\/461"}],"wp:attachment":[{"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/media?parent=457"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/categories?post=457"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.netlabor.it\/wp-json\/wp\/v2\/tags?post=457"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}