feat(cli): repo indexing CLI functional #856

Closed
opened 2026-03-13 22:01:23 +00:00 by freemo · 1 comment
Owner

Metadata

  • Commit Message: feat(cli): repo indexing CLI functional
  • Branch: feature/m7-repo-indexing-cli

Background

M7 (v3.6.0) acceptance criterion: the repository indexing CLI must be fully functional. Users must be able to index repositories via CLI commands, with support for large projects and incremental re-indexing.

Expected Behavior

  1. agents repo index CLI command triggers repository indexing
  2. Indexing status is reportable via CLI
  3. Incremental re-indexing supported for changed files
  4. Large repository indexing works within acceptable time bounds

Acceptance Criteria

  • agents repo index CLI command works
  • Indexing status can be queried
  • Incremental re-indexing works for changed files
  • Large repository indexing completes successfully
  • Unit tests cover: index, re-index, status query, error cases

Subtasks

  • Implement agents repo index CLI command
  • Implement indexing status reporting
  • Implement incremental re-indexing
  • Tests (Behave): Add scenarios for repo indexing
  • Verify coverage >=97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
## Metadata - **Commit Message**: `feat(cli): repo indexing CLI functional` - **Branch**: `feature/m7-repo-indexing-cli` ## Background M7 (v3.6.0) acceptance criterion: the repository indexing CLI must be fully functional. Users must be able to index repositories via CLI commands, with support for large projects and incremental re-indexing. ## Expected Behavior 1. `agents repo index` CLI command triggers repository indexing 2. Indexing status is reportable via CLI 3. Incremental re-indexing supported for changed files 4. Large repository indexing works within acceptable time bounds ## Acceptance Criteria - [ ] `agents repo index` CLI command works - [ ] Indexing status can be queried - [ ] Incremental re-indexing works for changed files - [ ] Large repository indexing completes successfully - [ ] Unit tests cover: index, re-index, status query, error cases ## Subtasks - [ ] Implement `agents repo index` CLI command - [ ] Implement indexing status reporting - [ ] Implement incremental re-indexing - [ ] Tests (Behave): Add scenarios for repo indexing - [ ] Verify coverage >=97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done.
freemo added this to the v3.6.0 milestone 2026-03-13 22:02:08 +00:00
Member

Implementation Notes

Architecture

New CLI module cli/commands/repo.py (238 lines) with two commands:

agents repo index <resource_name>: Resolves resource by name via ResourceRegistryService, then calls RepoIndexingService.refresh_index() (incremental) or index_resource() (full when --full flag used). Displays results in Rich panel or JSON.

agents repo status <resource_name>: Calls get_index_status() and get_index() to display indexing metadata: status, file count, token estimate, primary language, last indexed timestamp.

Key Decisions

  1. Incremental by default: agents repo index uses refresh_index() which only re-processes changed files. --full flag forces full re-index via index_resource().
  2. Resource name resolution: Uses same pattern as resource show command — resolves namespaced name (e.g., local/my-repo) to resource_id.
  3. Error handling: Clear error messages for non-existent resources and resources without indexes.

Quality Gates

Session Result
lint PASS
typecheck PASS (0 errors)
unit_tests PASS (10,819 scenarios, 13 new)
integration_tests PASS (5 new)
coverage_report 98%

Commit

9c994de1 on branch feature/m7-repo-indexing-cli

PR

PR #982

## Implementation Notes ### Architecture New CLI module `cli/commands/repo.py` (238 lines) with two commands: **`agents repo index <resource_name>`**: Resolves resource by name via `ResourceRegistryService`, then calls `RepoIndexingService.refresh_index()` (incremental) or `index_resource()` (full when `--full` flag used). Displays results in Rich panel or JSON. **`agents repo status <resource_name>`**: Calls `get_index_status()` and `get_index()` to display indexing metadata: status, file count, token estimate, primary language, last indexed timestamp. ### Key Decisions 1. **Incremental by default**: `agents repo index` uses `refresh_index()` which only re-processes changed files. `--full` flag forces full re-index via `index_resource()`. 2. **Resource name resolution**: Uses same pattern as `resource show` command — resolves namespaced name (e.g., `local/my-repo`) to resource_id. 3. **Error handling**: Clear error messages for non-existent resources and resources without indexes. ### Quality Gates | Session | Result | |---|---| | lint | PASS | | typecheck | PASS (0 errors) | | unit_tests | PASS (10,819 scenarios, 13 new) | | integration_tests | PASS (5 new) | | coverage_report | 98% | ### Commit `9c994de1` on branch `feature/m7-repo-indexing-cli` ### PR [PR #982](https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/982)
Sign in to join this conversation.
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#856
No description provided.