Yeah, so there should be a command to empty your inventory into one of your /chests.
For instance, the command could be /cfill 1
The number (1) being /chest 1
If the /chest 1 happened to be full, it would just fill it up and leave the rest in your inventory.