Skip to content

codedb_remote: add 'read' action — locate-but-can't-view gap #333

@justrach

Description

@justrach

Problem

codedb_remote lets you find a file (tree, search) and locate symbols (outline, symbol), but it has no way to actually view a slice of file content from a remote repo. Today the workflow is:

  1. action=search, query=foo → returns {path, line_num, line_text}
  2. … and now you're stuck. To see the surrounding 30 lines you have to clone the repo locally.

This defeats the "explore an external repo without cloning" use case the tool is pitched on.

Proposal

Add a read action:

GET /:owner/:repo/read?path=src/foo.zig&lines=10-60

Response shape:

{
  \"repo\": \"owner/repo\",
  \"path\": \"src/foo.zig\",
  \"lines\": \"10-60\",
  \"content\": \"...\",
  \"total_lines\": 250
}

The codegraff snapshot already contains a CONTENT section (see `iterateContent` in `codedb-cloud/src/snapshot.ts`) — implementing this server-side is a ~30-line patch.

The wiki backend would need parallel work in its own repo.

Why

Closes the most-requested workflow gap. A search hit is only useful if you can read the surrounding code.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions