This is an example implementation of Golden Retriever - an open source Image Retrieval Engine, located at grire.net
You may use this source for building a commandline based image search engine.
Example command line arguments.
Adding an imagefolder
java -jar ajmg6.jar create ImagePoolName /home/username/YourGrireDb/db /home/username/YourImageFilesFolder 1f multi
Searching for an Image
java -jar ajmg6.jar search ImagePoolName /home/username/YourGrireDb/db /home/username/YourSourceFile.jpg