gnetlist -g djboxsym subcircuit-schematics other-gnetlist-arguments
This gnetlist back end creates a symbol definition file from the schematics of a hierarchical subcircuit. Use its output as input for djboxsym to create a symbol representing the subcircuit.