cyrus-setup-gitlab
Compare original and translation side by side
🇺🇸
Original
English🇨🇳
Translation
ChineseCRITICAL: Never use , , or tools on or any file inside . Use only commands (, , etc.) to interact with env files — secrets must never be read into the conversation context.
ReadEditWrite~/.cyrus/.env~/.cyrus/Bashgrepprintf >>重要提示:切勿对或目录下的任何文件使用、或工具。仅使用命令(、等)操作环境文件——绝对不能将密钥读取到对话上下文当中。
~/.cyrus/.env~/.cyrus/ReadEditWriteBashgrepprintf >>Setup GitLab
配置GitLab
Configures GitLab CLI and git so Cyrus can create branches, commits, and merge requests.
配置GitLab CLI和git,以便Cyrus可以创建分支、提交代码以及合并请求。
Step 1: Check Existing Configuration
步骤1:检查现有配置
Check if is already authenticated:
glabbash
glab auth status 2>&1If authenticated, check git config:
bash
git config --global user.name
git config --global user.emailIf both auth and git config are set, inform the user:
glabGitLab is already configured. Skipping this step.
Skip to completion.
检查是否已经完成身份验证:
glabbash
glab auth status 2>&1如果已完成身份验证,请检查git配置:
bash
git config --global user.name
git config --global user.email如果身份验证和git配置都已设置,告知用户:
glabGitLab已完成配置,跳过本步骤。
直接跳转到完成部分。
Step 2: Authenticate GitLab CLI
步骤2:GitLab CLI身份验证
If is not authenticated:
glabbash
glab auth loginThis opens an interactive browser flow. Let the user complete it.
For self-hosted GitLab instances, the user can specify the hostname:
bash
glab auth login --hostname gitlab.example.comAfter completion, verify:
bash
glab auth status如果未完成身份验证:
glabbash
glab auth login这会打开交互式浏览器流程,请让用户完成操作。
对于自托管的GitLab实例,用户可以指定主机名:
bash
glab auth login --hostname gitlab.example.com操作完成后进行验证:
bash
glab auth statusStep 3: Configure Git Identity
步骤3:配置Git身份标识
If git user name or email are not set, ask the user for their preferred values:
What name should appear on commits made by Cyrus? (e.g., your name, or "Cyrus Bot")
What email should appear on commits? (e.g., your email, or a noreply address)
Then set them:
bash
git config --global user.name "<name>"
git config --global user.email "<email>"如果git用户名或邮箱未配置,询问用户偏好的取值:
Cyrus提交的代码上应该显示什么名称? (例如:你的姓名,或「Cyrus Bot」)
提交记录上应该显示什么邮箱? (例如:你的邮箱,或无回复地址)
然后进行配置:
bash
git config --global user.name "<name>"
git config --global user.email "<email>"Step 4: Verify
步骤4:验证
bash
glab auth status
git config --global user.name
git config --global user.emailbash
glab auth status
git config --global user.name
git config --global user.emailCompletion
完成
✓ GitLab CLI authenticated ✓ Git identity configured:<<name>>
✓ GitLab CLI已完成身份验证 ✓ Git身份标识已配置:<<name>>