Home Explore Blog CI



ragit

docs/commands/add.txt
52f5e43ea80fc20ec4b0175f3e5f695e13632ff44c382f1a00000003000004b1
rag-add(1)
==========

NAME
----
rag-add - Add files to the staging area

SYNOPSIS
--------
[verse]
'rag add' [--force | -f | --reject] [--dry-run] [--all | <files>...]

DESCRIPTION
-----------
Run `rag help chunks` to read documents on chunks and files. It also explains
what staging area and processed files are.

This command adds files to the staging area. Then you have to run `rag build` to
generate chunks from the files in the staging area. It does not follow symlinks.

Below is the behavior of this command according to the flag.

1. `rag add`

Without any options, it respects `.ignore` file and ignores already staged
files. If you try to add a file that does not exist, it would throw an
error.

You can also add a processed file after modifying the file. If the processed
version and the modified version are different (it compares hash), the file
is staged. Otherwise, it's ignored.

2. `rag add --reject`

It's like `rag add`, but it throws an error instead of ignoring files. So it
either adds all the files or 0 files.

If any file is erroneous, `rag add --reject` does not alter the knowledge-base.

3. `rag add --force`

It's like `rag add`, but doesn't care about `.ignore` file.

Chunks
aba831a1 (1st chunk of `docs/commands/add.txt`)
Title: Rag Add Command
Summary
The rag-add command adds files to the staging area, allowing for optional flags to force addition, reject files, or perform a dry run, and requires a subsequent rag build command to generate chunks. It respects .ignore files and checks for existing staged files, with variations in behavior based on the flags used, such as --force, --reject, or --dry-run, to manage the staging and building process effectively.