cli

package
v0.0.0-...-16efc32 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2026 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Execute

func Execute() error

func GetRootCmd

func GetRootCmd() *cobra.Command

GetRootCmd returns the root command for documentation generation

func SearchJSON

func SearchJSON(projectRoot string, query string, limit int) ([]store.SearchResult, error)

SearchJSON returns results in JSON format for AI agents

func SetVersion

func SetVersion(v string)

Types

type ClaudeInitResponse

type ClaudeInitResponse struct {
	Status       string             `json:"status"`                 // "ready", "needs_setup", "needs_machine_setup"
	Message      string             `json:"message"`                // Human-readable message
	Project      *ClaudeProjectInfo `json:"project,omitempty"`      // Project info if ready
	NextStep     string             `json:"next_step,omitempty"`    // Command to run if not ready
	Commands     map[string]string  `json:"commands,omitempty"`     // Available commands if ready
	Instructions string             `json:"instructions,omitempty"` // Usage instructions
}

ClaudeInitResponse is returned by `grepai init` for Claude to understand what to do

type ClaudeProjectInfo

type ClaudeProjectInfo struct {
	ID        string   `json:"id"`
	Name      string   `json:"name"`
	Path      string   `json:"path"`
	Backend   string   `json:"backend"`
	Languages []string `json:"languages,omitempty"`
}

type FederatedResultJSON

type FederatedResultJSON struct {
	ProjectName string  `json:"project_name"`
	ProjectPath string  `json:"project_path"`
	FilePath    string  `json:"file_path"`
	StartLine   int     `json:"start_line"`
	EndLine     int     `json:"end_line"`
	Score       float32 `json:"score"`
	Content     string  `json:"content,omitempty"`
}

FederatedResultJSON is a struct for federated search JSON output

type FederatedSearchResponse

type FederatedSearchResponse struct {
	Results          []FederatedResultJSON `json:"results"`
	Query            string                `json:"query"`
	ProjectsSearched []string              `json:"projects_searched"`
}

FederatedSearchResponse is the JSON response for federated search

type RefreshResult

type RefreshResult struct {
	Status        string `json:"status"`
	FilesIndexed  int    `json:"files_indexed"`
	ChunksCreated int    `json:"chunks_created"`
	FilesSkipped  int    `json:"files_skipped"`
	FilesRemoved  int    `json:"files_removed"`
	SymbolCount   int    `json:"symbol_count"`
	Duration      string `json:"duration"`
	Error         string `json:"error,omitempty"`
}

RefreshResult contains the result of the refresh command.

type SearchResultCompactJSON

type SearchResultCompactJSON struct {
	FilePath  string  `json:"file_path"`
	StartLine int     `json:"start_line"`
	EndLine   int     `json:"end_line"`
	Score     float32 `json:"score"`
}

SearchResultCompactJSON is a minimal struct for compact JSON output (no content field)

type SearchResultJSON

type SearchResultJSON struct {
	FilePath  string  `json:"file_path"`
	StartLine int     `json:"start_line"`
	EndLine   int     `json:"end_line"`
	Score     float32 `json:"score"`
	Content   string  `json:"content"`
}

SearchResultJSON is a lightweight struct for JSON output (excludes vector, hash, updated_at)

type SetupCommands

type SetupCommands struct {
	Search  string `json:"search"`
	Trace   string `json:"trace"`
	Refresh string `json:"refresh"`
	Watch   string `json:"watch"`
}

SetupCommands contains available commands for the project.

type SetupProjectInfo

type SetupProjectInfo struct {
	ID        string   `json:"project_id,omitempty"`
	Name      string   `json:"name"`
	Path      string   `json:"path"`
	Languages []string `json:"languages"`
	Framework string   `json:"framework,omitempty"`
	BuildTool string   `json:"build_tool,omitempty"`
}

SetupProjectInfo contains project information for JSON output.

type SetupResult

type SetupResult struct {
	Project       SetupProjectInfo `json:"project"`
	Status        string           `json:"status"`
	FilesIndexed  int              `json:"files_indexed"`
	ChunksCreated int              `json:"chunks_created"`
	SymbolCount   int              `json:"symbol_count"`
	Commands      SetupCommands    `json:"commands"`
	Error         string           `json:"error,omitempty"`
}

SetupResult contains the result of the setup command.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL