{"modulePath":"github.com/qiniu/codeagent","version":"v0.0.0-20250811064323-e487a7559539","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package github\n\n## Types\n\n```go\ntype Client struct {\n\t// contains filtered or unexported fields\n}\n```\n\n```go\nfunc NewClient(cfg *config.Config) (*Client, error)\n```\n\n```go\nfunc (c *Client) CommitAndPush(workspace *models.Workspace, result *models.ExecutionResult, codeClient code.Code) (string, error)\n```\nCommitAndPush 检测文件变更并提交推送\n\n```go\nfunc (c *Client) CreateBranch(workspace *models.Workspace) error\n```\nCreateBranch creates branch locally and pushes to remote\n\n```go\nfunc (c *Client) CreateComment(ctx context.Context, owner, repo string, issueNumber int, body string) (*github.IssueComment, error)\n```\nCreateComment 在Issue或PR上创建评论\n\n```go\nfunc (c *Client) CreatePullRequest(workspace *models.Workspace) (*github.PullRequest, error)\n```\nCreatePullRequest 创建 Pull Request\n\n```go\nfunc (c *Client) CreatePullRequestComment(pr *github.PullRequest, commentBody string) error\n```\nCreatePullRequestComment 在 PR 上创建评论\n\n```go\nfunc (c *Client) DeleteCodeAgentBranch(ctx context.Context, owner, repo, branchName string) error\n```\nDeleteCodeAgentBranch 删除CodeAgent创建的分支\n\n```go\nfunc (c *Client) GetAllPRComments(pr *github.PullRequest) (*models.PRAllComments, error)\n```\nGetAllPRComments 获取 PR 的所有评论，包括一般评论和代码行评论\n\n```go\nfunc (c *Client) GetClient() *github.Client\n```\nGetClient 获取底层的GitHub客户端（用于MCP服务器）\n\n```go\nfunc (c *Client) GetComment(ctx context.Context, owner, repo string, commentID int64) (*github.IssueComment, error)\n```\nGetComment 获取评论内容\n\n```go\nfunc (c *Client) GetPullRequest(owner, repo string, prNumber int) (*github.PullRequest, error)\n```\nGetPullRequest 获取 PR 的完整信息\n\n```go\nfunc (c *Client) GetReviewComments(pr *github.PullRequest, reviewID int64) ([]*github.PullRequestComment, error)\n```\nGetReviewComments 获取指定 review 的所有 comments\n\n```go\nfunc (c *Client) PullLatestChanges(workspace *models.Workspace, pr *github.PullRequest) error\n```\nPullLatestChanges 拉取远端最新代码（优先使用rebase策略）\n\n```go\nfunc (c *Client) ReplyToReviewComment(pr *github.PullRequest, commentID int64, commentBody string) error\n```\nReplyToReviewComment 回复 PR 代码行评论\n\n```go\nfunc (c *Client) UpdateComment(ctx context.Context, owner, repo string, commentID int64, body string) error\n```\nUpdateComment 更新已存在的评论\n\n```go\nfunc (c *Client) UpdatePullRequest(pr *github.PullRequest, newBody string) error\n```\nUpdatePullRequest 更新 PR 的 Body\n\n","path":"github.com/qiniu/codeagent/internal/github","name":"github","synopsis":"","isRedistributable":true}
