Here is an example ChimeraX Python script to open an atomic structure and a map, rotate and save an image. All it does is run the equivalent ChimeraX commands.  Saving an image can only be done with the GUI or on Linux with the --offscreen startup flag.  If I don't need to save an image I could run it without a gui

chimerax --nogui batch.py

Python code below.

  Tom


# Open a PDB file and an XPLOR map file, rotate and save an image.

from chimerax.core.commands import run

pdb_path = '~/Downloads/ChimeraX/PDB/1grl.cif'
map_path = '~/Downloads/ChimeraX/EMDB/emd_1080.map'

models = run(session, f'open {pdb_path}')
m = models[0]
print(f'Opened {m.name} with {m.num_atoms} atoms') 

maps = run(session, f'open {map_path}')
v = maps[0]
sx,sy,sz = v.data.size
print(f'Opened {v.name} with grid size {sx}, {sy}, {sz}') 

run(session, 'turn y 90')
run(session, 'save image.png')