rag-cat-file(1)
==========
NAME
----
rag-cat-file - Show content of a file or a chunk
SYNOPSIS
--------
[verse]
'rag cat-file' [--json | -j] <uid>
DESCRIPTION
-----------
This command dump the contents of a file, a chunk or an image.
It doesn't always dump the exact content of the file, and that's intentional.
Some file readers modify the file content when chunking in order to give more
context to LLMs. For example, a csv-reader converts a csv file into a jsonl
file so that each chunk has more context. `cat-file` works by merging chunks
and it's not smart enough to re-construct the original file.
Also, some chunks have images, and there's no way to dump an image to stdout.
There are 2 ways that `cat-file` dumps images. If you `cat-file` a chunk or a
file, then it just dumps the uids of the images. For example, you have a chunk
"abcdef" and the chunk has an image "123abc". If you run `rag cat-file abcdef`,
the content will have "img_123abc". If you're building a gui on top of ragit,
make sure to replace the string "img_123abc" with the actual image.
If you're building a chunk viewer on top of `cat-file`, I recommend you use
`--json` option which clearly separates images and texts.
If you run "rag cat-file 123abc", where "123abc" is a uid of an image, it
dumps the bytes of the image file to stdout. If you're on a terminal,
you'll see bunch of unreadable characters. You have to redirect it to another
application. If it's "rag cat-file 123abc --json", it dumps the base64 encoding
of the bytes.