You should be able to say --help after a --script command line argument and it should print a help page showing usage of the script. But if the script has PWD, there's a runtime error because PWD is not set.
~/fun/2025/xmas/letter
spot9> autoplot --headless --script writeLabelsEnvelope2025.jy --help
welcome to autoplot (v2026a_1)
Jan 21, 2026 10:45:48 AM org.autoplot.AutoplotUI main
INFO: welcome to autoplot (v2026a_1)
Jan 21, 2026 10:45:48 AM org.autoplot.AutoplotUI$140$1 uncaughtException
SEVERE: runtime exception: Traceback (innermost last):
File "<string>", line 24, in ?
NameError: PWD
Traceback (innermost last):
File "<string>", line 24, in ?
NameError: PWD
at org.python.core.Py.NameError(Py.java:182)
at org.python.core.PyFrame.getglobal(PyFrame.java:202)
at org.python.core.PyFrame.getname(PyFrame.java:182)
at org.python.pycode._pyx1.f$0(<string>:24)
at org.python.pycode._pyx1.call_function(<string>)
at org.python.core.PyTableCode.call(PyTableCode.java:217)
at org.python.core.PyCode.call(PyCode.java:14)
at org.python.core.Py.runCode(Py.java:1224)
at org.python.core.Py.exec(Py.java:1250)
at org.python.util.PythonInterpreter.exec(PythonInterpreter.java:135)
at org.autoplot.jythonsupport.JythonUtil.describeScript(JythonUtil.java:1623)
at org.autoplot.jythonsupport.JythonUtil.describeScript(JythonUtil.java:1550)
at org.autoplot.AutoplotUI.printScriptUsage(AutoplotUI.java:5393)
at org.autoplot.AutoplotUI.access$11100(AutoplotUI.java:206)
at org.autoplot.AutoplotUI$140.run(AutoplotUI.java:5275)
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
This is fixed, where printScriptUsage in AutoplotUI didn't set PWD.