cli.rst 3.22 KB
Newer Older
1 2
.. _cli:

3
Command Line Interface (CLI)
4 5 6 7 8 9 10 11 12 13
============================

In this section it is assumed agkyra is installed and properly setup.

* For installation instructions, go to :ref:`installation`.
* For setup instructions, go to :ref:`setup`.

Agkyra CLI manages the agkyra back-end daemon (the module that
performs the actual syncing).

14
To get help, execute ``agkyra help`` from the command line. To get a list of
15 16 17 18
arguments, run it without any

.. code-block:: console

19 20 21 22 23 24 25 26
    $ agkyra help
    Help on agkyra GUI and CLI
        agkyra         Run agkyra with GUI (equivalent to "agkyra gui")
        agkyra <cmd>   Run a command through agkyra CLI

        To get help for agkyra commands:
            help <cmd>            for an individual command
            help <--list | -l>    for all commands
27 28 29

    Documented commands (type help <topic>):
    ========================================
30
    config  help  pause  shutdown  start  status gui
31 32 33 34 35 36 37 38 39 40 41 42 43 44


The CLI can be used independently or in parallel with the GUI. See
:ref:`guivscli` - for more information.

Commands and examples
---------------------

:command:`config list` - List all (or some) settings

.. code-block:: console

    List all settings

45
    $ agkyra config list
46 47 48 49
    global
      agkyra_dir: /home/user/.agkyra
      default_sync: default
      language: en
50
      ask_to_sync: on
51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70
    cloud default
      url: http://www.example.org/identity/v2.0
      token: us3r-t0k3n
    sync default
      directory: /my/local/dir
      container: remote_container
      cloud: default
    sync old_sync
      dicrectory: /my/old/dir
      container: another_container
      cloud: default

.. note:: Settings are organized in groups: ``global``, ``cloud`` and ``sync``

:command:`config set` - set a setting. Need to specify the exact group path

.. code-block:: console

    Set a new token for cloud "default"

71
    $ agkyra config set cloud default token n3w-us3r-t0k3n
72 73 74 75 76 77 78

:command:`config delete` - delete a setting or group of settings

.. code-block:: console

    Delete the "old_sync" sync

79
    $ agkyra config delete sync old_sync
80 81 82 83 84 85 86 87 88 89 90

:command:`status` - print daemon status. Status may be one of the following:

* ``Syncing``     The syncing daemon is running and is syncing your data
* ``Paused``      The syncing daemon is noticing your changes, but it doesn't sync them
* ``Not running`` No daemons are running

.. code-block:: console

    Check if a daemon is running

91
    $ agkyra status
92 93 94 95 96 97 98 99
    Not running

:command:`start` - launch a daemon if ``not running``, start syncing if ``paused``

.. code-block:: console

    Launch the syncing daemon

100
    $ agkyra start
101 102 103
    No Agkyra daemons running, starting one ... OK
    Syncing

104 105 106 107
..note:: Run "agkyra start daemon" to start a session as a daemon. After that,
    use the CLI from a separate console to manage the session, or launch a GUI.
    The GUI will automatically connect to the running session.

108 109 110 111 112 113
:command:`pause` - stop a daemon from ``syncing``, but keep it running

.. code-block:: console

    Pause a syncing daemon

114
    $ agkyra pause
115 116 117 118 119 120 121 122 123
    Pausing syncer ... OK
    Paused

:command:`shutdown` - shutdown daemon, if it's running (causes the GUI to terminate too)

.. code-block:: console

    Shutdown the daemon

124
    $ agkyra shutdown
125
    Shutting down Agkyra ... Stopped