incubator-airflow/docs/usage-cli.rst

71 строка
2.2 KiB
ReStructuredText
Исходник Ответственный История

Этот файл содержит неоднозначные символы Юникода!

Этот файл содержит неоднозначные символы Юникода, которые могут быть перепутаны с другими в текущей локали. Если это намеренно, можете спокойно проигнорировать это предупреждение. Используйте кнопку Экранировать, чтобы подсветить эти символы.

.. Licensed to the Apache Software Foundation (ASF) under one
or more contributor license agreements. See the NOTICE file
distributed with this work for additional information
regarding copyright ownership. The ASF licenses this file
to you under the Apache License, Version 2.0 (the
"License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
.. http://www.apache.org/licenses/LICENSE-2.0
.. Unless required by applicable law or agreed to in writing,
software distributed under the License is distributed on an
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
KIND, either express or implied. See the License for the
specific language governing permissions and limitations
under the License.
Using the Command Line Interface
================================
This document is meant to give an overview of all common tasks while using the CLI.
Set Up connection to a remote Airflow instance
----------------------------------------------
For some functions the CLI can use :doc:`the REST API <rest-api-ref>`. To configure the CLI to use the API
when available configure as follows:
.. code-block:: ini
[cli]
api_client = airflow.api.client.json_client
endpoint_url = http://<WEBSERVER>:<PORT>
Set Up Bash/Zsh Completion
--------------------------
When using bash (or ``zsh``) as your shell, ``airflow`` can use
`argcomplete <https://argcomplete.readthedocs.io/>`_ for auto-completion.
For `global activation <https://github.com/kislyuk/argcomplete#activating-global-completion>`_ of all argcomplete enabled python applications run:
.. code-block:: bash
sudo activate-global-python-argcomplete
For permanent (but not global) airflow activation, use:
.. code-block:: bash
register-python-argcomplete airflow >> ~/.bashrc
For one-time activation of argcomplete for airflow only, use:
.. code-block:: bash
eval "$(register-python-argcomplete airflow)"
.. image:: img/cli_completion.gif
If youre using ``zsh``, add the following to your ``.zshrc``:
.. code-block:: bash
autoload bashcompinit
bashcompinit
eval "$(register-python-argcomplete airflow)"