Skip to main content

1.Overview

iClick has a built-in lightweight script management system. Through script extensions, you can:
  • 🎯 Add Custom Buttons - Add quick action buttons to the console header
  • 📋 Extend Context Menu - Add exclusive context menus for devices
  • 🔧 Call External Programs - Launch your automation tools with one click
  • 🌐 Integrate Web Interface - Embed your management panel in iClick
💡 Script Package Format iClick console supports importing script packages with .isx extension. Currently, .isx files are essentially ZIP archives that you can pack using any compression tool.

📦 Script Structure

Each script extension is an independent folder containing configuration files and resources:
Core Files:

2.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:

1. Basic Information

Every script package must contain basic information fields:

Field Description


2. Event Listeners (events)

Define listeners and handlers for application lifecycle events.

Basic Example

Supported Event Types

Field Description

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

Field Description


4. UI Extensions (views)

Add custom buttons to the console interface.

Basic Example

Supported Slot Positions

Field Description


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

📖 Detailed Documentation See Settings Panel for complete configuration types, field definitions, reading methods, and best practices.
  • 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

3.Operations

Operations define the specific actions that scripts will execute. The same instruction structure is used in both task definitions (scripts) and UI extensions (views).

Instruction Structure

All operations contain two required fields:

Supported Operation Types

iClick supports 5 operation types:

$.nodejs.run

Execute Node.js script files.

Syntax

Parameters

Path Rules

  • Relative path: Relative to script package directory
  • Absolute path: Full file path

$.shell.open

Execute external programs or open files.

Syntax

Parameters

Path Rules

  • Relative path: Relative to script package directory
  • Absolute path: Full file path

$.http.get

Send HTTP GET request.

Syntax

Parameters


$.http.post

Send HTTP POST request.

Syntax

Parameters


$.webview.open

Open embedded WebView window.

Syntax

Parameters

Window Options


Magic Variables

You can use magic variables in operation parameters (e.g., in context menus), which will be automatically replaced with actual values at runtime.

Available Variables

Use Cases

Magic variables are particularly useful for scenarios that require current context information:

4.Settings Panel (settings)

The settings panel allows you to add visual configuration forms for scripts. Users can easily modify these settings in the iClick console without manually editing configuration files.

Basic Usage

Add settings field in manifest.json:

Common Field Description

Each configuration item supports the following fields:

Configuration Types

text - Single-line Text Input

Suitable for short text input, such as API Key, URL, etc.
Use Cases:
  • API keys
  • URLs
  • Usernames
  • Short text configuration

number - Number Input

Suitable for number input, such as port numbers, timeout values, etc.
Use Cases:
  • Timeout values
  • Port numbers
  • Quantity limits
  • Time intervals

checkbox - Checkbox

Suitable for boolean (on/off) options.
Use Cases:
  • Feature toggles
  • Enable/disable options
  • Debug mode switches

select - Dropdown Select

Suitable for selecting one value from predefined options.
Special Fields:
  • options: Options array, each option contains label (display text) and value (actual value)
Use Cases:
  • Run mode selection
  • Log levels
  • Theme selection
  • Language selection

textarea - Multi-line Text

Suitable for long text or multi-line content input.
Use Cases:
  • Configuration file content
  • Script code
  • Long text descriptions
  • JSON configuration

file - File Selector

Allows users to select a file.
Use Cases:
  • Certificate files
  • Configuration files
  • Data files
  • Image files

path - Folder Selector

Allows users to select a folder path.
Use Cases:
  • Output directories
  • Working directories
  • Data storage paths
  • Log directories

date - Date Picker

Allows users to select a date.
Value Format: YYYY-MM-DD Use Cases:
  • Start/end dates
  • Expiration dates
  • Scheduled dates

time - Time Picker

Allows users to select time.
Value Format: HH:mm:ss Use Cases:
  • Scheduled task times
  • Daily execution times
  • Reminder times

datetime - Datetime Picker

Allows users to select date and time.
Value Format: YYYY-MM-DD HH:mm:ss Use Cases:
  • Scheduled task times
  • Event times
  • Deadline times

Auto-Generated Config File

When users modify and save settings in the iClick console, the system will automatically generate a settings.json file in the script package directory. File Location:
Generated Config File Example:
Your external program can directly read this file to get user-configured values.

Reading Configuration

Your external program can read the auto-generated settings.json file to obtain user configuration.

Python Example

Node.js Example

C# Example

Best Practices

1. Provide Reasonable Default Values

Provide reasonable default values for all configuration items to ensure scripts work properly without modifying configuration.

2. Use Meaningful Names

Configuration item name should clearly describe the purpose of the configuration.

3. Add Placeholder Hints

Add placeholder to text input boxes to hint users about what to enter.

4. Use Required Fields Appropriately

Only set require: true for truly necessary configuration items.

5. Choose Appropriate Configuration Types

Select the most appropriate configuration type based on actual needs:

5.Complete Examples

This page provides multiple complete script extension examples to help you quickly understand and use the script integration feature.

Example 1: Device Manager

A comprehensive device management script integrating task execution, UI extensions, and settings panel.

manifest.json

Script Structure

6.Vite Bootstrap