令行 CmdPilot
1 rating
)Overview
为 Web 终端预设命令序列,一键或快捷键自动输入执行;支持等提示符再继续、运行前填参数、分类搜索、断点续跑、报错即停与大文件读入。
令行 CmdPilot 把重复的终端操作变成一次点击。 在 Web 终端(WebSSH、JumpServer、云控制台 Shell、ttyd、Wetty 等)里,很多命令序列每天都要敲一遍:进入目录、启动诊断工具、选进程号、跟踪日志……令行让你把这些操作保存成「方案」,之后一键或一个快捷键就能自动输入并执行。 ■ 主要功能 · 方案管理:把任意命令序列保存为方案,支持空行、注释(#)、wait 等待和 pause 断点 · 内置示例:装完就有 8 条现成方案(固定命令 / 手填参数 / 下拉候选三种写法各有几条),不用先学语法就能上手;用不上的删掉就行,删掉的示例不会被自动补回来 · 一键执行:弹出面板点一下,按 Alt+Shift+1~4 运行绑定的方案,或在页面右键菜单里直接选 · 页内命令面板:不用先点扩展图标——在终端页面上敲自己绑的快捷键(建议在 Chrome 快捷键页给它绑 Alt+Shift+L),或直接点页面右下角的终端图标按钮(纯蓝底白色图标、可拖动),就地唤起搜索框,敲方案名、别名或分类模糊筛(打 bboss 能搜到别名是这个的方案,打「日志」筛出整个分类,中文名只打拼音首字母也行——「按关键字翻日志」打 agjz 就出来了),↑↓ 选、回车执行;要填参数就在同一个浮层里填,下拉候选照常能用,Esc 收起。面板画在页面自己的隔离层里,不抢页面的样式,也不影响原来的快捷键 · 等提示符再继续:waitfor "~]$" 15 —— 等屏幕上出现指定文字再走下一步,等到了立刻继续、等不到就停下说明,不用靠 wait 3000 赌时间 · 运行前填参数:命令里写 {{ask:订单号}},运行时弹面板填一次(填过的值本次会话内记住);写成 {{ask:容器名=order-api}} 就带默认值,面板预填好、回车直接跑,快捷键和右键菜单也能用;几个值换着用时写 {{ask:环境=prod|sit|uat}},面板里那个框能下拉选、也能手输;{{query:podName}} 直接取地址栏里的查询参数;{{date}} {{time}} {{url}} {{host}} 自动替换,日期时间还能做偏移和自定义格式({{date:+7d}}、{{date:-1w YYYY/MM/DD}}) · 抓输出进变量:capture "version=" v 把屏幕上匹配到的行存进 {{v}},后面的步骤直接引用(也支持正则捕获组),跨 pause 断点依然有效——适合先跑一条命令再拿它的输出当下一步的参数 · 回屏搜索:页内面板按 Tab 切到「搜回屏」,在终端回显里搜日志、找报错,关键字高亮、↑↓ 选、回车复制整行,不用再滚动屏幕肉眼找 · 方案分享码:把方案导出成 CMDP1: 开头的短文本,聊天框里直接发给同事,对方粘贴即导入;「从文本导入」还能认 Espanso 的 matches 配置(trigger 变方案名、replace 变命令) · 表格循环:方案里写 {{col:列名}},运行前贴一张 CSV/TSV 表格(Tab、逗号、竖线分隔都认,markdown 表格也行),每行数据完整跑一遍方案——批量改配置、按主机清单逐台巡检不用写循环脚本 · 同站批量执行:右键菜单选「批量:在本站所有标签页运行」,确认后同一方案在当前站点的所有标签页按顺序执行;某页停下整批停止,危险命令照常先确认 · 输入触发短码(默认关闭):在设置里开启后,页面输入框里敲 ,,名字 + 回车就直接运行对应方案,多命中自动开面板;不打字时完全不影响页面 · 兼容性自检:设置页一键探测当前标签页「命令会打到哪里」——目标输入框、注入策略、入口常驻状态一目了然,排障不用猜 · 运行记录:顶栏「记录」里是最近 20 次执行(哪个方案、成没成、几步、多久、在哪个站点),点「再跑一次」直接重跑;只存这些,不存命令内容和参数值 · 失败续跑:某一步报错停下后,按钮变成「续跑」——处理完现场从失败的那一步接着走,不用把前面几十条命令再发一遍;断点存到关掉面板都还在 · pause 断点续跑:启动时间不确定的步骤(比如 Arthas 启动后要选进程号)不必盲等,执行到那里停下来,看清终端再点「继续」 · 报错即停:命令输出里出现 command not found、No such file or directory 这类报错时自动中止,不会在错误的目录里继续跑后面几条 · 执行前清空输入行(可选):上一条命令敲了没按回车时,新方案的第一条会拼在它后面变成一条跑不通的命令;打开这个开关就先清一下 · 文本块粘贴:一整段配置(几十上百行)用 paste begin / paste end 包起来一次贴进 vi,不受终端单次 32 KB 的限制 · 从文件读入:几万行的命令清单直接「选择文件」读本地 .txt / .sh,也能把文件拖进面板;一键包成上传块,gzip 压缩后落到远端文件(10 万行 11 MB 实测 16 秒,比手工粘贴快二十多倍) · 逐条开关:一份方案里只想跑其中几步,取消勾选即可;也可以单独执行某一条 · 页面内进度浮球:执行时页面右下角显示进度,面板关掉也不影响,断点暂停或报错停下时可直接在页面上继续 · 分类筛选:给方案打标签(日志 / 运维 / 部署),列表顶部一键只看这一类;卡片上的角标也能点 · 别名与排序:给中文方案名配个缩写(qdar)方便搜;列表可以按创建顺序、最近编辑、最近跑过或跑得最多排 · 拖动与复制:手动顺序下按住卡片左侧手柄就能拖动改顺序,松手即存盘,拖到列表边缘会自动滚动;方案之间常只差一两行,点「复制」就多一份副本并直接进编辑器,原名和内容都保留 · 紧凑列表:一个方案只占两行,420×580 的面板一屏能看六个左右 · 本地搜索:Ctrl+F(macOS ⌘F)或 / 直接聚焦搜索框,方案名、别名、命令行、分类、适用页面都能搜;中文名还可以只打拼音首字母(「查看日志」打 ckrz) · 方案备份:一键导出 / 导入 JSON,换机器或分享给同事;也能用更短的分享码(CMDP1: 开头)在聊天框里直接传,「从文本导入」通吃分享码、导出 JSON 和 Espanso 配置 · 智能识别输入框:自动找到页面的终端输入区,xterm.js、普通输入框、Canvas 终端都能适配 · 只在本机保存:所有方案和设置都存在浏览器本地,不上传任何数据 ■ 怎么写方案 每行一条命令,就是你会手动敲的内容: # 井号开头是注释 cd /app/logs wait 300 tail -f stdout.log · wait 300 表示等 300 毫秒再执行下一步,用于等终端处理输入 · waitfor "Password:" 10 表示等屏幕上出现 Password: 再继续,最多等 10 秒(等不到就停下) · {{ask:关键词}} 表示运行时问你填什么,适合每天都变的订单号、容器名、索引名 · {{ask:容器名=order-api}} 就是带默认值的写法:面板里预填 order-api,不改直接回车;同一份方案换参数反复用不必每次重打 · {{ask:环境=prod|sit|uat}} 用竖线列出候选,第一个就是默认值;面板里那个框能下拉选(↑↓ 选、回车确认),也还能手输候选之外的值 · {{query:podName}} 从当前页面地址里取 ?podName=… 的值,地址栏里已经有的不用再填一次 · {{date:+7d}} / {{time:+90m}} 做日期时间偏移(支持 d/w/m/y 与 s/m/h/d),还能带格式:{{date:-1w YYYY/MM/DD}} 输出一周前的日期;写错单位会原样保留,不会悄悄改命令 · capture "version=" v 把屏幕上含 version= 的那一行、等号后面的内容存进 {{v}},下一步直接用 {{v}} 引用;capture /(\d+\.\d+)/ v 按正则取捕获组;行尾数字是最长等待秒数 · {{col:列名}} 配合表格循环使用:运行前贴的表格每一列对应一个名字,每行数据驱动一次完整运行 · pause 表示停在这里等用户确认,用于等程序启动、等列表刷出来 · key ctrl+c 可以发控制键,用于退出上一个 tail -f · clearinput 一键清空当前输入行(全选后删除),抹掉上一次没跑完留下的残留 要往 vi 里贴一整段内容,用文本块把内容包起来(块内原样送出,不解析): vi /app/conf/app.properties key i paste begin server.port=8080 logging.level=INFO paste end key Escape run :wq ■ 三种输入方式 · 自动识别(默认):检测到 xterm.js 系终端时用粘贴事件整行注入,普通输入框用输入事件,Canvas 终端逐个按键 · 输入事件:适合绝大多数网页表单 · 逐个按键:适合 Guacamole、noVNC 这类远程桌面 ■ 适合谁 运维、后端开发、SRE——任何需要反复登录 Web 终端敲同样几条命令的人。 ■ 权限说明 · storage:在你本机保存方案和设置 · scripting:把方案里的文字输入到你当前打开的页面,并显示进度浮球 · activeTab:仅在你点击扩展、按快捷键或使用右键菜单时,临时获得当前标签页的访问权 · contextMenus:为你的方案提供右键菜单入口 扩展不含任何远程代码,不发起网络请求,不收集、不上传任何数据。为判断命令是否执行失败、等待方案指定的提示符出现、以及在你显式写了 capture 时抓取输出供后续步骤引用,扩展会在本机读终端屏幕上已显示的文字:报错判断和等待只比较一次即弃,capture 抓到的值和「表格循环」你粘贴的表格数据只存在本机会话里、浏览器关闭即清。任何情况下都不保存屏幕原文、不外传。 CmdPilot turns repetitive terminal operations into a single click. In Web terminals (such as WebSSH, JumpServer, cloud console shells, ttyd, and Wetty), many command sequences have to be typed every single day: navigating into directories, launching diagnostic tools, selecting process IDs, tracking logs, and more. CmdPilot allows you to save these operations as "plans" (recipes) so you can automatically input and execute them with a single click or shortcut key. Key Features Plan Management: Save any command sequence as a plan, supporting blank lines, comments (#), wait delays, and pause breakpoints. Built-in Examples: Comes with 8 ready-to-use plans right after installation (covering fixed commands, manual parameter inputs, and dropdown options), allowing you to get started without learning syntax first. Unused examples can be deleted and will not be automatically re-added. One-Click Execution: Run bound plans instantly via the popup panel, shortcut keys (Alt+Shift+1~4), or directly from the page context menu. In-Page Command Palette: No need to click the extension icon first—press your custom shortcut on the terminal page (recommended: Alt+Shift+L in Chrome shortcuts) or click the floating terminal icon button in the bottom-right corner of the page (a draggable, solid blue icon with a white symbol). This brings up a local search box where you can fuzzy search plans by name, alias, or category (e.g., typing "bboss" matches an alias, typing "logs" filters the entire category, and Chinese names can even be searched using pinyin initials like "agjz" for "按关键字翻日志"). Use the arrow keys to select, press Enter to execute, fill in parameters in the same overlay, and press Esc to close. The panel runs in an isolated layer, avoiding interference with page styles or original shortcuts. Wait for Prompt to Continue: Use waitfor "~]$" 15 to pause execution until the specified text appears on the screen. It proceeds immediately once detected or halts with a description if it times out, eliminating the need to guess with arbitrary wait 3000 delays. Pre-Execution Parameters: Write {{ask:Order Number}} in commands to prompt for input at runtime (entered values are remembered for the current session). Use {{ask:Container Name=order-api}} to provide default values that are pre-filled in the panel and ready to run with a single Enter press, which also works with shortcuts and context menus. Use {{ask:Environment=prod|sit|uat}} for multiple choices where the input box supports dropdown selection or manual entry. Use {{query:podName}} to directly fetch query parameters from the address bar. Automatic replacements are also supported for {{date}}, {{time}}, {{url}}, and {{host}}, with date/time offsets and custom formats (e.g., {{date:+7d}}, {{date:-1w YYYY/MM/DD}}). Capture Output into Variables: Use capture "version=" v to store the line matching version= and everything following the equals sign into {{v}}, allowing subsequent steps to directly reference it (regular expression capture groups are also supported). This persists across pause breakpoints, making it ideal for running a command and using its output as a parameter for the next step. Screen Buffer Search: Switch to "Search Buffer" via Tab in the in-page panel to search logs and errors within the terminal echo, with keyword highlighting, arrow-key selection, and Enter to copy whole lines—no more scrolling and manually hunting through screens. Plan Sharing Codes: Export plans as short text strings starting with CMDP1: to share directly via chat; pasting it instantly imports the plan. "Import from Text" also recognizes Espanso matches configurations (trigger becomes the plan name, replace becomes the command). Table Loops: Use {{col:Column Name}} in plans and paste a CSV/TSV table before execution (supporting tab, comma, vertical bar delimiters, as well as Markdown tables) to run the plan completely for each row of data—perfect for batch-configuration updates or sequential host inspections without writing loop scripts. Batch Execution on Same Site: Select "Batch: Run on all tabs of this site" from the context menu to execute the same plan sequentially across all open tabs on the current domain. If one page stops, the entire batch pauses, while dangerous commands still prompt for confirmation as usual. Input-Triggered Shortcodes (Disabled by Default): After enabling in settings, type ,,name + Enter in any text input field on a page to directly run the corresponding plan, automatically opening the panel if there are multiple matches. It does not affect normal typing when not in use. Compatibility Self-Check: Use the settings page to instantly probe where commands will be sent on the current tab—target input boxes, injection strategies, and permanent entry status are visible at a glance to eliminate guesswork during troubleshooting. Execution History: The "History" section in the top bar logs the last 20 executions (plan name, success status, step count, duration, and site). Click "Run Again" to instantly re-execute; only execution metadata is stored, excluding command contents and parameter values. Resume on Failure: When a step fails and halts execution, the button changes to "Resume"—allowing you to fix the environment on-site and continue right from the failed step without re-running dozens of preceding commands. Breakpoint states remain saved even if the panel is closed. Pause Breakpoints: Steps with unpredictable startup times (such as selecting a process ID after launching Arthas) don't require blind waiting. Execution pauses at that point so you can inspect the terminal and click "Continue". Stop on Error: Automatically aborts execution if common error outputs like command not found or No such file or directory appear, preventing the script from running subsequent steps in an incorrect directory. Clear Input Line Before Execution (Optional): If a previous command was typed without pressing Enter, a new plan's first command would otherwise attach to it and fail. Enabling this switch clears the line first. Text Block Pasting: Wrap dozens or hundreds of configuration lines using paste begin and paste end to paste them into vi all at once without hitting terminal 32 KB single-paste limits. Import from File: Select a local .txt or .sh file with tens of thousands of commands, or drag and drop files directly into the panel. Files are packaged into upload blocks, compressed with gzip, and written to the remote file (tested at 16 seconds for 100,000 lines / 11 MB—over 20 times faster than manual pasting). Individual Step Toggles: Uncheck specific steps in a plan if you only want to run certain parts, or execute a single step independently. In-Page Progress Floating Ball: Displays progress in the bottom-right corner of the page during execution, persisting even if the panel is closed. When execution pauses at a breakpoint or stops due to an error, you can continue directly on the page. Category Filtering: Tag plans (e.g., Logs, Ops, Deployment) to filter views instantly from the top of the list, or click badges directly on plan cards. Aliases and Sorting: Assign short abbreviations to Chinese plan names (e.g., qdar) for easier searching. Lists can be sorted by creation order, recent edits, recent executions, or execution frequency. Drag-and-Drop & Duplication: In manual sort mode, hold the handle on the left side of a card to drag and reorder items, which saves automatically on release and auto-scrolls at list edges. Since plans often share similar steps, clicking "Duplicate" creates a copy that opens straight into the editor with the original name and contents preserved. Compact List View: Each plan takes up only two lines, fitting about six items on a standard 420×580 panel screen. Local Search: Press Ctrl+F (macOS ⌘F) or / to focus the search box instantly and search plan names, aliases, command lines, categories, or applicable pages. Chinese names can also be searched using pinyin initials (e.g., typing ckrz for "see log"). Plan Backup: Export and import plans via JSON when switching devices or sharing with colleagues, or use short sharing codes (CMDP1:) to transfer them directly through chat. "Import from Text" supports sharing codes, exported JSON, and Espanso configurations. Intelligent Input Box Recognition: Automatically detects the terminal input area on a page, adapting seamlessly to xterm.js, standard input elements, and Canvas terminals. Local-Only Storage: All plans and settings are stored locally within your browser, with zero data uploaded to external servers. Target Audience Operations engineers, backend developers, and SREs—anyone who needs to repeatedly log into Web terminals and type the same command sequences. Permissions storage: Saves your plans and settings locally on your machine. site_scripting: Inputs plan text into your currently open page and displays the progress floating ball. activeTab: Temporarily grants access to the current tab only when you click the extension, use shortcut keys, or select from the context menu. contextMenus: Provides context menu entry points for your plans. The extension contains no remote code, initiates no network requests, and does not collect or upload any data. To determine if a command has failed, wait for specified prompt strings, or capture output when explicitly requested via capture, the extension reads text already displayed on the local terminal screen: error checks and waits are compared once and discarded, while captured values and pasted table data for "Table Loops" reside exclusively in local session memory and are cleared when the browser closes. Raw screen content is never saved or transmitted under any circumstances.
5 out of 51 rating
Details
- Version2.0.4
- UpdatedNovember 10, 2026
- Offered byqinlinglong
- Size183KiB
- Languages中文(中国)
- Developer
Email
qinlinglong@gmail.com - Non-traderThis developer has not identified itself as a trader. For consumers in the European Union, please note that consumer rights do not apply to contracts between you and this developer.
Privacy
This developer declares that your data is
- Not being sold to third parties, outside of the approved use cases
- Not being used or transferred for purposes that are unrelated to the item's core functionality
- Not being used or transferred to determine creditworthiness or for lending purposes