Generate AI-ready repository context with native AST compression, Git diffs/history, HTTPS inputs and exact o200k token counts.
moon update
moon run src/cmd/moon-repomix --target native --release -- examples/demo --style markdown --stdout --tokenizer-path assets/tokenizer-o200k_base.tiktokenmoon run --target native scripts/demo.mbtx# 只处理 Git 列出的文件,NUL 协议保留文件名中的空格和换行
git ls-files -z | moon-repomix . --stdin0 --style markdown -o -
# 多种后缀;引号让 CLI 而非 shell 展开备选
moon-repomix ./project --include 'src/**/*.{mbt,ts,py}' -o -./bin/moon-repomix /path/to/project -o context.xml.\bin\moon-repomix.exe "C:\path\to\project" -o context.xmlmoon run --target native scripts/install.mbtx "$HOME/.local"moon run --target native scripts/install.mbtx "$env:LOCALAPPDATA\moon-repomix"moon-repomix ./project
moon-repomix ./project --style markdown -o context.md
moon-repomix ./project --style json -o context.json
moon-repomix ./project --style plain --stdout
moon-repomix ./project --compress --style json -o structure.json
moon-repomix ./project --include-diffs --include-logs --include-logs-count 20 -o review.xml
moon-repomix --remote https://github.com/octocat/Hello-World.git --remote-branch master --include-logs --style markdown -o remote.md
moon-repomix ./project --include 'src/**,README.md' --ignore '**/*_test.mbt'
moon-repomix ./project --stdout > context.xml
moon-repomix ./project --token-budget 100000
moon-repomix ./project --token-count-tree 100 --top-files-len 10
moon-repomix ./project --initimport {
"Delthin/moon_repomix" @repomix,
}let options = @repomix.options(
"/absolute/project", style=@repomix.Style::Json,
compress=true, include_diffs=true, include_logs=true,
)
let runtime = @repomix.Runtime::load("/absolute/share/moon-repomix/o200k_base.tiktoken")
let result = @repomix.pack(options, runtime)
// result.text 是完整文档;result.tokens 是完整文档的 token 数。
// result.document.sections / metadata 提供 Git 内容及来源、压缩记录。
// result.files / skipped / findings / security / budget 提供统计及状态。moon update
moon check --target native --deny-warn
moon test --target native
moon build --target native --release
moon run --target native scripts/package.mbtx dist macos-arm64moon run --target native scripts/scenarios.mbtx _build/native/release/build/cmd/moon-repomix/moon-repomix.exe assets/tokenizer-o200k_base.tiktoken
moon run --target native scripts/functional.mbtx _build/native/release/build/cmd/moon-repomix/moon-repomix.exe assets/tokenizer-o200k_base.tiktoken
moon run --target native scripts/token-reports-test.mbtx _build/native/release/build/cmd/moon-repomix/moon-repomix.exe assets/tokenizer-o200k_base.tiktoken
moon run --target native scripts/output-formats-test.mbtx _build/native/release/build/cmd/moon-repomix/moon-repomix.exe assets/tokenizer-o200k_base.tiktoken
moon run --target native scripts/advanced-context-test.mbtx _build/native/release/build/cmd/moon-repomix/moon-repomix.exe assets/tokenizer-o200k_base.tiktoken
moon run --target native scripts/input-list-test.mbtx
moon run --target native scripts/self-pack-test.mbtx ../moon-repomix-self-checkpub(all) suberror PackError {
ConfigurationError
SelectionError
ScanError
ResourceError
GitError
RemoteError
}pub(all) struct FileStats {
path : String
disk_bytes : Int
tokens : Int
original_tokens : Int
}pub struct PackResult {
document : Document
text : String
bytes : Int
tokens : Int
files : Array[FileStats]
skipped : Array[Skipped]
findings : Array[Finding]
security : SecurityStatus
budget : BudgetStatus
}Install
Download zipGenerate AI-ready repository context with native AST compression, Git diffs/history, HTTPS inputs and exact o200k token counts.