Conversation
PR SummaryMedium Risk Overview The command resolves repo identity from the Written by Cursor Bugbot for commit bf3e776. Configure here. |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 2 potential issues.
Bugbot Autofix prepared fixes for both issues found in the latest run.
- ✅ Fixed: Byte-based truncation duplicates existing UTF-8-safe utility
- Replaced byte-slicing truncation in
truncateStrwithstringutil.TruncateRunesto ensure UTF-8-safe truncation and reuse the existing utility.
- Replaced byte-slicing truncation in
- ✅ Fixed: Display count uses server total, not actual results
- Updated the header to report
len(resp.Results)so the displayed count matches the number of rows shown to users.
- Updated the header to report
Or push these changes by commenting:
@cursor push 43625e2af1
Preview (43625e2af1)
diff --git a/cmd/entire/cli/search_cmd.go b/cmd/entire/cli/search_cmd.go
--- a/cmd/entire/cli/search_cmd.go
+++ b/cmd/entire/cli/search_cmd.go
@@ -10,6 +10,7 @@
"github.com/entireio/cli/cmd/entire/cli/jsonutil"
"github.com/entireio/cli/cmd/entire/cli/search"
"github.com/entireio/cli/cmd/entire/cli/strategy"
+ "github.com/entireio/cli/cmd/entire/cli/stringutil"
"github.com/spf13/cobra"
)
@@ -113,7 +114,7 @@
}
// Pretty print
- fmt.Fprintf(cmd.OutOrStdout(), "\nFound %d results for %s:\n\n", resp.Total, resp.Repo)
+ fmt.Fprintf(cmd.OutOrStdout(), "\nFound %d results for %s:\n\n", len(resp.Results), resp.Repo)
w := tabwriter.NewWriter(cmd.OutOrStdout(), 0, 0, 2, ' ', 0)
fmt.Fprintln(w, "RANK\tCHECKPOINT\tSCORE\tMATCH\tBRANCH\tAUTHOR\tPROMPT")
for i, r := range resp.Results {
@@ -147,8 +148,5 @@
}
func truncateStr(s string, maxLen int) string {
- if len(s) <= maxLen {
- return s
- }
- return s[:maxLen-3] + "..."
+ return stringutil.TruncateRunes(s, maxLen, "...")
}This Bugbot Autofix run was free. To enable autofix for future PRs, go to the Cursor dashboard.
Comment @cursor review or bugbot run to trigger another review on this PR
There was a problem hiding this comment.
Pull request overview
Adds a new entire search <query> CLI command that queries the Entire hosted search service to find checkpoints in the current Git repository, supporting both human-readable and --json output for automation.
Changes:
- Introduces
entire searchCobra command with--json,--branch, and--limitflags and origin-remote parsing. - Adds a thin HTTP client (
cmd/entire/cli/search) plus unit tests for GitHub remote parsing. - Registers the command and documents usage/auth requirements in the README.
Reviewed changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 6 comments.
Show a summary per file
| File | Description |
|---|---|
| cmd/entire/cli/search_cmd.go | Implements the entire search command, token resolution, repo remote parsing, and output formatting. |
| cmd/entire/cli/search/search.go | Adds HTTP client to call the Entire search service and parse responses. |
| cmd/entire/cli/search/github.go | Adds GitHub remote URL parsing helper. |
| cmd/entire/cli/search/search_test.go | Unit tests for ParseGitHubRemote variants. |
| cmd/entire/cli/root.go | Registers the new search command on the root CLI. |
| README.md | Documents entire search, flags, and token requirements. |
| var path string | ||
|
|
||
| // SSH format: git@github.com:owner/repo.git | ||
| if strings.HasPrefix(remoteURL, "git@") { |
There was a problem hiding this comment.
As discussed in person: I'd be interested to see if url.Parse() would work on a SSH URL as well, but I'm assuming that there's a reason for this conditional to be there. 👍
Soph
left a comment
There was a problem hiding this comment.
I'd like to say that using gh auth token in any way is not something we will do.
New command that calls the Entire search service to perform hybrid semantic + keyword search over checkpoints. Auth via GitHub token (GITHUB_TOKEN env var or `gh auth token`). Supports --json for agent consumption, --branch filtering, and --limit. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Extract repeated test string to constant (goconst) - Suppress gosec G704 SSRF warning on trusted URL (gosec) - Handle tabwriter Flush error (gosec G104) Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
The search service now returns full checkpoint data (commit info, token usage, file stats, etc.) instead of just IDs and scores. Updated Result struct and display to use the new nested searchMeta and camelCase fields. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Remove TUI, tabwriter, and --json flag. Output is always JSON, making the command straightforward for agent and script consumption. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- TrimSpace on GITHUB_TOKEN env var to handle trailing newlines - Reject non-github.com remotes in ParseGitHubRemote with clear error - Add httptest-based tests for Search(): URL/query construction, auth header, branch/limit omission, JSON error handling, raw body error, and successful result parsing - truncateStr was already removed with the TUI deletion Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- entire login: GitHub OAuth device flow, stores token in .entire/auth.json - entire logout: removes stored credentials - entire auth-status: shows token source (file, env, or gh CLI) - Token resolution: .entire/auth.json → GITHUB_TOKEN → gh auth token - Search command uses new resolver instead of inline token logic Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Removes GITHUB_TOKEN env var and gh CLI token fallbacks from ResolveGitHubToken so the CLI exclusively uses the token stored by 'entire login' (GitHub device flow). If no token is found, the user is directed to run 'entire login'. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com> Entire-Checkpoint: c175a1a3a7c5
- gosec: nolint OAuth endpoint URL (G101) and token field (G117) false positives - errcheck: explicit type assertion for error_description; handle readAuth errors in Set* funcs - nilnil: replace (nil, nil) with errNoAuth sentinel in readAuth - forbidigo: nolint os.Getwd() in authFilePath (walks up dirs, handles subdirectories) - perfsprint: errors.New for static strings, strconv.Itoa for int formatting Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
The file manages a JSON file in .entire/auth.json, not a system keyring. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- auth_cmd.go: guard against panic on short tokens in auth-status masking - auth_cmd.go: use SetStoredAuth for atomic token+username write on login - auth_cmd.go: pass raw interval to WaitForAuthorization (floor moved to auth logic) - auth_cmd.go: call GetStoredToken directly, remove ResolveGitHubToken indirection - github_device.go: unexport pollForToken (internal implementation detail) - github_device.go: enforce 5s minimum polling interval inside WaitForAuthorization - resolve.go: remove ResolveGitHubToken wrapper, keep only SourceEntireDir constant - search_cmd.go: call GetStoredToken directly - search.go: use http.DefaultClient consistently (matches auth package) - store.go: replace deprecated os.IsNotExist with errors.Is(err, fs.ErrNotExist) - store.go: add SetStoredAuth for atomic single-write of token+username - store_test.go: add 5 tests covering walk-up, round-trip, no-file, atomic write, preservation - README.md: document device flow auth, remove GITHUB_TOKEN/--json references Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- store.go: unexport setStoredToken/setStoredUsername (dead external API) - store.go: move SourceEntireDir constant here, delete resolve.go - github_device.go: add io.LimitReader(1MB) to all three auth HTTP reads - README.md: add login/logout/auth-status to commands table and Authentication section Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
- revive: rename 'real' variable to 'resolved' (shadows builtin) - usetesting: replace os.Chdir with t.Chdir (handles restore automatically) Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Soph
left a comment
There was a problem hiding this comment.
Can we use github.com/zalando/go-keyring to securely store the tokens?
Default to OS keyring (macOS Keychain, Linux Secret Service, Windows Credential Manager) via go-keyring. Fall back to .entire/auth.json when ENTIRE_TOKEN_STORE=file, matching the entiredb tokenstore pattern. - store.go: introduce tokenStore interface with keyringTokenStore and fileTokenStore implementations; sync.Once backend resolution - auth_cmd.go: use TokenSource() instead of hardcoded SourceEntireDir - store_test.go: TestMain forces file backend; resetBackend() between tests; add TestTokenSourceFileBackend Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
updated |
- wrapcheck: nolint thin public wrappers over tokenStore interface - nolintlint: remove unused errcheck from TestMain nolint directive Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>

Summary
entire search <query>command for hybrid semantic + keyword checkpoint searchentire login) — PAT fallbacks (GITHUB_TOKENenv var,gh auth token) removed--branchfiltering and--limit; JSON output only for agent/script consumptionFiles
cmd/entire/cli/search/— search client package (github.gofor remote parsing,search.gofor service client)cmd/entire/cli/search_cmd.go— Cobra commandcmd/entire/cli/auth/resolve.go— simplified to device flow token onlycmd/entire/cli/auth_cmd.go— updatedauth-statusto use new signaturecmd/entire/cli/root.go— command registrationREADME.md— docs for search command, flags, and authCompanion PR
Test plan
go build ./cmd/entire/compiles cleanlygo test ./...— all tests passentire logincompletes device flow and stores tokenentire search "test query"with stored token returns resultsentire searchwithout a stored token shows:not authenticated. Run 'entire login'GITHUB_TOKENenv var is no longer accepted as authentire auth-statusshows correct status with/without stored tokenmise run lintpasses🤖 Generated with Claude Code