Modify a blend file via console outside of GUI
You can also build bpy as a standalone module using cmake, and use it in a python script with import bpy
This is pretty similar to doing blender -b -P customscript.py