Skip to content

feat: add --project-name flag to override qualified-name prefix #435

@dj0nes

Description

@dj0nes

Problem

The project name used as the qualified-name prefix for all indexed nodes is derived from the last component of the repo path:

```python
self.project_name = repo_path.resolve().name
```

This creates confusing results when:

  1. The repo is nested inside a same-named parent directory. For example, indexing `/code/BRender/BlazingRenderer` produces correct names, but if someone previously indexed `/code/BRender` directly, all nodes get the prefix `BRender` instead. Stale `BRender.` nodes then coexist with fresh `BlazingRenderer.` nodes in the same database with no way to distinguish or clean them.

  2. The directory name is not a good identifier (e.g. `v1.3.2`, `src`, `main`).

Proposed solution

Add a `--project-name` CLI flag that overrides the derived name:

```sh
cgr start --update-graph
--repo-path ~/code/BRender/BlazingRenderer
--project-name BlazingRenderer
```

Implementation is minimal: accept the flag in `cli.py`, pass it to `GraphUpdater.init`, and use it with a fallback:

```python
self.project_name = project_name or repo_path.resolve().name
```

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    Status

    No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions