CLI entry module#
python/src/dotfiles/main.py defines the Typer app and exposes the
top-level dotfiles commands.
High-level structure#
main.py
|-- app callback: logging + source-root context
|-- project path resolver
| `-- ProjectPaths via _project_paths
|-- top-level commands
| |-- info
| |-- docs
| |-- live
| |-- clean
| |-- publish
| `-- init-docs
`-- nvim subcommands
|-- nvim sync
`-- nvim info
Resolves repository paths lazily via
resolve_project_dirduring command execution.Computes
project_dir/docs/_build/htmlonce viaProjectPaths.Prefers runtime package ancestry for checkout-local execution before configured canonical fallback.
Exposes docs lifecycle commands through
sys.executable -m sphinxmodule invocations.Exposes CLI entrypoint for publish and delegates execution to
dotfiles.publish.Delegates Neovim sync/info behavior to
dotfiles.nvimusing request dataclasses.Handles source-root discovery diagnostics through
--show-source-discovery.
Command routing#
app = typer.Typer(...)registers top-level commands.nvim_app = typer.Typer(...)registers nestednvimcommands.app.add_typer(nvim_app, name="nvim")binds nested routing.Callback wires
--source-rootoverride into path resolution context.Path resolution tries runtime package ancestry before config and chezmoi fallbacks.
publishresolves flags then callsdotfiles.publishfunctions.nvimcommands buildNvimSyncWithMimicArgs/NvimInfoArgs.dotfiles.nvimresolves runtime/local paths and executes sync/info flow.
Safety checks#
publishentrypoint delegates branch/worktree checks todotfiles.publish.nvimbranch/worktree checks run indotfiles.nvimbefore sync execution.Source-root resolution failures are surfaced as actionable CLI errors.