There are times when you need your library to be first in the library list when a command runs. You can write some code that removes your library from the library list. (Monitor for an error if it's not already in there.) Then add your library to the top of the library list. At the end of the program, reset the library list to the order it had when the program started.
Or you can write no code. The Product Library (PRDLIB) parameter on the Create Command (CRTCMD) or Change Command (CHGCMD) command allows you to specify a single library that goes at the top of the library list. The only libraries that will end up higher on the list are the libraries in system value QSYSLIBL. When the command is complete, the library is automatically removed, even if the user does an end request from the system request menu. For example:
CHGCMD(MYLIB/MYCMD) + PRDLIB(MYLIB)