---
title: Lightning CLI
description: >-
  When running deep learning experiments, there are a couple of good practices
  that are recommended to follow:
canonical: 'https://lightning.ai/docs/pytorch/stable/reference/cli/lightning_cli'
---
# Lightning CLI {#lightning-cli}

## Why use a CLI {#why-use-a-cli}

When running deep learning experiments, there are a couple of good practices that are recommended to follow:

- Separate configuration from source code
- Guarantee reproducibility of experiments

Implementing a command line interface (CLI) makes it possible to execute an experiment from a shell terminal. By having
a CLI, there is a clear separation between the Python source code and what hyperparameters are used for a particular
experiment. If the CLI corresponds to a stable version of the code, reproducing an experiment can be achieved by
installing the same version of the code plus dependencies and running with the same configuration (CLI arguments).

## Basic use {#basic-use}

- [1: Control it all from the CLI](/docs/pytorch/2.6.6/reference/cli/lightning_cli_intermediate.md) — Learn to control a LightningModule and LightningDataModule from the CLI

- [2: Mix models, datasets and optimizers](/docs/pytorch/2.6.6/reference/cli/lightning_cli_intermediate_2.md) — Support multiple models, datasets, optimizers and learning rate schedulers

- [3: Control it all via YAML](/docs/pytorch/2.6.6/reference/cli/lightning_cli_advanced.md) — Enable composable YAMLs

## Advanced use {#advanced-use}

- [YAML for production](/docs/pytorch/2.6.6/reference/cli/lightning_cli_advanced_2.md) — Use the Lightning CLI with YAMLs for production environments

- [Customize for complex projects](/docs/pytorch/2.6.6/reference/cli/lightning_cli_advanced_3.md) — Learn how to implement CLIs for complex projects

- [Extend the Lightning CLI](/docs/pytorch/2.6.6/reference/cli/lightning_cli_expert.md) — Customize the Lightning CLI

## Miscellaneous {#miscellaneous}

- [FAQ](/docs/pytorch/2.6.6/reference/cli/lightning_cli_faq.md) — Frequently asked questions about working with the Lightning CLI and YAML files

---

**Navigation**

- Parent: [Cli](/docs/pytorch/2.6.6/reference/cli.md)
