As the Cloud Shell is similar to the bash shell, you can use similar bash supported commands.
For your ask, you can try the script
command to record your session. This will capture all your commands and output to a file you specify. However, you need to ensure you run the script
command to start recording and exit once you want to end. If you want to append the commands to the same file use script -a filename
to the same file name you specify.
Below is the screenshot for your reference. Hope this helps.
Record session:
View Recorded Session:
Please 'Accept as answer' if it helped, so that it can help others in the community looking for help on similar topics.