Metadata-Version: 2.4
Name: reindex-cli
Version: 0.3.0
Summary: Compile local files into ReIndex packages.
Project-URL: Homepage, https://github.com/yechenyan/reIndex
Project-URL: Documentation, https://github.com/yechenyan/reIndex/tree/main/wiki
Project-URL: Repository, https://github.com/yechenyan/reIndex
Project-URL: Issues, https://github.com/yechenyan/reIndex/issues
Keywords: agents,cli,knowledge,search
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Intended Audience :: Developers
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Text Processing :: Indexing
Classifier: Topic :: Utilities
Requires-Python: >=3.12
Description-Content-Type: text/markdown
Requires-Dist: docling<3,>=2
Requires-Dist: httpx<1,>=0.27
Requires-Dist: pypdfium2<6,>=5
Requires-Dist: pyyaml<7,>=6

# ReIndex CLI

`rei` builds local files into ReIndex 1.0 packages and connects them to a ReIndex API. `reindex` is an alias.

## Install and initialize

Give an AI Agent this sentence:

> Run `uv tool install --upgrade reindex-cli`, then run `rei init <data-directory> --agent <current-agent>` to create or update the ReIndex skills.

The installation is complete when `rei --help` works directly, without
`uv run`. `pipx install reindex-cli` and `python -m pip install reindex-cli`
are also supported. Python 3.12 or newer is required; the Docling dependency
makes the first installation and first PDF scan larger than a typical CLI.

`<current-agent>` is `codex`, `claude`, `cursor`, or `copilot`. `init` is idempotent, creates or reuses local identity, and installs or safely updates the three bundled skills. It does not scan, push, or download tutorial data.

```bash
rei init <collection-dir> [--name <name>] [--agent codex]
rei rename <collection-dir> <new-name>
```

## Local commands

```bash
rei inspect <path>
rei scan <path> [--collection-root <collection-dir>]
rei check <path>
```

`inspect` is read-only. `scan` stages, validates, and atomically publishes a package. `check` verifies package resources, protected Node metadata, and current inputs.

For the normal author path, `push` runs the same package check again, so an
explicit `check` is mainly useful after manually editing cards or in CI:

```bash
rei init <collection-dir> --name <name> --agent codex
rei inspect <collection-dir>
rei scan <collection-dir>
rei push <collection-dir> --api-url <api-url>
```

## Remote commands

```bash
rei set-api <base-url>
rei push [path]
rei pull <name> [--output <directory>]
rei search "<query>" [--remote <name>] [--mode lexical|semantic|hybrid]
rei get <node-path> [--target card|source|content|asset]
rei get raw://<path>
```

`push` synchronously sends the complete validated package and exactly referenced raw sources. `pull` downloads only the complete `.node.md` tree. `get` checks a complete local package, local authoring source, and the SHA-256 cache before downloading one exact resource.

Collection names are the user-facing remote identifier. UUIDs remain internal stable identity. Resource logical paths stay Collection-relative and are scoped by the internal Collection UUID.

## Skills

```bash
rei skills install --agent codex
rei skills update --agent codex
rei skills update --agent codex --force
```

Normal updates overwrite only unmodified ReIndex-managed copies. A modified skill reports a conflict unless `--force` is explicit.

The CLI does not include or provision a hosted API. Remote commands use the
configured ReIndex API; without one, the default is the local development
endpoint at `http://127.0.0.1:8000`.
