Within the sbt shell, use ;
to chain commands:
;project XXX; assembly
Calling from the command line, enclose individual commands with quotes:
sbt "project XXX" assembly
or enclose a whole chain in quotes:
sbt ";project XXX; assembly"
To call a task in subproject XXX
from the context of another project in the shell:
XXX/assembly