AutoDoc Documentation System

Author: InotArt Updated: May 27, 2026

Note

This page assumes you can read basic TOML. If TOML is unfamiliar, read the official TOML site first, or use AI assistance to understand individual values.

AutoDoc only maintains explanatory comments and a small amount of system metadata in configuration files. It is not a configuration editor, and it does not decide whether a value is appropriate for your server.

Why AutoDoc Exists

Qexed is still changing quickly. Configuration fields may be added, migrated, or adjusted often. Maintaining comments by hand in every TOML file is expensive, and old configurations can easily end up with missing comments, stale comments, or comments that no longer match the current behavior.

AutoDoc keeps configuration files readable. When Qexed starts or initializes configuration, it can fill missing fields and write field descriptions, warnings, migration notices, and related notes back into the TOML files.

What It Does

AutoDoc handles these tasks:

  • Generates or updates comments for configuration fields.
  • Writes comments in Chinese or English depending on the effective language.
  • Writes the current Qexed build commit hash.
  • Adds missing fields from the current default configuration.
  • Moves sensitive fields into .secrets and leaves <stored in .secrets> in the main configuration.
  • Writes declared split configuration sections into separate TOML files.

AutoDoc does not do these tasks:

  • It does not modify normal comments outside AutoDoc-managed blocks.
  • It does not optimize your configuration values.
  • It does not fetch documentation from the network.
  • It does not write real secrets from .secrets back into the main configuration file.

When It Runs

AutoDoc runs when Qexed reads or creates a configuration file. Common cases include:

  • First server startup when default configuration is created.
  • Configuration initialization through a startup option.
  • Starting Qexed after an upgrade, when old configuration needs new fields.
  • Starting with a selected language, when configuration comments need to be refreshed.

AutoDoc is enabled by default. You can disable comment updates for the current file with auto_doc_setting_enable, or disable AutoDoc globally through the current version's startup options.

Header Fields

Every TOML configuration file managed by Qexed contains an AutoDoc header:

# ==== AutoDocHeader ====
# Official documentation: https://doc.qexed.com/docs/autodoc/
# Do not modify fields prefixed with auto_doc_system_
# Example: auto_doc_system_lang
# These settings are used for automatically updating the language-specific comments in the config file.
# However, you can modify fields prefixed with auto_doc_setting_
# auto_doc_setting_lang: The language for the current file; if empty, the global language is used
# auto_doc_setting_enable: Enable the AutoDoc feature, which can automatically update comments for fields based on language, version, etc., as well as optional value information
# Comments below "=======================" will not be modified by the system.
# Comments above "=======================" will be modified by the system. Please do not edit them.
# =======================
auto_doc_system_version_hash = "ce1d867cacb7f70f70f1cffb534fae132d6ec57d"
auto_doc_system_lang = "en"
auto_doc_setting_lang = ""
auto_doc_setting_enable = true

auto_doc_system_version_hash

The Qexed build commit hash used when AutoDoc generated or refreshed the file. The program updates this value automatically.

Do not edit this field manually. Changing it does not change the Qexed version and does not trigger upgrade or downgrade behavior.

auto_doc_system_lang

The language actually used for AutoDoc comments in the current file. This is a system field, and Qexed updates it from the global language and the file-level language setting.

auto_doc_setting_lang

The language override for this configuration file.

When empty, the global language is used. For example, if the server normally uses Chinese comments but this file should use English, set:

auto_doc_setting_lang = "en"

The next AutoDoc run updates auto_doc_system_lang to the effective language.

auto_doc_setting_enable

The AutoDoc switch for the current configuration file.

auto_doc_setting_enable = true

When set to false, AutoDoc stops refreshing field description comments in this file, but configuration loading still works. Disabling comment updates does not disable the configuration file itself or any Qexed feature.

Comment Protection Rules

AutoDoc only updates content between specific markers:

# ======= AutoDoc =======
# Server listen address
# =======================
ip = "0.0.0.0:25565"

Comments outside that managed block are preserved:

# ======= AutoDoc =======
# Server listen address
# =======================
# My local test port. AutoDoc will not modify this line.
ip = "0.0.0.0:25565"

Do not put custom comments between # ======= AutoDoc ======= and # =======================. That region is overwritten by AutoDoc.

