GI-DOCGEN(1)
β¨ GI-DOCGEN π (section 1 of the manual, bestie)
okay so you found gi-docgen and you're about to have the cutest little API docs, no cap. this is the manual page for the gi-docgen user command, and it's gonna be a whole journey. grab a strawberry π and let's go.
π NAME π
gi-docgen β a documentation generator using gobject-introspection. literally that's her whole job description and she ATE.
πΈ SYNOPSIS πΈ
gi-docgen COMMAND [OPTION...] GIR_FILE
π¦ DESCRIPTION π¦
GI-DocGen is a document generator for GObject-based libraries. GObject is the base type system of the GNOME project. GI-DocGen uses the machine readable introspection data provided by GObject-based libraries in order to generate the API reference of these libraries, as well as other ancillary documentation.
The main gi-docgen executable provides various subcommands to access all its functionality.
it's giving "one binary, many little side quests" π
π Common options π
All commands have the following options β yes, all of them, they're the shared besties:
--quietβ do not print details of the current operation. shhh, she's being mysterious π€«--fatal-warningsβ make warnings fatal errors. dramatic? yes. effective? also yes π--helpβ print command line help. the classic, the icon, the moment β¨
π The generate command π
The generate command provides the main functionality of gi-docgen. she's the main character, fr fr π
gi-docgen generate [ OPTIONS ] [ GIR_FILE ]
The generate command will parse the given GIR file, as well as its dependencies, and build an API reference for the namespace it finds in the introspection data. Projects can use a configuration file to control aspects of the output, as well as provide additional content that should be included in the documentation.
π options:
--config=FILEβ use the given project configuration file--content-dir=PATHβ specify the directory where the content files listed in the project configuration file can be found--templates-dir=PATHβ specify the directory where the templates used to generate the documentation can be found--theme-name=NAMEβ specify the template name to be used when generating the documentation, overriding the project's configuration--output-dir=PATHβ create the documentation under the given directory--no-namespace-dirβ generate all documentation files directly under the output directory, instead of creating a directory using the namespace name and version. flat structure enjoyers rise π--add-include-path=PATHβ add a directory to the path which the scanner uses to find GIR files. Can be used multiple times to specify multiple directories--section=NAMEβ generate the documentation only for the given section. Can be used multiple times to specify multiple sections. The supported sections arealiases,bitfields,classes,domains,enums,interfaces,structsandunions. Special values areall, meaning all sections (the default); andnone, meaning no section. pick your faves, it's a vibe check π--dry-runβ parse theGIR_FILEwithout generating the documentation. window shopping, we love to see it π
π§ The gen-index command π§
The gen-index command generates an index of symbols and terms that can be used to search inside the documentation generated by gi-docgen. it's the search bar of your dreams.
gi-docgen gen-index [ OPTIONS ] [ GIR_FILE ]
The generated index is a JSON formatted file is called index.json.
π options:
--config=FILEβ use the given project configuration file--content-dir=PATHβ specify the directory where the content files listed in the project configuration file can be found--output-dir=PATHβ create the index under the given directory--add-include-path=PATHβ add a directory to the path which the scanner uses to find GIR files. Can be used multiple times to specify multiple directories--dry-runβ parse theGIR_FILEwithout generating the documentation
π«Ά The check command π«Ά
The check command runs a series of checks on the introspection file, to verify that public API is properly documented. It can be used as part of a test suite. she's the friend who proofreads your essay before you submit it ππ
gi-docgen check [ OPTIONS ] [ GIR_FILE ]
π options:
--config=FILEβ use the given project configuration file--add-include-path=PATHβ add a directory to the path which the scanner uses to find GIR files. Can be used multiple times to specify multiple directories
π₯ The serve command π₯
The serve command generates an API reference and serves it using a local HTTP server. docs + localhost = the sleepover π
gi-docgen serve [ OPTIONS ] [ GIR_FILE ]
The serve command will parse the given GIR file, as well as its dependencies, and build an API reference for the namespace it finds in the introspection data. Once the reference has been built successfully, gi-docgen will start a local HTTP server pointing at the output directory.
π options:
--bind=ADDRESSβ use the given address for the HTTP server; the default is127.0.0.1--port=PORTβ use the given port for the HTTP server; the default is8080
β The help command β
The help command prints out the command line help. If you don't specify any command or option when invoking gi-docgen, the help command will be implied. she's always there for you, lurking, ready π«Ά
gi-docgen help [ OPTIONS ] [ COMMAND ]
If no command is specified, help will print out the list of commands.
If a command is specified, help will print out the command line help for that program.
π options:
--versionβ print out the version ofgi-docgen
π EXIT STATUS π
0β The command was successful. slay β1β Error, or warning, was generated. not slay π
π± ENVIRONMENT VARIABLES π±
The gi-docgen executable uses the XDG_DATA_DIRS and XDG_DATA_HOME environment variables to search for introspection data included in the GIR file.
If the GIDOCGEN_DEBUG environment variable is set, gi-docgen will print out additional messages, which can be helpful when debugging issues. turn it on when things get weird, iykyk π¦
π SEE ALSO π
- GI-DocGen:
http://gnome.pages.gitlab.gnome.org/gi-docgen/ - GObject-Introspection:
https://gi.readthedocs.org/ - GObject:
https://developer.gnome.org/gobject/
and that's the whole page bestie, you're officially caught up π this manual came to you from gi-docgen 2021.3 (that's the source + version, the whole pedigree π) and she's filed under GI-DOCGEN(1) like the legend she is. periodt β¨
π¦ where this page comes from
- arch rolling: gi-docgen 2026.1-1 Β· Apache-2.0 OR GPL-3.0-or-later
- debian bookworm: gi-docgen 2023.1+ds-2 Β· CC-BY-SA-3.0
- debian trixie: gi-docgen 2025.3-1 Β· CC-BY-SA-3.0
- epel 10: gi-docgen 2025.5-1.el10_2 Β· (Apache-2.0 OR GPL-3.0-or-later) AND BSD-2-Clause AND MIT AND CC0-1.0
- epel 9: gi-docgen 2025.5-1.el9 Β· (Apache-2.0 OR GPL-3.0-or-later) AND BSD-2-Clause AND MIT AND CC0-1.0
- fedora 43: gi-docgen 2025.4-5.fc43 Β· (Apache-2.0 OR GPL-3.0-or-later) AND BSD-2-Clause AND MIT AND CC0-1.0
- fedora 43: gi-docgen 2026.1-3.fc43 Β· (Apache-2.0 OR GPL-3.0-or-later) AND BSD-2-Clause AND MIT AND CC0-1.0
- fedora 44: gi-docgen 2026.1-3.fc44 Β· (Apache-2.0 OR GPL-3.0-or-later) AND BSD-2-Clause AND MIT AND CC0-1.0
- opensuse-leap 16.0: python3-gi-docgen 2025.5-160000.1.1 Β· (Apache-2.0 OR GPL-3.0-or-later) AND CC0-1.0 AND MIT AND OFL-1.1
- ubuntu noble: gi-docgen 2023.3+ds-1 Β· CC-BY-SA-3.0
- ubuntu questing: gi-docgen 2025.3-1
- ubuntu resolute: gi-docgen 2026.1-1
- ubuntu stonking: gi-docgen 2026.1-1
- π the page's license: Apache-2.0 OR GPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms