start.bat / start.sh — Usage

  Windows:  Double-click start.bat or run:  start.bat
  Linux/macOS:  ./start.sh

  What it does:
  - Runs cli.js in the current directory.
  - Uses Bun if installed, otherwise Node.js.
  - If neither is installed, installs Bun automatically (Windows: PowerShell; Linux/macOS: curl).

CLI Arguments:

  --config=<path>       Specify config file path (default: dist/config.json)
  --<key>=<value>       Override config value (e.g. --API_KEY=xxx --debug=true)
  --json                Output logs in JSON format (no colors, no truncation)
  -h, --help            Show help message

Examples:

  start.bat
  start.bat --API_KEY=your_api_key
  start.bat --config=./my-config.json
  start.bat --json --API_KEY=your_api_key
  ./start.sh --help

JSON Mode Output Format:

  When using --json, log entries are output as JSON lines with the following fields:
  - createdAt: ISO 8601 timestamp with timezone (e.g. "2026-03-16T14:36:51.260Z")
  - messageId: Unique message identifier
  - level: Log level (info, error)
  - name: Node/service name
  - method: Method name being called
  - message: Log message
  - raw: Raw data (optional)
  - callSite: Call site identifier


Configuration:

  1. Config file: Edit config.json to set default values
  2. CLI overrides: Pass --key=value to override config values
  3. Interactive input: If a required field is missing, you will be prompted to enter it

Required Fields:

  Fields marked with "required": true in the input schema will prompt for input
  if not provided via config file or CLI arguments.


Workflow Code (workflow.code.js):

  workflow.code.js is the business logic file that can be modified as needed.
  
  - This file contains the core business logic of the workflow, unminified and editable
  - Available globals:
    - Input: Configuration object (loaded from config.json)
    - invoke(callSite, service, method, params): Helper to invoke external services
  
  - Example:
    const result = await invoke('myCallsite', 'twitter', 'postTweet', { text: 'Hello' });
    node.log(result);
    node.done({ success: true });
  
  After editing, save the file and re-run start.bat / start.sh to apply changes.
