2022-08-31 19:59:03 +00:00
|
|
|
:orphan:
|
|
|
|
|
|
|
|
############################
|
|
|
|
Command-line Interface (CLI)
|
|
|
|
############################
|
|
|
|
|
|
|
|
**Audience:** Users looking to create a command line interface (CLI) for their application.
|
|
|
|
|
|
|
|
----
|
|
|
|
|
|
|
|
**************
|
|
|
|
What is a CLI?
|
|
|
|
**************
|
|
|
|
|
|
|
|
A Command-line Interface (CLI) is an user interface (UI) in a terminal to interact with a specific program.
|
|
|
|
|
|
|
|
.. note::
|
|
|
|
|
2024-02-09 15:54:54 +00:00
|
|
|
The Lightning guideline to build CLI is `lightning_app <VERB> <NOUN> ...` or `<ACTION> <OBJECT> ...`.
|
2022-08-31 19:59:03 +00:00
|
|
|
|
|
|
|
As an example, Lightning provides a CLI to interact with your Lightning Apps and the `lightning.ai <https://lightning.ai/>`_ platform as follows:
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
main
|
|
|
|
├── fork - Forks an App.
|
|
|
|
├── init - Initializes a Lightning App and/or Component.
|
|
|
|
│ ├── app
|
|
|
|
│ ├── component
|
|
|
|
│ ├── pl-app - Creates an App from your PyTorch Lightning source files.
|
|
|
|
│ └── react-ui - Creates a React UI to give a Lightning Component a React.js web UI
|
|
|
|
├── install - Installs a Lightning App and/or Component.
|
|
|
|
│ ├── app
|
|
|
|
│ └── component
|
2023-07-27 22:16:21 +00:00
|
|
|
├── list - Lists Lightning AI self-managed resources (apps)
|
|
|
|
│ └── apps - Lists your Lightning AI Apps.
|
2022-08-31 19:59:03 +00:00
|
|
|
├── login - Logs in to your lightning.ai account.
|
|
|
|
├── logout - Logs out of your lightning.ai account.
|
|
|
|
├── run - Runs a Lightning App locally or on the cloud.
|
|
|
|
│ └── app - Runs an App from a file.
|
|
|
|
├── show - Shows given resource.
|
|
|
|
│ └── logs - Shows cloud application logs. By default prints logs for all currently available Components.
|
|
|
|
├── stop - Stops your App.
|
|
|
|
└── tree - Shows the command tree of your CLI.
|
|
|
|
|
|
|
|
Learn more about `Command-line interfaces here <https://en.wikipedia.org/wiki/Command-line_interface>`_.
|
|
|
|
|
|
|
|
----
|
|
|
|
|
|
|
|
**********
|
|
|
|
Learn more
|
|
|
|
**********
|
|
|
|
|
|
|
|
.. raw:: html
|
|
|
|
|
|
|
|
<div class="display-card-container">
|
|
|
|
<div class="row">
|
|
|
|
|
|
|
|
.. displayitem::
|
|
|
|
:header: Develop a Command Line Interface
|
|
|
|
:description: Learn how to develop a CLI for your App.
|
|
|
|
:col_css: col-md-6
|
|
|
|
:button_link: ../../workflows/build_command_line_interface/index_content.html
|
|
|
|
:height: 150
|
|
|
|
|
|
|
|
.. raw:: html
|
|
|
|
|
|
|
|
</div>
|
|
|
|
</div>
|