tabby-quick-scripts-chenlei 1.0.0 → 2.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/readme.md +108 -79
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "tabby-quick-scripts-chenlei",
3
- "version": "1.0.0",
4
- "description": "在终端上方显示快捷脚本按钮,点击即可按顺序执行预设命令",
3
+ "version": "2.3.0",
4
+ "description": "Display shortcut script buttons above the terminal. Clicking a button executes the preset commands sequentially.在终端上方显示快捷脚本按钮,点击即可按顺序执行预设命令",
5
5
  "keywords": [
6
6
  "tabby-plugin"
7
7
  ],
package/readme.md CHANGED
@@ -1,79 +1,108 @@
1
- # Tabby Quick Scripts 插件
2
-
3
- `tabby-quick-scripts` 是一款专为 [Tabby 终端](https://github.com/Eugeny/tabby) 开发的快捷脚本面板插件。它能够在终端标签页上方显示常驻的快捷脚本按钮,方便一键执行多条预设的运维或开发命令。
4
-
5
- ---
6
-
7
- ## 🌟 功能特性
8
-
9
- * **常驻工具栏**:在 SSH、串口等终端面板的顶部注入一个快捷按钮栏。
10
- * **顺序执行机制**:支持逐行、按顺序发送多条命令。插件会自动检测终端提示符(如 `$`, `#`, `>`, `%`),确保上一条命令完成响应后再发送下一条。
11
- * **可视化管理**:
12
- * **新建**:点击工具栏最右侧的 `+` 号添加新脚本。
13
- * **执行**:左键单击脚本名称即可开始依次运行预设指令。
14
- * **管理**:右键单击对应脚本可进入编辑模式或进行删除。
15
-
16
- ---
17
-
18
- ## 📦 安装与部署 (本地加载)
19
-
20
- 作为一个本地开发的插件,你需要手动或通过软链接将该项目导入到 Tabby 的插件存放目录的 `node_modules` 中。
21
-
22
- ### 默认 Tabby 插件路径
23
- - **Windows**: `%APPDATA%\tabby\plugins\node_modules\` (例如:`C:\Users\你的用户名\AppData\Roaming\tabby\plugins\node_modules\`)
24
- - **macOS**: `~/Library/Application Support/tabby/plugins/node_modules/`
25
- - **Linux**: `~/.config/tabby/plugins/node_modules/`
26
-
27
- ### 方式一:创建符号链接(推荐)
28
- 最便捷的方式是在 `node_modules` 目录下新建软链接,无需频繁复制构建后的文件。
29
-
30
- **PowerShell (Windows):**
31
- ```powershell
32
- # 注意:请将 -Target 后面的路径替换为本项目源码在你电脑上的真实绝对路径
33
- New-Item -ItemType SymbolicLink -Path "$env:APPDATA\tabby\plugins\node_modules\tabby-quick-scripts" -Target "D:\git\gitea\tabby--QuickScripts"
34
- ```
35
-
36
- ### 方式二:手动拷贝发布
37
- 若使用软链接不便,可在项目构建完成后,必须按照项目原有目录结构将其拷贝至 Tabby 的 `node_modules` 目录。
38
- 1. 运行构建:`npm run build`
39
- 2. 在 Tabby 插件的 `node_modules` 目录中新建 `tabby-quick-scripts` 文件夹。
40
- 3. 将项目中的 **`package.json`** 文件以及整个 **`dist/`** 文件夹(注意:必须是保留 `dist` 文件夹层级,不能直接将 `dist` 内的文件提取至根目录)完整拷贝至该新建文件夹中。
41
-
42
- > ⚠️ **提示**:无论是何种安装方式,配置完成后必须**完全退出并重新启动 Tabby** 才能成功加载。
43
-
44
- ---
45
-
46
- ## 🛠️ 本地开发指南
47
-
48
- 如果你需要对插件逻辑进行维护、二次开发或修复 Bug,可遵循以下规范:
49
-
50
- 1. **准备环境**
51
- 确保你本地已安装 Node.js 环境,在项目根目录执行安装命令:
52
- ```bash
53
- npm install
54
- ```
55
-
56
- 2. **打包构建**
57
- ```bash
58
- # 单次构建(生产环境)
59
- npm run build
60
- ```
61
-
62
- 3. **热更新 / 监听模式**
63
- 开发过程中推荐使用 watch 模式,只要修改了 `src/` 内的源码,就会触发自动增量构建:
64
- ```bash
65
- npm run watch
66
- ```
67
-
68
- ---
69
-
70
- ## ⚙️ 高级配置项
71
-
72
- 插件默认的指令等待提示符正则为 `(\$|#|>|%)\s*$`。若你有特定的设备或定制化 Shell,可以在 Tabby 的 `config.yaml` 配置中找到 `quickScriptsPlugin` 字段调整参数:
73
-
74
- ```yaml
75
- quickScriptsPlugin:
76
- promptPattern: '(\$|#|>|%)\s*$' # 判断上一条命令结束的正则匹配式
77
- commandTimeout: 30000 # 单条命令超时等待上限 (ms)
78
- minDelay: 500 # 发送命令之间的最小物理安全延迟 (ms)
79
- ```
1
+ # 🚀 Tabby Quick Scripts Plugin
2
+
3
+ [![Tabby Version](https://img.shields.io/badge/Tabby-%3E%3D1.0.0-blueviolet)](https://github.com/Eugeny/tabby)
4
+ [![License](https://img.shields.io/badge/license-MIT-green)](LICENSE)
5
+
6
+ `tabby-quick-scripts` is an enhancement plugin tailored for the **[Tabby Terminal](https://github.com/Eugeny/tabby)**. It injects a shortcut toolbar above the terminal tabs, helping users efficiently manage and execute preset multi-line commands with a single click, while integrating powerful SFTP auxiliary features.
7
+
8
+ ---
9
+
10
+ ## Core Features
11
+
12
+ * **⚡ Quick Script Toolbar**: Displays a persistent shortcut button bar at the top of SSH, Serial, Telnet, and other terminal panels.
13
+ * **🤖 Intelligent Sequential Execution**: Supports sending multi-line commands in order. Built-in prompt detection (`$`, `#`, `>`, `%`) ensures the next command is sent only after the previous one has responded, avoiding command stacking.
14
+ * **📂 Enhanced SFTP Module**:
15
+ * **Auto Directory Sync**: Automatically navigates the SFTP remote panel to the current terminal's working directory upon opening.
16
+ * **Dual-Side Favorites**: Bookmark frequently used paths for both local and remote sides for rapid navigation.
17
+ * **Smart Time Highlighting**: File modification times (Year-Month-Day-Hour-Minute) matching the current system time are automatically highlighted in **Green/Yellow**, allowing you to instantly locate the latest logs or files.
18
+ * **Native Drag-and-Drop**: Supports drag-and-drop file/folder transfers between left and right panels, or directly from system folders to the remote server.
19
+ * **🎨 Visual Management**:
20
+ * **Create**: Add new scripts quickly by clicking the `+` icon on the right side of the toolbar.
21
+ * **Execute**: Left-click a script button to trigger execution immediately.
22
+ * **Manage**: Right-click a button to enter edit mode, customize colors, or reorder scripts.
23
+
24
+ ---
25
+
26
+ ## 📦 Installation
27
+
28
+ ### Method 1: Install from Official Plugin Store (Recommended)
29
+
30
+ 1. Open Tabby **Settings** -> **Plugins**.
31
+ 2. Search for `tabby-quick-scripts-chenlei`.
32
+ 3. Click the **Install** button and restart Tabby after completion.
33
+
34
+ ![image-20260509105621928](readme中文.assets/image-20260509105621928.png)
35
+
36
+ ---
37
+
38
+ ## 📖 Usage Guide
39
+
40
+ ### 1. Script Management
41
+ * **Left Click**: Immediately trigger script execution.
42
+ * **Right Click**: Open the edit modal to modify commands or delete the script.
43
+
44
+ ![image-20260509111520036](readme中文.assets/image-20260509111520036.png)
45
+ ![image-20260509111751792](readme中文.assets/image-20260509111751792.png)
46
+
47
+ ### 2. Enhanced SFTP Module
48
+ Click the **`SFTP`** button in the top right corner of the terminal to open the enhanced panel.
49
+
50
+ ![image-20260509111928140](readme中文.assets/image-20260509111928140.png)
51
+
52
+ * **Path Favorites**: Click the star icon to bookmark the current path, and quickly switch via the dropdown menu on the right.
53
+ * **Time Matching**: As shown below, the parts of the date/time matching the current time will be displayed in a prominent color.
54
+
55
+ ![image-20260509112736437](readme中文.assets/image-20260509112736437.png)
56
+
57
+ ---
58
+
59
+ ## 🛠️ Local Development & Manual Installation
60
+
61
+ If you need to install manually or perform secondary development:
62
+
63
+ ### 1. Plugin Storage Path
64
+ * **Windows**: `%APPDATA%\tabby\plugins\node_modules\`
65
+ * **macOS**: `~/Library/Application Support/tabby/plugins/node_modules/`
66
+ * **Linux**: `~/.config/tabby/plugins/node_modules/`
67
+
68
+ ### 2. Symbolic Link Deployment (Recommended)
69
+ Create a symbolic link in the `node_modules` directory pointing to this project's source code to avoid repetitive copying.
70
+
71
+ **PowerShell (Run as Administrator):**
72
+ ```powershell
73
+ # Ensure the path after -Target is the actual path to your local source code
74
+ New-Item -ItemType SymbolicLink -Path "$env:APPDATA\tabby\plugins\node_modules\tabby-quick-scripts" -Target "F:\git\gitea20250909\tabby--QuickScripts"
75
+ ```
76
+
77
+ ### 3. Build Commands
78
+ ```bash
79
+ # Install dependencies
80
+ npm install
81
+
82
+ # Build for production
83
+ npm run build
84
+
85
+ # Watch mode for development (auto-rebuild on changes)
86
+ npm run watch
87
+ ```
88
+
89
+ > [!IMPORTANT]
90
+ > **Note**: Regardless of the installation method, you must **fully exit and restart Tabby** for the plugin to take effect.
91
+
92
+ ---
93
+
94
+ ## ⚙️ Advanced Configuration (config.yaml)
95
+
96
+ You can fine-tune the script execution logic by modifying Tabby's global configuration file `config.yaml`:
97
+
98
+ ```yaml
99
+ quickScriptsPlugin:
100
+ promptPattern: '(\$|#|>|%)\s*$' # Regex to determine the end of the previous command
101
+ commandTimeout: 30000 # Maximum wait time for a single command (ms)
102
+ minDelay: 500 # Minimum physical safety delay between commands (ms)
103
+ ```
104
+
105
+ ---
106
+
107
+ ## 📄 License
108
+ Licensed under the [MIT](LICENSE) License.