Field Comment Content

An AutoDoc comment may contain several parts:

  • Base description: what the field is used for.
  • Danger notice: a configuration that can cause clear security or destructive risk.
  • Warning: behavior that administrators should review.
  • Pending deprecation: the field still works but may be removed later.
  • Deprecated: the field is no longer recommended.
  • Migration notice: how to move from old fields or old behavior to the current one.

Example:

# ======= AutoDoc =======
# Enable Mojang online authentication
#
# WARNING:
# Disabling online authentication allows offline usernames and increases impersonation risk.
# =======================
online_mode = true

Adding Missing Fields

After a Qexed upgrade, AutoDoc adds fields that exist in the current default configuration but are missing from your existing file.

Existing values are preserved. Missing fields receive the current version's default values.

After upgrading, review newly added fields and confirm that their defaults are appropriate for your server, especially for security, networking, permissions, player data, and lobby-related settings.

Sensitive Fields and .secrets

Some fields contain sensitive data, such as tokens, database passwords, and proxy keys. AutoDoc moves real values for these fields into a .secrets file and leaves a placeholder in the main configuration:

download_token = "<stored in .secrets>"

If the main configuration is:

config/qexed.toml

The corresponding secrets file is usually:

config/.secrets/qexed.toml

Recommendations:

  • Do not publish the .secrets directory.
  • Do not commit .secrets to a public repository.
  • If a real token or password was already published, rotate it immediately.

Split Configuration Files

Qexed can split large configuration sections into separate TOML files. AutoDoc merges those split files when reading configuration and writes them back out according to the declared split rules.

For example, a future configuration section may be split from:

config/qexed.toml

into:

config/qexed.d/example.toml

Split files are still part of Qexed configuration. Keep their TOML syntax valid, and do not move them into directories AutoDoc does not manage.

Language Selection

AutoDoc chooses the language in this order:

  1. Language explicitly passed when the program starts.
  2. auto_doc_setting_lang in the current file.
  3. Existing auto_doc_system_lang in the current file.
  4. Default language zh-CN.

If you only want Qexed itself to run in a specific language, you usually do not need to edit AutoDoc fields. Only set auto_doc_setting_lang when a single configuration file needs a different comment language.

Recommended Editing Style

Edit actual configuration values and custom comments outside AutoDoc-managed blocks:

# ======= AutoDoc =======
# Server listen address
# =======================
# Local test port
ip = "0.0.0.0:25565"

Avoid these changes:

  • Deleting auto_doc_system_ fields.
  • Editing text inside the # ==== AutoDocHeader ==== ... # ======================= header block.
  • Editing text inside a # ======= AutoDoc ======= ... # ======================= field block.
  • Copying sensitive values from .secrets back into the main configuration and committing them.

FAQ

Will AutoDoc delete my comments?

Not if they are outside AutoDoc-managed blocks. AutoDoc only overwrites its own managed regions.

Why does my configuration contain <stored in .secrets>?

It is a placeholder for a sensitive field. The real value is stored in .secrets, and Qexed overlays it back into the runtime configuration when loading.

Does disabling AutoDoc disable the configuration?

No. auto_doc_setting_enable = false only disables comment refreshing for that file.

Why did new fields appear after an upgrade?

The current Qexed version added configuration fields. AutoDoc fills missing fields from the current default configuration so old files remain complete.

Can I delete AutoDocHeader?

It is not recommended. Even if you delete it, AutoDoc may regenerate it on the next run. If you want to stop comment updates, disable AutoDoc instead of breaking system fields.

Minimal Example

A configuration snippet with custom comments can look like this:

# ==== AutoDocHeader ====
# Official documentation: https://doc.qexed.com/docs/autodoc/
# =======================
auto_doc_system_version_hash = "ce1d867cacb7f70f70f1cffb534fae132d6ec57d"
auto_doc_system_lang = "en"
auto_doc_setting_lang = ""
auto_doc_setting_enable = true

# ======= AutoDoc =======
# Runtime language
# =======================
language = "en"

[server]
# ======= AutoDoc =======
# Server listen address
# =======================
# Local test port
ip = "0.0.0.0:25565"

On the next AutoDoc run, Qexed may refresh the managed comments, but it will keep custom comments such as # Local test port.