Repomix
The repomix macro packs repository sources for AI-assisted inspection while
capturing structured usage statistics. A bundled Node.js adapter invokes Repomix
once and returns its statistics to cikit.
Dependencies
Node.js (node) and Repomix must be available to the CI environment. Project
configuration and ignore files are handled by Repomix; cikit does not replace
repomix.config.json, .repomixignore, or .gitignore.
For command-line usage and a configuration example, see repomix.
Features
repository packs using the native Repomix configuration
xml,markdown,json, andplainoutput formatsregistering output packs as
BUILDartifacts with their original filenamesa structured JSON statistics file registered as a
METADATAartifacttoken, character, source file, skipped file, security, and timing metrics
RST report with a configurable ranking of the most token-intensive files
inclusion of timeline artifacts previously registered for the current run
Typical usage
from cikit.macros import repomix
repomix.generate(env) # Uses the Repomix project configuration
repomix.write_rst(env)
generate() uses the filename and output format determined by Repomix.
The pack is generated in a temporary directory, regardless of the configured
output directory, and registered without renaming it. The final artifact
location is managed by cikit. The optional timeout argument specifies the
maximum Repomix execution time in seconds (default: 600).
generate() stores metrics including repomix_version, output_format,
total_files, total_tokens, total_characters, source_characters,
skipped_files, token_encoding, security_suspicious_files, and
generation_time. The detailed per-file token counts and security findings
remain in the registered <run>-statistics.json metadata artifact.
write_rst() links the generated packs and statistics and lists the five
largest source files by token count by default. Set top_files=0 to omit
this ranking or use top_files=10 to list the ten largest files. A timeline
can be created separately through chart_timeline(); the report includes it
when registered for the current run.