Gitlab toolkit은 LLM agent가 gitlab repository와 상호작용할 수 있도록 하는 도구들을 포함하고 있습니다.
이 도구는 python-gitlab 라이브러리의 wrapper입니다.
Quickstart
- python-gitlab 라이브러리 설치
- Gitlab personal access token 생성
- 환경 변수 설정
toolkit.get_tools()를 사용하여 agent에 도구 전달
- Get Issues- repository에서 issue들을 가져옵니다.
- Get Issue- 특정 issue에 대한 세부 정보를 가져옵니다.
- Comment on Issue- 특정 issue에 댓글을 게시합니다.
- Create Merge Request- bot의 작업 branch에서 base branch로 merge request를 생성합니다.
- Create File- repository에 새 파일을 생성합니다.
- Read File- repository에서 파일을 읽습니다.
- Update File- repository의 파일을 업데이트합니다.
- Delete File- repository에서 파일을 삭제합니다.
Setup
1. python-gitlab 라이브러리 설치
2. Gitlab personal access token 생성
여기의 지침을 따라 Gitlab personal access token을 생성하세요. 앱에 다음 repository 권한이 있는지 확인하세요:- read_api
- read_repository
- write_repository
3. 환경 변수 설정
agent를 초기화하기 전에 다음 환경 변수를 설정해야 합니다:- GITLAB_URL - 호스팅된 Gitlab의 URL. 기본값은 “gitlab.com”입니다.
- GITLAB_PERSONAL_ACCESS_TOKEN- 이전 단계에서 생성한 personal access token
- GITLAB_REPOSITORY- bot이 작동할 Gitlab repository의 이름. {username}/{repo-name} 형식을 따라야 합니다.
- GITLAB_BRANCH- bot이 commit을 수행할 branch. 기본값은 ‘main’입니다.
- GITLAB_BASE_BRANCH- repository의 base branch로, 일반적으로 ‘main’ 또는 ‘master’입니다. merge request가 기반으로 할 branch입니다. 기본값은 ‘main’입니다.
Example: Simple Agent
Connect these docs programmatically to Claude, VSCode, and more via MCP for real-time answers.