Packages

A powerful Elixir tool for intelligently chunking your project's source code to support Local RAG systems.

Current section

Files

Jump to
chunkex lib mix tasks chunkex.ex
Raw

lib/mix/tasks/chunkex.ex

defmodule Mix.Tasks.Chunkex do
@moduledoc """
Mix task to run the chunkex on the current project.
This task chunks all Elixir files in the lib directory and outputs
the results as JSON for RAG (Retrieval-Augmented Generation) purposes.
## Usage
mix chunkex run [root]
## Arguments
* `root` - The root directory to chunk (defaults to current directory)
## Examples
mix chunkex run
mix chunkex run /path/to/project
"""
use Mix.Task
@shortdoc "Chunks the project files for RAG purposes"
@impl Mix.Task
def run(args) do
case args do
["run"] -> Chunkex.chunk(".")
["run", path] -> Chunkex.chunk(path)
[] -> Mix.raise("Usage: mix chunkex run [root]")
_ -> Mix.raise("Usage: mix chunkex run [root]")
end
end
end