Skip to content

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

help text for 'load' with incorrect args, fix for file paths beginning with './'

Dane Schneider554e3902eaff
diff --git a/app/cli/lib/context_load.go b/app/cli/lib/context_load.go
index f634dd52..580e93ea 100644
--- a/app/cli/lib/context_load.go
+++ b/app/cli/lib/context_load.go
@@ -81,6 +81,10 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {
if url.IsValidURL(resource) {
inputUrls = append(inputUrls, resource)
} else {
+ if strings.HasPrefix(resource, "."+string(os.PathSeparator)) {
+ resource = resource[2:]
+ }
+
inputFilePaths = append(inputFilePaths, resource)
}
}
@@ -318,12 +322,43 @@ func MustLoadContext(resources []string, params *types.LoadContextParams) {
if len(loadContextReq) == 0 {
term.StopSpinner()
fmt.Println("🤷‍♂️ No context loaded")
+
+ didOutputReason := false
if len(alreadyLoadedByComposite) > 0 {
printAlreadyLoadedMsg(alreadyLoadedByComposite)
+ didOutputReason = true
}
if len(ignoredPaths) > 0 {
printIgnoredMsg()
+ didOutputReason = true
}
+
+ if !didOutputReason {
+ fmt.Println()
+ fmt.Printf("Use %s to load a file or URL:", color.New(color.BgCyan, color.FgHiWhite).Sprint(" plandex load [file-path|url] "))
+ fmt.Println()
+ fmt.Println("plandex load file.c file.h")
+ fmt.Println("plandex load https://github.com/some-org/some-repo/README.md")
+
+ fmt.Println()
+ fmt.Printf("%s with the --recursive/-r flag:\n", color.New(color.Bold, term.ColorHiCyan).Sprint("Load a whole directory"))
+ fmt.Println("plandex load app/src -r")
+
+ fmt.Println()
+ fmt.Printf("%s with the --tree flag:\n", color.New(color.Bold, term.ColorHiCyan).Sprint("Load a directory layout (file names only)"))
+
+ fmt.Println()
+ fmt.Printf("%s file paths are relative to the current directory\n", color.New(color.Bold, term.ColorHiYellow).Sprint("Note:"))
+
+ fmt.Println()
+ fmt.Printf("%s with the -n flag:\n", color.New(color.Bold, term.ColorHiCyan).Sprint("Load a note"))
+ fmt.Println("plandex load -n 'Some note here'")
+
+ fmt.Println()
+ fmt.Printf("%s from any command:\n", color.New(color.Bold, term.ColorHiCyan).Sprint("Pipe data in"))
+ fmt.Println("npm test | plandex load")
+ }
+
os.Exit(0)
}
diff --git a/releases/cli/versions/1.0.2.md b/releases/cli/versions/1.0.2.md
index 0793732c..c0b3cde3 100644
--- a/releases/cli/versions/1.0.2.md
+++ b/releases/cli/versions/1.0.2.md
@@ -1,4 +1,6 @@
- Give notes added to context with `plandex load -n 'some note'` an auto-generated name in the `context ls` list.
- Added a `--plain / -p` flag to `plandex convo` that outputs the conversation in plain text with no ANSI codes.
- `plandex convo` now accepts a message number or range of messages to display (e.g. `plandex convo 1`, `plandex convo 1-5`, `plandex convo 2-`). Use `plandex convo 1` to show the initial prompt.
-- Remove 'gpt-4-turbo-preview' from list of built-in models and model packs
\ No newline at end of file
+- Remove 'gpt-4-turbo-preview' from list of built-in models and model packs
+- Better help text if `plandex load` is run with incorrect arguments
+- Fix for `plandex load` issue loading paths that begin with `./`
\ No newline at end of file