Index: /trunk/Nebulous-Server/Build.PL
===================================================================
--- /trunk/Nebulous-Server/Build.PL	(revision 13256)
+++ /trunk/Nebulous-Server/Build.PL	(revision 13257)
@@ -111,4 +111,5 @@
         bin/neb-cp
         bin/neb-df
+        bin/neb-locate
         bin/neb-initdb
         bin/neb-ls
Index: /trunk/Nebulous-Server/Changes
===================================================================
--- /trunk/Nebulous-Server/Changes	(revision 13256)
+++ /trunk/Nebulous-Server/Changes	(revision 13257)
@@ -2,4 +2,5 @@
 
 0.05
+    - add neb-locate
     - change all Nebulous::Client public methods to behave in list context
     - rework the getmountedvol() stored procedure to attempt to work around
Index: /trunk/Nebulous-Server/MANIFEST
===================================================================
--- /trunk/Nebulous-Server/MANIFEST	(revision 13256)
+++ /trunk/Nebulous-Server/MANIFEST	(revision 13257)
@@ -13,4 +13,5 @@
 bin/neb-df
 bin/neb-initdb
+bin/neb-locate
 bin/neb-ls
 bin/neb-mv
Index: /trunk/Nebulous-Server/Todo
===================================================================
--- /trunk/Nebulous-Server/Todo	(revision 13256)
+++ /trunk/Nebulous-Server/Todo	(revision 13257)
@@ -27,4 +27,5 @@
 - add multiple regex and/or glob support to neb-ls, eg. neb-ls -r 'foo.*' -r 'bar$'
 - store the key name as an xattr on the actual on disk file
+- add an neb-locate --reverse option to map uri/paths into keys
 
 distant future
Index: /trunk/Nebulous/Build.PL
===================================================================
--- /trunk/Nebulous/Build.PL	(revision 13256)
+++ /trunk/Nebulous/Build.PL	(revision 13257)
@@ -111,4 +111,5 @@
         bin/neb-cp
         bin/neb-df
+        bin/neb-locate
         bin/neb-initdb
         bin/neb-ls
Index: /trunk/Nebulous/Changes
===================================================================
--- /trunk/Nebulous/Changes	(revision 13256)
+++ /trunk/Nebulous/Changes	(revision 13257)
@@ -2,4 +2,5 @@
 
 0.05
+    - add neb-locate
     - change all Nebulous::Client public methods to behave in list context
     - rework the getmountedvol() stored procedure to attempt to work around
Index: /trunk/Nebulous/MANIFEST
===================================================================
--- /trunk/Nebulous/MANIFEST	(revision 13256)
+++ /trunk/Nebulous/MANIFEST	(revision 13257)
@@ -13,4 +13,5 @@
 bin/neb-df
 bin/neb-initdb
+bin/neb-locate
 bin/neb-ls
 bin/neb-mv
Index: /trunk/Nebulous/Todo
===================================================================
--- /trunk/Nebulous/Todo	(revision 13256)
+++ /trunk/Nebulous/Todo	(revision 13257)
@@ -27,4 +27,5 @@
 - add multiple regex and/or glob support to neb-ls, eg. neb-ls -r 'foo.*' -r 'bar$'
 - store the key name as an xattr on the actual on disk file
+- add an neb-locate --reverse option to map uri/paths into keys
 
 distant future
