]> git.rkrishnan.org Git - tahoe-lafs/tahoe-lafs.git/blobdiff - docs/frontends/CLI.rst
Make introducer.furl unguessable. Closes #1802.
[tahoe-lafs/tahoe-lafs.git] / docs / frontends / CLI.rst
index d7f304c0985f788687a1ccc1facea860be67b251..b28556715b65053a8c60ffd6ca6e5d9ac8b23d7c 100644 (file)
@@ -4,6 +4,9 @@ The Tahoe-LAFS CLI commands
 
 1.  `Overview`_
 2.  `CLI Command Overview`_
+
+    1.  `Unicode Support`_
+
 3.  `Node Management`_
 4.  `Filesystem Manipulation`_
 
@@ -41,7 +44,7 @@ CLI Command Overview
 The "``tahoe``" tool provides access to three categories of commands.
 
 * node management: create a client/server node, start/stop/restart it
-* filesystem manipulation: list files, upload, download, delete, rename
+* filesystem manipulation: list files, upload, download, unlink, rename
 * debugging: unpack cap-strings, examine share files
 
 To get a list of all commands, just run "``tahoe``" with no additional
@@ -50,7 +53,40 @@ arguments. "``tahoe --help``" might also provide something useful.
 Running "``tahoe --version``" will display a list of version strings, starting
 with the "allmydata" module (which contains the majority of the Tahoe-LAFS
 functionality) and including versions for a number of dependent libraries,
-like Twisted, Foolscap, pycryptopp, and zfec.
+like Twisted, Foolscap, pycryptopp, and zfec. "``tahoe --version-and-path``"
+will also show the path from which each library was imported.
+
+On Unix systems, the shell expands filename wildcards — ``'*'`` and ``'?'`` —
+before the program is able to read them, which may produce unexpected
+results for many ``tahoe`` comands. We recommend, if you use wildcards,
+to start the path with "``./``", for example "``tahoe cp -r ./* somewhere:``".
+This prevents the expanded filename from being interpreted as an option
+or as an alias, allowing filenames that start with a dash or contain
+colons to be handled correctly.
+
+On Windows, a single letter followed by a colon is treated as a drive
+specification rather than an alias (and is invalid unless a local path is
+allowed in that context). Wildcards cannot be used to specify multiple
+filenames to ``tahoe`` on Windows.
+
+Unicode Support
+---------------
+
+As of Tahoe-LAFS v1.7.0 (v1.8.0 on Windows), the ``tahoe`` tool supports
+non-ASCII characters in command lines and output. On Unix, the command-line
+arguments are assumed to use the character encoding specified by the
+current locale (usually given by the ``LANG`` environment variable).
+
+If a name to be output contains control characters or characters that
+cannot be represented in the encoding used on your terminal, it will be
+quoted. The quoting scheme used is similar to `POSIX shell quoting`_: in
+a "double-quoted" string, backslashes introduce escape sequences (like
+those in Python strings), but in a 'single-quoted' string all characters
+stand for themselves. This quoting is only used for output, on all
+operating systems. Your shell interprets any quoting or escapes used on
+the command line.
+
+.. _`POSIX shell quoting`: http://pubs.opengroup.org/onlinepubs/009695399/utilities/xcu_chap02.html
 
 
 Node Management
@@ -60,8 +96,8 @@ Node Management
 creates a new directory and populates it with files that will allow the
 "``tahoe start``" command to use it later on. This command creates nodes that
 have client functionality (upload/download files), web API services
