Dave Addey's SQLite extension for calculating distance using two pairs of latitude/longitude coordinates for use with the sqlite cli.
$ make
$ sqlite3 -cmd '.load ./distance' example.sqlite
sqlite> SELECT name FROM location ORDER BY DISTANCE(latitude, longitude, 33.8120742,-117.9188774) LIMIT 10;
Dave Addey wrote the SQLite extension. I just wrapped it up for use on the command line.