Running AutoIntegrate from the Command Line

Running AutoIntegrate from the Command Line

You can fully automate AutoIntegrate by launching PixInsight with a script, executing your JSON‑defined workflows, and then exiting—no manual interaction required.

In the GitHub repository GitHub - jarmoruuth/TestAutoIntegrate: Scripts and data to test AutoIntegrate there is a sample script runcmdline.js. That script reads a runcmdline.txt file that specifies the Json files to run. Json files are then executed by the AutoIntegrate script. Json files can be created using the AutoIntegrate script.


1. Repository Layout

TestAutoIntegrate/ 
├─ runcmdline/ 
│ ├─ runcmdline.js 
│ ├─ runcmdline.txt  ← input file to runcmdline.js
│ └─ results/ ← logs for each run 
  • runcmdline.js
    Reads runcmdline.txt, loads each JSON file you list, invokes AutoIntegrate, and writes a per‑run log into results/.

  • runcmdline.txt
    A simple text file listing one or more AutoIntegrate JSON workflows, one per line, optionally followed by a comma and a friendly test name.


2. Configuring runcmdline.txt

Each line in runcmdline.txt has the format:

<path-to-json>[, <test-name>]

  • path-to-json
    Absolute or relative path to your AutoIntegrate configuration JSON.

  • test-name (optional)
    A short label that described the test run.

Example:

D:/Telescopes/test/LRGB_bin2x2/AutoSetupTestDefault.json, LRGB


3. Adjusting the Include Path

By default, runcmdline.js expects the AutoIntegrate source at Windows default installation directory:

C:/Program Files/PixInsight/src/scripts/AutoIntegrate/AutoIntegrate.js

If your directory structure differs (for example, you’re using a different operating system), edit the #include line at the top of runcmdline.js to point to the correct location.

4. Running the Script

Invoke PixInsight with the --run option and --force-exit to ensure it quits when done:

"C:\Program Files\PixInsight\bin\PixInsight.exe" \
  --run="C:\GitHub\TestAutoIntegrate\runcmdline\runcmdline.js" \
  --force-exit

5. Output

  • A new results/ subdirectory is created (if it doesn’t already exist).
  • Each test produces a separate log file with name autotest and timestamp, e.g.:

results/autotest_20250415_235902.log

With this setup, you can batch‑process any number of AutoIntegrate JSON workflows unattended—ideal for nightly runs, CI pipelines, or large‑scale reprocessing.