Skip to content

Open source AI coding agent. Designed for large projects and real world tasks.

basis for context search

Dane Schneider7ef45091f7c8
diff --git a/app/cli/cmd/load.go b/app/cli/cmd/load.go
index d486026f..2325ed98 100644
--- a/app/cli/cmd/load.go
+++ b/app/cli/cmd/load.go
@@ -17,6 +17,7 @@ var (
note string
forceSkipIgnore bool
imageDetail string
+ defsOnly bool
)
var contextLoadCmd = &cobra.Command{
@@ -33,6 +34,7 @@ func init() {
contextLoadCmd.Flags().BoolVar(&namesOnly, "tree", false, "Load directory tree with file names only")
contextLoadCmd.Flags().BoolVarP(&forceSkipIgnore, "force", "f", false, "Load files even when ignored by .gitignore or .plandexignore")
contextLoadCmd.Flags().StringVarP(&imageDetail, "detail", "d", "high", "Image detail level (high or low)")
+ contextLoadCmd.Flags().BoolVar(&defsOnly, "defs", false, "Load definitions only (function/method/class signatures, variable names, types, etc.)")
RootCmd.AddCommand(contextLoadCmd)
}
diff --git a/app/cli/lib/context_load.go b/app/cli/lib/context_load.go
index 75e74351..0bc4c47b 100644
--- a/app/cli/lib/context_load.go
+++ b/app/cli/lib/context_load.go
@@ -7,6 +7,7 @@ import (
"io"
"os"
"plandex/api"
+ "plandex/auth"
"plandex/fs"
"plandex/term"
"plandex/types"
@@ -36,11 +37,13 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {
var apiKeys map[string]string
var openAIBase string
- if params.Note != "" || fileInfo.Mode()&os.ModeNamedPipe != 0 {
- apiKeys = MustVerifyApiKeysSilent()
- openAIBase = os.Getenv("OPENAI_API_BASE")
- if openAIBase == "" {
- openAIBase = os.Getenv("OPENAI_ENDPOINT")
+ if !auth.Current.IntegratedModelsMode {
+ if params.Note != "" || fileInfo.Mode()&os.ModeNamedPipe != 0 {
+ apiKeys = MustVerifyApiKeysSilent()
+ openAIBase = os.Getenv("OPENAI_API_BASE")
+ if openAIBase == "" {
+ openAIBase = os.Getenv("OPENAI_ENDPOINT")
+ }
}
}
@@ -62,7 +65,6 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {
}
if len(pipedData) > 0 {
-
loadContextReq = append(loadContextReq, &shared.LoadContextParams{
ContextType: shared.ContextPipedDataType,
Body: string(pipedData),
@@ -202,6 +204,7 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {
Body: body,
FilePath: inputFilePath,
ForceSkipIgnore: params.ForceSkipIgnore,
+ DefsOnly: params.DefsOnly,
})
errCh <- nil
diff --git a/app/cli/types/types.go b/app/cli/types/types.go
index b4331388..a779babe 100644
--- a/app/cli/types/types.go
+++ b/app/cli/types/types.go
@@ -11,6 +11,7 @@ type LoadContextParams struct {
NamesOnly bool
ForceSkipIgnore bool
ImageDetail openai.ImageURLDetail
+ DefsOnly bool
}
type ContextOutdatedResult struct {
diff --git a/app/shared/req_res.go b/app/shared/req_res.go
index 018acbc7..7b2382d8 100644
--- a/app/shared/req_res.go
+++ b/app/shared/req_res.go
@@ -164,6 +164,7 @@ type LoadContextParams struct {
Body string `json:"body"`
ForceSkipIgnore bool `json:"forceSkipIgnore"`
ImageDetail openai.ImageURLDetail `json:"imageDetail"`
+ DefsOnly bool `json:"defsOnly"`
// For naming piped data
ApiKeys map[string]string `json:"apiKeys"`