MCPcopy Create free account
hub / github.com/diillson/chatcli / processGitCommand

Method processGitCommand

cli/cli_commands.go:93–106  ·  view source on GitHub ↗

processGitCommand adiciona informações do Git ao contexto

(userInput string)

Source from the content-addressed store, hash-verified

91
92// processGitCommand adiciona informações do Git ao contexto
93func (cli *ChatCLI) processGitCommand(userInput string) (string, string) {
94 var additionalContext string
95 if strings.Contains(strings.ToLower(userInput), "@git") {
96 executor := utils.NewOSCommandExecutor()
97 gitData, err := utils.GetGitInfo(executor)
98 if err != nil {
99 cli.logger.Error("Erro ao obter informações do Git", zap.Error(err))
100 } else {
101 additionalContext += "\n" + i18n.T("command.context.git_info") + ":\n" + gitData
102 }
103 userInput = removeCommandAndNormalizeSpaces(userInput, "@git")
104 }
105 return userInput, additionalContext
106}
107
108// processEnvCommand adiciona as variáveis de ambiente ao contexto
109func (cli *ChatCLI) processEnvCommand(userInput string) (string, string) {

Callers 1

Calls 5

NewOSCommandExecutorFunction · 0.92
GetGitInfoFunction · 0.92
TFunction · 0.92
ErrorMethod · 0.65

Tested by

no test coverage detected