Documentation
¶
Overview ¶
cmd/library/systemprompt/systemprompt.go
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var SystemPromptCmd = &cobra.Command{ Use: "system-prompt", Aliases: []string{"prompt"}, Example: ` contextvibes library system-prompt --target idx`, RunE: func(cmd *cobra.Command, args []string) error { presenter := ui.NewPresenter(cmd.OutOrStdout(), cmd.ErrOrStderr()) loadedAppConfig := globals.LoadedAppConfig basePath := "docs/prompts/system" coreContent, err := os.ReadFile(filepath.Join(basePath, "core.md")) if err != nil { return err } var finalPrompt strings.Builder finalPrompt.Write(coreContent) if systemPromptTarget != "" { targetContent, err := os.ReadFile(filepath.Join(basePath, systemPromptTarget+".md")) if err != nil { return err } finalPrompt.WriteString("\n\n") finalPrompt.Write(targetContent) } outputPath := systemPromptOutput if outputPath == "" { if defaultPath, ok := loadedAppConfig.SystemPrompt.DefaultOutputFiles[systemPromptTarget]; ok { outputPath = defaultPath } else { outputPath = fmt.Sprintf("contextvibes_%s_prompt.md", systemPromptTarget) } } if outputPath == "-" { _, _ = fmt.Fprint(presenter.Out(), finalPrompt.String()) } else { err := os.WriteFile(outputPath, []byte(finalPrompt.String()), 0o600) if err != nil { return err } presenter.Success("Successfully generated system prompt at %s.", outputPath) } return nil }, }
SystemPromptCmd represents the system-prompt command.
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.