Output formats

Output formats

Select the format with --format (-f). Supported values are markdown, xml, json, and plain.

codemap --format xml --output codemap-output.xml

Markdown

The default. Contains a summary, an optional directory tree, the top files, and each file in a fenced code block.

XML

Each file is wrapped in an element with its path. Instruction text and header text appear as <instruction> and <header> elements. Top files appear under file_summary, and empty directories appear as <empty_directory> elements under directory_structure.

JSON

Contains header, instruction, summary, topFiles, files, emptyDirectories, excludedFiles, gitDiffs, and gitLogs.

Plain

Plain text with file separators. Useful when the target tool does not parse structure.

Summaries

OptionEffect
--summary / --no-summaryInclude or omit the file summary.
--tree / --no-treeInclude or omit the directory structure.
--line-numbers / --no-line-numbersPrefix each line with its number.

Top files are ranked by token count. The default count is 5.