Skip to content

Soul-driven AI agent with permission-hardened tools, token budgets, and multi-channel access. Runs 24/7 from CLI, Telegram or More.

16.9 KB
Raw Blame
"use strict";(self.webpackChunkwebsite=self.webpackChunkwebsite||[]).push([["473"],{62494(e,n,s){s.r(n),s.d(n,{metadata:()=>i,default:()=>h,frontMatter:()=>l,contentTitle:()=>d,toc:()=>c,assets:()=>a});var i=JSON.parse('{"id":"cli-commands/plugins","title":"Plugins (install, enable, disable, remove)","description":"Plugins add features to Mercury that not everyone needs, without making the","source":"@site/docs/cli-commands/plugins.mdx","sourceDirName":"cli-commands","slug":"/cli-commands/plugins","permalink":"/docs/cli-commands/plugins","draft":false,"unlisted":false,"editUrl":"https://github.com/cosmicstack-labs/mercury-agent/tree/main/website/docs/cli-commands/plugins.mdx","tags":[],"version":"current","frontMatter":{"id":"plugins","title":"Plugins (install, enable, disable, remove)","sidebar_label":"Plugins"},"sidebar":"docsSidebar","previous":{"title":"Skills","permalink":"/docs/cli-commands/skills"},"next":{"title":"In-Chat Commands","permalink":"/docs/cli-commands/in-chat-commands"}}'),r=s(74848),t=s(28453);let l={id:"plugins",title:"Plugins (install, enable, disable, remove)",sidebar_label:"Plugins"},d,a={},c=[{value:"Official plugins",id:"official-plugins",level:2},{value:"Four ways to manage plugins",id:"four-ways-to-manage-plugins",level:2},{value:"Commands",id:"commands",level:2},{value:"The plugin menu",id:"the-plugin-menu",level:2},{value:"Plugins use Mercury's providers",id:"plugins-use-mercurys-providers",level:2},{value:"What keeps Mercury safe from a bad plugin",id:"what-keeps-mercury-safe-from-a-bad-plugin",level:2},{value:"Safe mode",id:"safe-mode",level:2},{value:"Where things live",id:"where-things-live",level:2}];function o(e){let n={a:"a",code:"code",em:"em",h2:"h2",li:"li",p:"p",pre:"pre",strong:"strong",table:"table",tbody:"tbody",td:"td",th:"th",thead:"thead",tr:"tr",ul:"ul",...(0,t.R)(),...e.components};return(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.p,{children:"Plugins add features to Mercury that not everyone needs, without making the\nMercury download bigger for everyone. You install the ones you want; the rest\nnever touch your machine."}),"\n",(0,r.jsxs)(n.p,{children:["A plugin can add ",(0,r.jsx)(n.strong,{children:"tools"})," the agent can use, a ",(0,r.jsx)(n.strong,{children:"chat channel"})," (such as\nWhatsApp) and, for some plugins, ",(0,r.jsx)(n.strong,{children:"slash commands"})," you can type. Every plugin\ncan be turned off or removed at any time, and Mercury keeps running if a\nplugin breaks. Plugins are available from Mercury 1.4.0."]}),"\n",(0,r.jsx)(n.h2,{id:"official-plugins",children:"Official plugins"}),"\n",(0,r.jsx)(n.p,{children:"These are in the plugin catalog for macOS (Apple silicon and Intel),\nWindows x64 and Linux (x64 and arm64):"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Plugin"}),(0,r.jsx)(n.th,{children:"Install"}),(0,r.jsx)(n.th,{children:"What it does"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"../integrations/whatsapp",children:"WhatsApp"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins install whatsapp"})}),(0,r.jsx)(n.td,{children:"Chat with Mercury on WhatsApp from a spare number, and talk to it by voice call in both directions"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.a,{href:"../integrations/optimus",children:"Optimus"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins install optimus"})}),(0,r.jsx)(n.td,{children:"Mercury uses your computer: sees the screen, moves the pointer, types and opens apps, by chat or out loud"})]})]})]}),"\n",(0,r.jsxs)(n.p,{children:["The catalog is published at\n",(0,r.jsx)(n.a,{href:"https://mercuryagent.sh/plugins/catalog.json",children:"mercuryagent.sh/plugins/catalog.json"}),".\nEach entry pins a version and a SHA-256 checksum, and Mercury checks the\ndownload against it before installing."]}),"\n",(0,r.jsx)(n.h2,{id:"four-ways-to-manage-plugins",children:"Four ways to manage plugins"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Where"}),(0,r.jsx)(n.th,{children:"Example"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Any chat (terminal, Telegram, web, Discord, Slack)"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Shell"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins list"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Web dashboard"}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.strong,{children:"Configure \u2192 Plugins"})})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:"Telegram buttons"}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"/plugins"}),", then tap ",(0,r.jsx)(n.strong,{children:"Install"}),", ",(0,r.jsx)(n.strong,{children:"Disable"})," or ",(0,r.jsx)(n.strong,{children:"Uninstall"})]})]})]})]}),"\n",(0,r.jsx)(n.p,{children:"They all do the same thing. If Mercury is running in the background, the\nshell commands ask it to make the change, so plugins start and stop right\naway without a restart."}),"\n",(0,r.jsx)(n.h2,{id:"commands",children:"Commands"}),"\n",(0,r.jsxs)(n.table,{children:[(0,r.jsx)(n.thead,{children:(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.th,{children:"Chat"}),(0,r.jsx)(n.th,{children:"Shell"}),(0,r.jsx)(n.th,{children:"What it does"})]})}),(0,r.jsxs)(n.tbody,{children:[(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins"})}),(0,r.jsx)(n.td,{children:"Installed and available plugins, with status"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins open ID"})}),(0,r.jsx)(n.td,{children:"That plugin's menu: its settings, linking, test, turn off, uninstall. Reply with a number (or tap a button on Telegram)"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins setup ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins setup ID"})}),(0,r.jsx)(n.td,{children:"Walk through the plugin's setup again"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins search weather"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins search weather"})}),(0,r.jsx)(n.td,{children:"Find plugins in the catalog"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins info ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins info ID"})}),(0,r.jsx)(n.td,{children:"Tools, network access, secrets it reads, settings"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins install ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins install ID"})}),(0,r.jsx)(n.td,{children:"Install. Shows what the plugin needs first and asks you to confirm"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins enable ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins enable ID"})}),(0,r.jsx)(n.td,{children:"Turn it on"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins disable ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins disable ID"})}),(0,r.jsx)(n.td,{children:"Turn it off. Its data and settings are kept"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins update"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins update"})}),(0,r.jsxs)(n.td,{children:["Update catalog plugins (or one: ",(0,r.jsx)(n.code,{children:"update ID"}),")"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins rollback ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins rollback ID"})}),(0,r.jsx)(n.td,{children:"Go back to the version you had before"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins uninstall ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins uninstall ID"})}),(0,r.jsxs)(n.td,{children:["Remove it. Add ",(0,r.jsx)(n.code,{children:"--purge"})," to delete its data too"]})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins set ID KEY VALUE"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins set ID KEY VALUE"})}),(0,r.jsx)(n.td,{children:"Change a plugin setting"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins pair ID PHONE"})}),(0,r.jsxs)(n.td,{children:[(0,r.jsx)(n.code,{children:"mercury plugins pair ID"})," (QR code) or ",(0,r.jsx)(n.code,{children:"--code PHONE"})]}),(0,r.jsx)(n.td,{children:"Link a channel plugin's account, such as the spare WhatsApp number"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins unlink ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins unlink ID"})}),(0,r.jsx)(n.td,{children:"Log a channel plugin out of its account"})]}),(0,r.jsxs)(n.tr,{children:[(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"/plugins test ID"})}),(0,r.jsx)(n.td,{children:(0,r.jsx)(n.code,{children:"mercury plugins test ID"})}),(0,r.jsx)(n.td,{children:"Send yourself a test message through a channel plugin"})]})]})]}),"\n",(0,r.jsxs)(n.p,{children:["After install, Mercury walks you through the plugin's setup, one question\nat a time, in the same chat. For WhatsApp that's your number, what Mercury\nmay do in your chat, and linking the spare number. For Optimus it's whether\nit may control the computer, how you want to talk to it, and the talk key.\nSetup skips questions that don't apply: with an OpenAI provider already set\nup in Mercury, neither plugin asks which voice to use.\n",(0,r.jsx)(n.code,{children:"mercury plugins install ID --no-setup"})," installs without the walk-through."]}),"\n",(0,r.jsx)(n.h2,{id:"the-plugin-menu",children:"The plugin menu"}),"\n",(0,r.jsxs)(n.p,{children:["You never need to remember a plugin's settings. ",(0,r.jsx)(n.code,{children:"/plugins ID"})," (or\n",(0,r.jsx)(n.code,{children:"mercury plugins open ID"}),", or the dashboard) opens its menu:"]}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Every setting is listed on the menu"})," with its current value. Pick one to\nchange it. Related settings are grouped into sections, such as\n",(0,r.jsx)(n.strong,{children:"\u{1F399} Voice calls"}),", each marked \u2713 when it's ready or \"needs setup\" when it\nisn't."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Choices say what they do."}),' A yes/no setting shows, for example,\n"On: Mercury picks up when you call it" and "Off: your calls to Mercury ring\nout", and after you save, the reply repeats what your choice does.']}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Follow-up settings come next."})," Change the voice engine to Gemini and\nMercury asks for the Gemini key and model straight away, instead of leaving\nyou to find them."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"No dead ends."})," Every question offers a way back with no change, and\n",(0,r.jsx)(n.code,{children:"cancel"})," closes the menu."]}),"\n",(0,r.jsxs)(n.li,{children:["The menu also has ",(0,r.jsx)(n.strong,{children:"Link"})," / ",(0,r.jsx)(n.strong,{children:"Unlink"})," and ",(0,r.jsx)(n.strong,{children:"Send me a test message"})," for\nchannel plugins, ",(0,r.jsx)(n.strong,{children:"Run setup again"}),", ",(0,r.jsx)(n.strong,{children:"Update"}),", ",(0,r.jsx)(n.strong,{children:"Turn off"})," and\n",(0,r.jsx)(n.strong,{children:"Uninstall"}),"."]}),"\n"]}),"\n",(0,r.jsx)(n.p,{children:"In a chat, reply with the option's number (or tap a button on Telegram).\nMembers see the status only."}),"\n",(0,r.jsx)(n.h2,{id:"plugins-use-mercurys-providers",children:"Plugins use Mercury's providers"}),"\n",(0,r.jsxs)(n.p,{children:["A plugin that needs an AI provider (the voice engines in WhatsApp and Optimus\nuse OpenAI or Grok) borrows the one you already set up in Mercury\n(dashboard \u2192 Providers, or ",(0,r.jsx)(n.code,{children:"mercury doctor"}),'). You set a key in one place.\nKeys a plugin asks for itself (a Gemini or Deepgram key, say) are stored with\nMercury\'s own keys, shown only as "set", and readable only by plugins that\ndeclare them, so a key added for WhatsApp also works for Optimus. If a key\nis missing, Mercury tells you once what it turns off and how to fix it.']}),"\n",(0,r.jsxs)(n.p,{children:[(0,r.jsx)(n.code,{children:"install"})," accepts a catalog id, a folder, a ",(0,r.jsx)(n.code,{children:".tgz"})," file, an ",(0,r.jsx)(n.code,{children:"https://"})," URL,\nor ",(0,r.jsx)(n.code,{children:"github:owner/repo"})," (latest release). Only catalog plugins are verified\nby Mercury; install anything else only from people you trust."]}),"\n",(0,r.jsx)(n.p,{children:"Only the owner (and admins on Telegram, Discord and Slack) can install or\nchange plugins. In the web dashboard, changes are accepted only from the\ncomputer Mercury runs on."}),"\n",(0,r.jsx)(n.h2,{id:"what-keeps-mercury-safe-from-a-bad-plugin",children:"What keeps Mercury safe from a bad plugin"}),"\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Two kinds of plugin."})," ",(0,r.jsx)(n.em,{children:"Own process"})," plugins run as a separate program:\nif they crash, Mercury restarts them, and after repeated crashes turns them\noff. ",(0,r.jsx)(n.em,{children:"In-process"})," plugins run inside Mercury, with timeouts on everything\nthey do."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Only what it declared."})," A plugin can reach only the websites and read\nonly the secrets listed in its manifest. ",(0,r.jsx)(n.code,{children:"/plugins info"})," shows both, and\ninstall shows them before you confirm. A plugin that controls the computer\n(Optimus) is flagged with a warning."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Tools ask first."})," A plugin tool that changes anything asks for your\napproval like any built-in tool. Bots never see plugin tools unless you\nallow them in the bot's tool list (",(0,r.jsx)(n.code,{children:"weather__forecast"}),", or ",(0,r.jsx)(n.code,{children:"weather__*"})," for\nall of one plugin's tools)."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Automatic turn-off."})," A plugin is turned off, and you get a message\nsaying why, when:","\n",(0,r.jsxs)(n.ul,{children:["\n",(0,r.jsx)(n.li,{children:"it fails 5 times in a row;"}),"\n",(0,r.jsx)(n.li,{children:"it crashes too often;"}),"\n",(0,r.jsx)(n.li,{children:"its files changed since install;"}),"\n",(0,r.jsx)(n.li,{children:"it isn't compatible with your Mercury version;"}),"\n",(0,r.jsx)(n.li,{children:"Mercury failed to start twice right after it was installed or updated."}),"\n"]}),"\n"]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Clean removal."})," Disable or uninstall stops its timers, network requests\nand tools straight away. No restart needed. Installing into a running\nMercury starts the plugin straight away too."]}),"\n",(0,r.jsxs)(n.li,{children:[(0,r.jsx)(n.strong,{children:"Updates you can undo."})," The previous version is kept, so\n",(0,r.jsx)(n.code,{children:"/plugins rollback ID"})," brings it back, with its settings."]}),"\n"]}),"\n",(0,r.jsx)(n.h2,{id:"safe-mode",children:"Safe mode"}),"\n",(0,r.jsx)(n.p,{children:"If Mercury won't start after a plugin change, start it with every plugin off:"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{className:"language-sh",children:"mercury start --safe-mode        # or: MERCURY_PLUGINS=off mercury start\nmercury doctor --plugins         # what's installed, what's off and why\n"})}),"\n",(0,r.jsx)(n.h2,{id:"where-things-live",children:"Where things live"}),"\n",(0,r.jsx)(n.pre,{children:(0,r.jsx)(n.code,{children:"~/.mercury/plugins/\n  state.json                 installed / enabled\n  ID/versions/VERSION/       the plugin (current + previous)\n  ID/data/                   the plugin's own data (kept on uninstall unless --purge)\n  ID/settings.json           your settings for it\n"})}),"\n",(0,r.jsxs)(n.p,{children:["Writing a plugin? See ",(0,r.jsx)(n.a,{href:"../reference/plugins",children:"Reference \u2192 Writing plugins"}),"."]})]})}function h(e={}){let{wrapper:n}={...(0,t.R)(),...e.components};return n?(0,r.jsx)(n,{...e,children:(0,r.jsx)(o,{...e})}):o(e)}},28453(e,n,s){s.d(n,{R:()=>l,x:()=>d});var i=s(96540);let r={},t=i.createContext(r);function l(e){let n=i.useContext(t);return i.useMemo(function(){return"function"==typeof e?e(n):{...n,...e}},[n,e])}function d(e){let n;return n=e.disableParentContext?"function"==typeof e.components?e.components(r):e.components||r:l(e.components),i.createElement(t.Provider,{value:n},e.children)}}}]);