Skip to content

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 ​

FieldTypeRequiredDescription
idstring✅Unique script identifier, recommend reverse domain format (e.g., com.company.product)
namestring✅Script display name
versionstring✅Version number, recommend semantic versioning (e.g., 1.0.0)
authorstring✅Author name
descriptionstringOptionalScript description
iconstringOptionalIcon 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 ​

EventDescriptionTrigger Timing
app/runApplication start eventAfter iClick app launches

Field Description ​

FieldTypeRequiredDescription
Event nameobject✅Event handler object (e.g., app/run)
actionstring✅Command action type
argsarray✅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 ​

FieldTypeRequiredDescription
idstring✅Unique task identifier
namestring✅Task display name, shown in context menu
batchstring❌Is it integrated into the batch operation menu
commandobject✅Command object
command.actionstring✅Command action type
command.argsarray✅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 PositionDescription
header/slotsConsole header button area

Field Description ​

FieldTypeRequiredDescription
namestring✅Button display name
iconstring✅Button icon path
commandobject✅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 ​

TypeDescription
textSingle-line text input
numberNumber input
checkboxCheckbox
selectDropdown select
textareaMulti-line text
fileFile selector
pathFolder selector
dateDate picker
timeTime picker
datetimeDatetime picker

📖 Detailed Documentation

See Settings Panel for complete configuration types, field definitions, reading methods, and best practices.


Cooperation: try.catch@foxmail.com