Index: /trunk/Nebulous/bin/neb-locate
===================================================================
--- /trunk/Nebulous/bin/neb-locate	(revision 13257)
+++ /trunk/Nebulous/bin/neb-locate	(revision 13257)
@@ -0,0 +1,172 @@
+#!/usr/bin/env perl
+
+# Copyright (C) 2007  Joshua Hoblitt
+#
+# $Id: neb-locate,v 1.1 2007-05-05 00:27:37 jhoblitt Exp $
+
+use strict;
+use warnings FATAL => qw( all );
+
+use vars qw( $VERSION );
+$VERSION = '0.01';
+
+use Nebulous::Client;
+
+use Getopt::Long qw( GetOptions :config auto_help auto_version );
+use Pod::Usage qw( pod2usage );
+
+my ($all, $path, $server, $volume);
+
+$server = $ENV{'NEB_SERVER'} unless $server;
+
+GetOptions(
+    'all|a'         => \$all,
+    'path|p'        => \$path,
+    'server|s=s'    => \$server,
+    'volume=s'      => \$volume,
+) || pod2usage( 2 );
+
+my $key = shift;
+
+pod2usage( -msg => "Unknown option: @ARGV", -exitval => 2 ) if @ARGV;
+pod2usage( -msg => "Required options: --server <URL> <key>",
+        -exitval => 2 )
+        unless defined $server and defined $key;
+
+my $neb = Nebulous::Client->new(
+    proxy => "$server",
+);
+
+die "can't connected to Nebulous Server: $server"
+    unless defined $neb;
+
+my $uris;
+if (defined $volume) {
+    $uris = $neb->find_instances($key, $volume);
+} else {
+    $uris = $neb->find_instances($key);
+}
+
+unless (defined $uris) {
+    warn "no instances found\n";
+    exit 1;
+}
+
+my @files;
+if (defined $all) { 
+    # print all instances
+    if (defined $path) {
+        @files = map {URI->new($_)->file if $_} @$uris;
+    } else {
+        @files = @$uris;
+    }
+} else {
+    # print just one
+    if (defined $path) {
+        @files = URI->new(@$uris[0]);
+    } else {
+        @files = @$uris[0];
+    }
+}
+
+print join(" ", @files), "\n";
+
+__END__
+
+=pod
+
+=head1 NAME
+
+neb-locate - list URIs|paths to Nebulous key instances
+
+=head1 SYNOPSIS
+
+    neb-locate [--server <URL>] [--volume <name>] [--all] [--path] <key>
+
+=head1 DESCRIPTION
+
+This program will lookup the URIs|paths associated with C<<key>> and list them. By default only one instance is listed.
+
+=head1 OPTIONS
+
+=over 4
+
+=item * --all|-a
+
+This flag causes all found instances to be listed.  By default only one (if any
+are found) is reported.
+
+Optional.
+
+=item * --path|-p
+
+This flag causes instances to be listed as C<paths> instead of C<URI>s.
+
+Optional.
+
+=item * --server|-s <URL>
+
+URL of the Nebulous server to connect to.
+
+Optional if the appropriate environment variable is set.
+
+=item * --volume <name>
+
+Restrict search for instances to this Nebulous volume.
+
+Optional.
+
+=back
+
+=head1 ENVIRONMENT
+
+These environment variables may be used in place of the specified command line
+options.  All command line option will override the corresponding environment
+value.
+
+=over 4
+
+=item * C<NEB_SERVER>
+
+Equivalent to --server|-s
+
+=back
+
+=head1 CREDITS
+
+Just me, myself, and I.
+
+=head1 SUPPORT
+
+Please contact the author directly via e-mail.
+
+=head1 AUTHOR
+
+Joshua Hoblitt <jhoblitt@cpan.org>
+
+=head1 COPYRIGHT
+
+Copyright (C) 2007  Joshua Hoblitt.  All rights reserved.
+
+This program is free software; you can redistribute it and/or modify it under
+the terms of the GNU General Public License as published by the Free Software
+Foundation; either version 2 of the License, or (at your option) any later
+version.
+
+This program is distributed in the hope that it will be useful, but WITHOUT ANY
+WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+PARTICULAR PURPOSE.  See the GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License along with
+this program; if not, write to the Free Software Foundation, Inc., 59 Temple
+Place - Suite 330, Boston, MA  02111-1307, USA.
+
+The full text of the license can be found in the L<perlgpl> Pod as supplied
+with Perl 5.8.1 and later.
+
+=head1 SEE ALSO
+
+L<Nebulous::Server>, L<neb-initdb>, L<neb-addvol>, L<nebdiskd>, L<neb-df>,
+L<neb-touch>
+
+=cut