-(controlled by the 'webport' file), and storage services (unless
-``--no-storage`` is specified).
+(controlled by the '[node]web.port' configuration), and storage services
+(unless ``--no-storage`` is specified).
 
 NODEDIR defaults to ``~/.tahoe/`` , and newly-created nodes default to
 publishing a web server on port 3456 (limited to the loopback interface, at
@@ -75,14 +111,14 @@ That is, it behaves like "``tahoe create-node --no-storage [NODEDIR]``".
 
 "``tahoe create-introducer [NODEDIR]``" is used to create the Introducer node.
 This node provides introduction services and nothing else. When started, this
-node will produce an ``introducer.furl`` file, which should be published to all
-clients.
+node will produce a ``private/introducer.furl`` file, which should be
+published to all clients.
 
 "``tahoe create-key-generator [NODEDIR]``" is used to create a special
 "key-generation" service, which allows a client to offload their RSA key
 generation to a separate process. Since RSA key generation takes several
 seconds, and must be done each time a directory is created, moving it to a
-separate process allows the first process (perhaps a busy webapi server) to
+separate process allows the first process (perhaps a busy web-API server) to
 continue servicing other requests. The key generator exports a FURL that can
 be copied into a node to enable this functionality.
 
@@ -96,8 +132,8 @@ same way as "``tahoe run``".
 
 "``tahoe stop [NODEDIR]``" will shut down a running node.
 
-"``tahoe restart [NODEDIR]``" will stop and then restart a running node. This is
-most often used by developers who have just modified the code and want to
+"``tahoe restart [NODEDIR]``" will stop and then restart a running node. This
+is most often used by developers who have just modified the code and want to
 start using their changes.
 
 
@@ -105,29 +141,25 @@ Filesystem Manipulation
 =======================
 
 These commands let you exmaine a Tahoe-LAFS filesystem, providing basic
-list/upload/download/delete/rename/mkdir functionality. They can be used as
+list/upload/download/unlink/rename/mkdir functionality. They can be used as
 primitives by other scripts. Most of these commands are fairly thin wrappers
-around webapi calls, which are described in `<webapi.rst>`_.
+around web-API calls, which are described in `<webapi.rst>`__.
 
-By default, all filesystem-manipulation commands look in ``~/.tahoe/`` to figure
-out which Tahoe-LAFS node they should use. When the CLI command makes webapi
-calls, it will use ``~/.tahoe/node.url`` for this purpose: a running Tahoe-LAFS
-node that provides a webapi port will write its URL into this file. If you want
-to use a node on some other host, just create ``~/.tahoe/`` and copy that node's
-webapi URL into this file, and the CLI commands will contact that node instead
-of a local one.
+By default, all filesystem-manipulation commands look in ``~/.tahoe/`` to
+figure out which Tahoe-LAFS node they should use. When the CLI command makes
+web-API calls, it will use ``~/.tahoe/node.url`` for this purpose: a running
+Tahoe-LAFS node that provides a web-API port will write its URL into this
+file. If you want to use a node on some other host, just create ``~/.tahoe/``
+and copy that node's web-API URL into this file, and the CLI commands will
+contact that node instead of a local one.
 
 These commands also use a table of "aliases" to figure out which directory
 they ought to use a starting point. This is explained in more detail below.
 
-As of Tahoe-LAFS v1.7 (v1.7.1 on Windows), passing non-ASCII characters to the
-CLI should work. On Unix, the command-line arguments are assumed to use the
-character encoding specified by the current locale.
-
 Starting Directories
 --------------------
 
-As described in `docs/architecture.rst <../architecture.rst>`_, the
+As described in `docs/architecture.rst <../architecture.rst>`__, the
 Tahoe-LAFS distributed filesystem consists of a collection of directories
 and files, each of which has a "read-cap" or a "write-cap" (also known as
 a URI). Each directory is simply a table that maps a name to a child file
@@ -222,9 +254,9 @@ access to your files and directories.
 Command Syntax Summary
 ----------------------
 
-``tahoe add-alias ALIAS DIRCAP``
+``tahoe add-alias ALIAS[:] DIRCAP``
 
-``tahoe create-alias ALIAS``
+``tahoe create-alias ALIAS[:]``
 
 ``tahoe list-aliases``
 
@@ -254,17 +286,23 @@ Command Syntax Summary
 
 ``tahoe backup FROMLOCAL TOPATH``
 
-In these summaries, ``PATH``, ``TOPATH`` or ``FROMPATH`` can be one of::
+In these summaries, ``PATH``, ``TOPATH`` or ``FROMPATH`` can be one of:
 
 * ``[SUBDIRS/]FILENAME`` for a path relative to the default ``tahoe:`` alias;
 * ``ALIAS:[SUBDIRS/]FILENAME`` for a path relative to another alias;
-* ``DIRCAP/[SUBDIRS/]FILENAME`` or ``DIRCAP:./[SUBDIRS/]FILENAME`` for a path relative to a directory cap.
+* ``DIRCAP/[SUBDIRS/]FILENAME`` or ``DIRCAP:./[SUBDIRS/]FILENAME`` for a path
+  relative to a directory cap.
+
+See `CLI Command Overview`_ above for information on using wildcards with
+local paths, and different treatment of colons between Unix and Windows.
+
+``FROMLOCAL`` or ``TOLOCAL`` is a path in the local filesystem.
 
 
 Command Examples
 ----------------
 
-``tahoe add-alias ALIAS DIRCAP``
+``tahoe add-alias ALIAS[:] DIRCAP``
 
  An example would be::
 
@@ -275,6 +313,12 @@ Command Examples
  directory. Use "``tahoe add-alias tahoe DIRCAP``" to set the contents of the
  default ``tahoe:`` alias.
 
+ Since Tahoe-LAFS v1.8.2, the alias name can be given with or without the
+ trailing colon.
+
+ On Windows, the alias should not be a single character, because it would be
+ confused with the drive letter of a local path.
+
 ``tahoe create-alias fun``
 
  This combines "``tahoe mkdir``" and "``tahoe add-alias``" into a single step.
@@ -319,9 +363,9 @@ Command Examples
 
  This uses the python 'webbrowser' module to cause a local web browser to
  open to the web page for the given directory. This page offers interfaces to
- add, download, rename, and delete files in the directory. If no alias or
- path is given, this command opens the root directory of the default
- ``tahoe:`` alias.
+ add, download, rename, and unlink files and subdirectories in that directory.
+ If no alias or path is given, this command opens the root directory of the
default ``tahoe:`` alias.
 
 ``tahoe put file.txt``
 
@@ -356,27 +400,24 @@ Command Examples
 ``tahoe put file.txt tahoe:subdir/foo.txt``
 
 ``tahoe put file.txt DIRCAP/foo.txt``
-or
-``tahoe put file.txt DIRCAP:./foo.txt``
 
 ``tahoe put file.txt DIRCAP/subdir/foo.txt``
-or
-``tahoe put file.txt DIRCAP:./subdir/foo.txt``
 
  These upload the named file and attach them to a subdirectory of the given
  root directory, under the name "``foo.txt``". When a directory write-cap is
- given, you can use either ``/`` or ``:./`` to separate it from the following
- path. When the source file is named "``-``", the contents are taken from stdin.
+ given, you can use either ``/`` (as shown above) or ``:./`` to separate it
+ from the following path. When the source file is named "``-``", the contents
+ are taken from stdin.
 
 ``tahoe put file.txt --mutable``
 
- Create a new mutable file, fill it with the contents of ``file.txt``, and
- print the new write-cap to stdout.
+ Create a new (SDMF) mutable file, fill it with the contents of ``file.txt``,
and print the new write-cap to stdout.
 
 ``tahoe put file.txt MUTABLE-FILE-WRITECAP``
 
- Replace the contents of the given mutable file with the contents of ``file.txt``
and prints the same write-cap to stdout.
+ Replace the contents of the given mutable file with the contents of
``file.txt`` and print the same write-cap to stdout.
 
 ``tahoe cp file.txt tahoe:uploaded.txt``
 
@@ -405,11 +446,15 @@ or
  This copies a file from your ``tahoe:`` root to a different directory, set up
  earlier with "``tahoe add-alias fun DIRCAP``" or "``tahoe create-alias fun``".
 
-``tahoe rm uploaded.txt``
+``tahoe unlink uploaded.txt``
 
-``tahoe rm tahoe:uploaded.txt``
+``tahoe unlink tahoe:uploaded.txt``
 
- This deletes a file from your ``tahoe:`` root.
+ This unlinks a file from your ``tahoe:`` root (that is, causes there to no
+ longer be an entry ``uploaded.txt`` in the root directory that points to it).
+ Note that this does not delete the file from the grid.
+ For backward compatibility, ``tahoe rm`` is accepted as a synonym for
+ ``tahoe unlink``.
 
 ``tahoe mv uploaded.txt renamed.txt``
 
@@ -450,7 +495,7 @@ or
  Same as above, but this time the backup process will ignore any
  filename that will end with '~'. ``--exclude`` will accept any standard
  Unix shell-style wildcards, as implemented by the
- `Python fnmatch module <http://docs.python.org/library/fnmatch.html>`_.
+ `Python fnmatch module <http://docs.python.org/library/fnmatch.html>`__.
  You may give multiple ``--exclude`` options.  Please pay attention that
  the pattern will be matched against any level of the directory tree;
  it's still impossible to specify absolute path exclusions.
@@ -523,7 +568,8 @@ Storage Grid Maintenance
 Debugging
 =========
 
-For a list of all debugging commands, use "``tahoe debug``".
+For a list of all debugging commands, use "``tahoe debug``". For more detailed
+help on any of these commands, use "``tahoe debug COMMAND --help``".
 
 "``tahoe debug find-shares STORAGEINDEX NODEDIRS..``" will look through one or
 more storage nodes for the share files that are providing storage for the
@@ -556,3 +602,6 @@ the PYTHONPATH correctly and runs the Python executable.
 "``tahoe debug corrupt-share SHAREFILE``" will flip a bit in the given
 sharefile. This can be used to test the client-side verification/repair code.
 Obviously, this command should not be used during normal operation.
+
+"``tahoe debug trial [OPTIONS] [TESTSUITE]``" will run the tests specified by
+TESTSUITE (defaulting to the whole Tahoe test suite), using Twisted Trial.