Commit 5592fd6f authored by Michal Čihař's avatar Michal Čihař

Include wlc cli documentation

Signed-off-by: default avatarMichal Čihař <michal@cihar.com>
parent 6e3796d6
......@@ -3,6 +3,10 @@
Weblate's Web API
=================
.. index::
single: REST
single: API
REST API
--------
......@@ -12,6 +16,7 @@ REST API
The API is accessible on the ``/api/`` URL and it is based on
`Django REST framework <http://www.django-rest-framework.org/>`_.
You can use it directly or by :ref:`wlc`.
Authentication and generic parameters
+++++++++++++++++++++++++++++++++++++
......
......@@ -18,6 +18,7 @@ Contents:
faq
formats
api
wlc
changes
contributing
license
......
.. index::
single: wlc
single: API
.. _wlc:
Weblate Client
==============
.. program:: wlc
Synopsis
++++++++
.. code-block:: text
wlc [parameter] <command> [options]
Commands actually indicate which operation should be performed.
Description
+++++++++++
Weblate Client is Python library and command line utility to manage Weblate remotely.
The command line utility can be invoked as :command:`wlc`.
Global options
--------------
The program accepts following global options, which must be entered before subcommand.
.. option:: --format {csv,json,text,html}
Specify output format.
.. option:: --url URL
Specify API URL. Overrides value from configuration file, see :ref:`files`.
The URL should end with ``/api/``, for example ``https://hosted.weblate.org/api/``.
.. option:: --key KEY
Specify API user key to use. Overrides value from configuration file, see :ref:`files`.
You can figure out your key in your profile in Weblate.
.. option:: --config PATH
Override path to configuration file, see :ref:`files`.
.. option:: --config-section SECTION
Override section to use in configuration file, see :ref:`files`.
Subcommands
-----------
Currently following subcommands are available:
.. option:: version
Prints current version.
.. option:: list-languages
List used languages in Weblate.
.. option:: list-projects
List projects in Weblate.
.. option:: list-components
List components in Weblate.
.. option:: list-translations
List translations in Weblate.
.. _files:
Files
+++++
:file:`~/.config/wlc`
User configuration file
:file:`/etc/xdg/wlc`
Global configration file
The program follows XDG specification, so you can adjust placement of config files
by environment variables ``XDG_CONFIG_HOME`` or ``XDG_CONFIG_DIRS``.
Following settings can be configured in the ``[wlc]`` section (you can
customize this by :option:`--config-section`):
.. describe:: key
API KEY to access Weblate.
.. describe:: url
API server URL, defaults to ``http://127.0.0.1:8000/api/``.
The configuration file is INI file, for example:
.. code-block:: ini
[wlc]
url = https://hosted.weblate.org/api/
key = APIKEY
Examples
++++++++
Print current program version:
.. code-block:: sh
$ wlc version
version: 0.1
List all projects:
.. code-block:: sh
$ wlc list-projects
name: Hello
slug: hello
source_language: en
url: http://example.com/api/projects/hello/
web: http://weblate.org/
web_url: http://example.com/projects/hello/
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment