=================
Command reference
=================


Anaconda Client is the command line interface (CLI) to Anaconda
Repository. You can use it to log in, log out, manage your
account, upload files, generate access tokens, view tokens and
other tasks.

The full Client command reference is shown below. You can also
view this command reference in a terminal window with the
command ``anaconda --help`` or ``anaconda -h``.

See also: `Anaconda Cloud API Reference
<https://api.anaconda.org/docs>`_.

.. contents::
   :local:
   :depth: 2


.. _repo-cli-anaconda:

anaconda
========

Repository command line manager.

.. command-json-output:: anaconda --json-help

Authentication
==============

auth
----

Manage authorization tokens.

.. command-json-output:: anaconda auth --json-help

See also :ref:`repo-glossary-token`.


login
-----

Authenticate a user.

.. command-json-output:: anaconda login --json-help

whoami
------

Print the information of the current user.

.. command-json-output:: anaconda whoami --json-help

Informational
=============

show
----

Show information about an object.

.. command-json-output:: anaconda show --json-help

EXAMPLE::

    anaconda show anaconda
    anaconda show anaconda/python
    anaconda show anaconda/python/2.7.5
    anaconda show anaconda/python/2.7.5/linux-64/python-2.7.5-0.tar.bz2

search
------

Search Repository for packages.

.. command-json-output:: anaconda search --json-help

config
------

Binstar configuration.

.. command-json-output:: anaconda config --json-help

Client configuration
^^^^^^^^^^^^^^^^^^^^
Get, set, remove or show the Client configuration.

Client sites
^^^^^^^^^^^^

Client sites are a mechanism to allow users to quickly switch
between Repository instances. This can be used with the on-site `Anaconda
Enterprise <https://www.anaconda.com/enterprise/>`_.

*  Invoke the anaconda command with the ``-s/--site`` option like this::

       anaconda -s site_name whoami

* Set a site as the default::

    anaconda config --set default_site site_name
    anaconda whoami

Add a Client site
"""""""""""""""""

After installing `Anaconda Enterprise
<https://www.anaconda.com/enterprise/>`_, you can add a
site named "site\_name" as follows::

  anaconda config --set sites.site_name.url
  "http://<anaconda-enterprise-ip>:<port>/api"
  anaconda config --set default_site site_name

Site options vs. global options
"""""""""""""""""""""""""""""""

All options can be set as global options that affect all sites or
site options that affect only one site.

By default, options are set globally::

    anaconda config --set OPTION VALUE

If you want the option to be limited to a single site, prefix the
option with ``sites.site_name``::

    anaconda config --set sites.site_name.OPTION VALUE

Common Client configuration options
"""""""""""""""""""""""""""""""""""

* Url---Set the Anaconda API URL. Default is
  ``https://api.anaconda.org``.

* Verify_ssl---Perform SSL validation on the https requests.
  Verify\_ssl may be ``True``, ``False`` or a path to a root CA
  pem file.


Toggle auto\_register when doing anaconda upload
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The default is ``yes``, automatically creating a new package when
uploading. If ``no``, then an upload fails if the package name
does not already exist on the server::

  anaconda config --set auto_register yes|no

Package management
==================

package
-------

Repository package utilities.

.. command-json-output:: anaconda package --json-help

.. _repo-cli-upload:

upload
------

Upload packages to Repository.

.. command-json-output:: anaconda upload --json-help

::

    anaconda upload CONDA_PACKAGE_1.bz2
    anaconda upload notebook.ipynb
    anaconda upload environment.yml

See also:

* :ref:`repo-uploading-conda-packages`.
* :ref:`repo-uploading-pypi-packages`.


label
-----

Manage your Repository channels.

.. command-json-output:: anaconda label --json-help

copy
----

Copy packages from one account to another.

.. command-json-output:: anaconda copy --json-help
