The Gogo Shell Command sample demonstrates adding a custom command to Liferay Portal's Gogo shell environment. All Liferay Portal installations have a Gogo shell environment, which lets system administrators interact with Liferay Portal's module framework on a local server machine.
For more details on this sample, see the Gogo Shell Command article on Liferay's Developer Network.