Skip to content

Commit

Permalink
docs(framework) Add flwr cli docs (#3384)
Browse files Browse the repository at this point in the history
  • Loading branch information
charlesbvll authored Jun 20, 2024
1 parent 88b08f4 commit 0a16d99
Show file tree
Hide file tree
Showing 6 changed files with 21 additions and 8 deletions.
1 change: 1 addition & 0 deletions doc/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,7 @@
"sphinxcontrib.youtube",
"sphinx_reredirects",
"nbsphinx",
"sphinx_click",
]

# Generate .rst files
Expand Down
9 changes: 9 additions & 0 deletions doc/source/ref-api-cli.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
Flower CLI reference
====================

.. _flwr-apiref:

flwr CLI
~~~~~~~~

.. click:: flwr.cli.app:typer_click_object
:prog: flwr
:nested: full

.. _flower-simulation-apiref:

flower-simulation
Expand Down
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,7 @@ rope = "==1.11.0"
semver = "==3.0.2"
sphinx = "==6.2.1"
sphinx-intl = "==2.2.0"
sphinx-click = "==5.1.0"
myst-parser = "==1.0.0"
sphinx-design = "==0.5.0"
sphinx-copybutton = "==0.5.2"
Expand Down
3 changes: 3 additions & 0 deletions src/py/flwr/cli/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
"""Flower command line interface."""

import typer
from typer.main import get_command

from .build import build
from .example import example
Expand All @@ -37,5 +38,7 @@
app.command()(build)
app.command()(install)

typer_click_object = get_command(app)

if __name__ == "__main__":
app()
10 changes: 3 additions & 7 deletions src/py/flwr/cli/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,9 @@ def build(
) -> str:
"""Build a Flower project into a Flower App Bundle (FAB).
You can run `flwr build` without any argument to bundle the current directory:
`flwr build`
You can also build a specific directory:
`flwr build --directory ./projects/flower-hello-world`
You can run ``flwr build`` without any arguments to bundle the current directory,
or you can use ``--directory`` to build a specific directory:
``flwr build --directory ./projects/flower-hello-world``.
"""
if directory is None:
directory = Path.cwd()
Expand Down
5 changes: 4 additions & 1 deletion src/py/flwr/cli/run/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,10 @@ class Engine(str, Enum):
def run(
engine: Annotated[
Optional[Engine],
typer.Option(case_sensitive=False, help="The execution engine to run the app"),
typer.Option(
case_sensitive=False,
help="The engine to run FL with (currently only simulation is supported).",
),
] = None,
use_superexec: Annotated[
bool,
Expand Down

0 comments on commit 0a16d99

Please sign in to comment.