cmd

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2026 License: MIT Imports: 32 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const (
	GITHUB = "github"
	DRONE  = "drone"
)

Variables

View Source
var CompletionCmd = &cobra.Command{
	Use:   "completion [bash|zsh|fish|powershell]",
	Short: "Generate completion script",
	Long: `Generate shell completion scripts for CodeGPT CLI.
	
To load completions:

Bash:
	$ source <(codegpt completion bash)
	# Or save it to a file and source it:
	$ codegpt completion bash > ~/.codegpt-completion.bash
	$ echo 'source ~/.codegpt-completion.bash' >> ~/.bashrc

Zsh:
	$ source <(codegpt completion zsh)
	# Or save it to a file in your $fpath:
	$ codegpt completion zsh > "${fpath[1]}/_codegpt"

Fish:
	$ codegpt completion fish > ~/.config/fish/completions/codegpt.fish

PowerShell:
	PS> codegpt completion powershell > codegpt.ps1
	PS> . ./codegpt.ps1`,
	DisableFlagsInUseLine: true,
	ValidArgs:             []string{"bash", "zsh", "fish", "powershell"},
	Args:                  cobra.MatchAll(cobra.ExactArgs(1), cobra.OnlyValidArgs),
	Run: func(cmd *cobra.Command, args []string) {
		switch args[0] {
		case "bash":
			_ = cmd.Root().GenBashCompletion(os.Stdout)
		case "zsh":
			_ = cmd.Root().GenZshCompletion(os.Stdout)
		case "fish":
			_ = cmd.Root().GenFishCompletion(os.Stdout, true)
		case "powershell":
			_ = cmd.Root().GenPowerShellCompletionWithDesc(os.Stdout)
		}
	},
}

Functions

func Execute

func Execute(ctx context.Context)

func GetClient added in v0.13.0

func GetClient(ctx context.Context, p core.Platform) (core.Generative, error)

GetClient returns the generative client based on the platform

func NewAnthropic added in v0.15.0

func NewAnthropic(ctx context.Context) (*anthropic.Client, error)

NewAnthropic creates a new instance of the anthropic.Client using configuration values retrieved from Viper. The configuration values include the API key, model, maximum tokens, temperature, and top_p.

Parameters:

  • ctx: The context for the client.

Returns:

  • A pointer to an anthropic.Client instance.
  • An error if the client could not be created.

func NewGemini added in v0.13.0

func NewGemini(ctx context.Context) (*gemini.Client, error)

NewGemini returns a new Gemini client

func NewLiteLLM added in v1.8.0

func NewLiteLLM(ctx context.Context) (*litellm.Client, error)

NewLiteLLM creates a new LiteLLM client that connects to a LiteLLM proxy server, providing access to 100+ LLM providers through a unified OpenAI-compatible API.

func NewOpenAI added in v0.12.1

func NewOpenAI(ctx context.Context) (*openai.Client, error)

Types

type VersionInfo added in v1.0.0

type VersionInfo struct {
	Version   string `json:"version"`    // Application version
	GitCommit string `json:"git_commit"` // Git commit SHA
	BuildTime string `json:"build_time"` // Build timestamp
	GoVersion string `json:"go_version"` // Go language version
	BuildOS   string `json:"build_os"`   // Build operating system
	BuildArch string `json:"build_arch"` // Build architecture
	Platform  string `json:"platform"`   // Combined OS/Arch string
}

VersionInfo holds all version-related information for the application.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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