### Conventional Commits Examples Source: https://nyaterm.app/docs/development/contributing Examples of commit messages following the Conventional Commits specification for different types of changes. ```git feat(sftp): add batch file download support fix(ssh): handle connection timeout correctly docs: update installation guide ``` -------------------------------- ### Invoke Tauri Command Source: https://nyaterm.app/docs/development/frontend Example of invoking a backend Tauri command through the unified `invoke` wrapper in `src/lib/invoke.ts`. This wrapper handles error logging and allows for centralized adjustment of invocation behavior. ```typescript import { invoke } from '@/lib/invoke'; const sessionId = await invoke('create_ssh_session', { connectionId: 'uuid-here', }); ``` -------------------------------- ### Directory Structure Source: https://nyaterm.app/docs/development/frontend Overview of the frontend project's directory structure, detailing the purpose of each main folder. ```tree src/ ├── components/ # UI 组件 │ ├── dialog/ # 对话框与子窗口相关组件 │ ├── panel/ # 左右侧栏 / 底部区域面板 │ ├── terminal/ # xterm 工作区与终端相关组件 │ ├── layout/ # 外层布局、标题栏、活动栏 │ └── ui/ # 基础 UI 组件(shadcn/ui) │ ├── context/ # React Context providers ├── hooks/ # 自定义 hooks ├── i18n/ # 国际化 ├── lib/ # invoke、window 管理、工作区模型等工具 ├── pages/ # 子窗口页面 ├── types/ # 类型定义 ├── App.tsx # 主应用壳层 └── main.tsx # 前端入口 ``` -------------------------------- ### 从 WindTerm 导入快捷命令配置文件路径 Source: https://nyaterm.app/docs/guide/quick-commands WindTerm 的快捷命令配置文件通常位于此路径。在 Windows 上路径会有所不同。 ```plaintext ~/.wind/profiles/default.v10/terminal/quickbar.config ``` ```plaintext C:\Users\<用户名>\.wind\profiles\default.v10\terminal\quickbar.config ``` -------------------------------- ### 导入 NyaTerm JSON 格式的快捷命令 Source: https://nyaterm.app/docs/guide/quick-commands 可以导入包含 categories 和 commands 的 JSON 文件。`id` 和 `categories` 可选,`execution_mode` 支持 `execute` 或 `append`。 ```json { "categories": [ { "id": "general", "name": "General" }, { "id": "k8s", "name": "Kubernetes" } ], "commands": [ { "id": "cmd-list-files", "label": "List files", "command": "ls -la", "category_id": "general", "description": "List files with details", "color_tag": "blue", "icon_tag": "terminal", "pinned": true, "execution_mode": "execute", "source": "manual", "risk_level": "low" }, { "label": "Kubernetes pods", "command": "kubectl get pods -A", "category": "Kubernetes", "execution_mode": "append", "risk_level": "low" } ] } ``` -------------------------------- ### 使用变量提示的命令脚本 Source: https://nyaterm.app/docs/guide/quick-commands 命令脚本支持 `{{变量名}}` 语法注入动态参数,执行时会弹出变量填写对话框。 ```shell docker exec -it {{容器名}} bash ``` -------------------------------- ### Import NyaTerm JSON Sessions Source: https://nyaterm.app/docs/guide/ssh-connection Import a JSON file to batch manage SSH connections. Ensure sensitive data like passwords and private keys are handled securely after import. ```json { "version": 1, "groups": [ { "path": "Work/Servers" } ], "passwords": { "prod-root-password": "replace-me" }, "ssh_keys": { "ops-ed25519": "-----BEGIN OPENSSH PRIVATE KEY-----\n...\n-----END OPENSSH PRIVATE KEY-----" }, "sessions": [ { "name": "Production Server", "type": "ssh", "host": "prod.example.com", "port": 22, "username": "root", "auth": { "mode": "password", "password_ref": "prod-root-password" } }, { "name": "Bastion Host", "type": "ssh", "host": "bastion.example.com", "username": "admin", "auth": { "mode": "key", "key_ref": "ops-ed25519" } }, { "name": "Internal Service", "type": "ssh", "host": "192.168.1.100", "username": "user", "proxy": { "type": "ssh", "host": "bastion.example.com", "username": "admin", "auth": { "mode": "key", "key_ref": "ops-ed25519" } } }, { "name": "No Auth Server", "type": "ssh", "host": "unprotected.example.com", "auth": { "mode": "none" } } ] } ``` -------------------------------- ### Create a Feature Branch Source: https://nyaterm.app/docs/development/contributing Create a new branch for your feature development based on the main branch. ```git git checkout -b feat/my-feature ``` -------------------------------- ### Conventional Commits Format Source: https://nyaterm.app/docs/development/contributing Standard format for commit messages to ensure consistency and clarity in the project's history. ```git (): ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.