Manifest File (manifest.json)
manifest.json is the core configuration file for script extensions, defining basic information, tasks, UI extensions, and settings.
File Structure Overview
A complete manifest.json contains the following sections:
json
{
// Basic information (required)
"id": "com.example.myscript",
"name": "Script Name",
"version": "1.0.0",
"author": "Author",
// Event listeners (optional)
"events": {...},
// Task definitions (optional)
"scripts": [...],
// UI extensions (optional)
"views": {...},
// Settings panel (optional)
"settings": [...]
}1. Basic Information
Every script package must contain basic information fields:
json
{
"id": "com.example.myscript",
"name": "My Script",
"version": "1.0.0",
"author": "Your Name",
"description": "Script description",
"icon": "icon.png"
}Field Description
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique script identifier, recommend reverse domain format (e.g., com.company.product) |
name | string | ✅ | Script display name |
version | string | ✅ | Version number, recommend semantic versioning (e.g., 1.0.0) |
author | string | ✅ | Author name |
description | string | Optional | Script description |
icon | string | Optional | Icon path, supports relative path or HTTP URL |
2. Event Listeners (events)
Define listeners and handlers for application lifecycle events.
Basic Example
json
{
"events": {
"app/run": {
"action": "$.nodejs.run",
"args": ["server.js", "arg1", "arg2"]
}
}
}Supported Event Types
| Event | Description | Trigger Timing |
|---|---|---|
app/run | Application start event | After iClick app launches |
Field Description
| Field | Type | Required | Description |
|---|---|---|---|
| Event name | object | ✅ | Event handler object (e.g., app/run) |
action | string | ✅ | Command action type |
args | array | ✅ | Command arguments array |
Use Cases
- app/run: Start background services, initialize data, load configurations, etc.
3. Task Definition (scripts)
Define executable tasks in the context menu.
Basic Example
json
{
"scripts": [
{
"id": "open_tool",
"name": "Open Tool",
"command": {
"action": "$.shell.open",
"args": ["Tool.exe", "$.deviceId"]
}
},
{
"id": "sync_data",
"name": "Sync Data",
"command": {
"action": "$.http.post",
"args": [
"https://api.example.com/sync",
{ "deviceId": "$.deviceId" }
]
}
}
]
}Field Description
| Field | Type | Required | Description |
|---|---|---|---|
id | string | ✅ | Unique task identifier |
name | string | ✅ | Task display name, shown in context menu |
command | object | ✅ | Command object |
command.action | string | ✅ | Command action type |
command.args | array | ✅ | Command arguments array |
4. UI Extensions (views)
Add custom buttons to the console interface.
Basic Example
json
{
"views": {
"header/slots": [
{
"name": "Dashboard",
"icon": "dashboard.png",
"command": {
"action": "$.webview.open",
"args": [
"https://dashboard.example.com/",
{ "width": 1200, "height": 800 }
]
}
}
]
}
}Supported Slot Positions
| Slot Position | Description |
|---|---|
header/slots | Console header button area |
Field Description
| Field | Type | Required | Description |
|---|---|---|---|
name | string | ✅ | Button display name |
icon | string | ✅ | Button icon path |
command | object | ✅ | Command object |
5. Settings Panel (settings)
Add visual configuration forms for scripts. After saving, a settings.json file will be automatically generated in the script directory.
Supported Configuration Types
| Type | Description |
|---|---|
text | Single-line text input |
number | Number input |
checkbox | Checkbox |
select | Dropdown select |
textarea | Multi-line text |
file | File selector |
path | Folder selector |
date | Date picker |
time | Time picker |
datetime | Datetime picker |
📖 Detailed Documentation
See Settings Panel for complete configuration types, field definitions, reading methods, and best practices.
Related Documentation
- Script Integration Overview - Learn about script extension mechanism
- Operations - Command syntax and usage
- Settings Panel - Detailed settings documentation
- Complete Examples - Real-world scenario examples
- API Reference - WebSocket API documentation