# man > sphinx-autogen(1)

[SPHINX-AUTOGEN(1)](https://www.chedong.com/phpMan.php/man/SPHINX-AUTOGEN/1/markdown)                              Sphinx                              [SPHINX-AUTOGEN(1)](https://www.chedong.com/phpMan.php/man/SPHINX-AUTOGEN/1/markdown)



## NAME
       sphinx-autogen - Generate autodoc stub pages

## SYNOPSIS
       **sphinx-autogen** [_options_] <sourcefile> ...

## DESCRIPTION
       **sphinx-autogen**  is  a tool for automatic generation of Sphinx sources that, using the **autodoc**
       extension, document items included in **autosummary** listing(s).

       _sourcefile_ is the path to one or more reStructuredText documents containing  **autosummary**  en‐
       tries with the **:toctree::** option set. _sourcefile_ can be an _fnmatch_-style pattern.

## OPTIONS
### -o <outputdir>
              Directory  to place the output file. If it does not exist, it is created.  Defaults to
              the value passed to the **:toctree:** option.

### -s <suffix>, --suffix <suffix>
              Default suffix to use for generated files. Defaults to **rst**.

### -t <templates>, --templates <templates>
              Custom template directory. Defaults to **None**.

### -i, --imported-members
              Document imported members.

## EXAMPLE
       Given the following directory structure:

          docs
          ├── index.rst
          └── ...
          foobar
          ├── foo
          │   └── __init__.py
          └── bar
              ├── __init__.py
              └── baz
                  └── __init__.py

       and assuming **docs/index.rst** contained the following:

          Modules
          =======

          .. autosummary::
             :toctree: modules

             foobar.foo
             foobar.bar
             foobar.bar.baz

       If you run the following:

          $ PYTHONPATH=. sphinx-autogen docs/index.rst

       then the following stub files will be created in **docs**:

          docs
          ├── index.rst
          └── modules
              ├── foobar.bar.rst
              ├── foobar.bar.baz.rst
              └── foobar.foo.rst

       and each of those files will contain a **autodoc** directive and some other information.

## SEE ALSO
       [**sphinx-build(1)](https://www.chedong.com/phpMan.php/man/sphinx-build/1/markdown)**, [**sphinx-apidoc(1)](https://www.chedong.com/phpMan.php/man/sphinx-apidoc/1/markdown)**

## COPYRIGHT
       2007-2021, Georg Brandl and the Sphinx team




4.3.2                                       Dec 19, 2021                           [SPHINX-AUTOGEN(1)](https://www.chedong.com/phpMan.php/man/SPHINX-AUTOGEN/1/markdown)
