cyrus-setup-gitlab

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese
CRITICAL: Never use
Read
,
Edit
, or
Write
tools on
~/.cyrus/.env
or any file inside
~/.cyrus/
. Use only
Bash
commands (
grep
,
printf >>
, etc.) to interact with env files — secrets must never be read into the conversation context.
重要提示:切勿对
~/.cyrus/.env
~/.cyrus/
内的任何文件使用
Read
Edit
Write
工具。仅使用
Bash
命令(如
grep
printf >>
等)与环境变量文件交互——机密信息绝不能被读取到对话上下文之中。

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
glab
is already authenticated:
bash
glab auth status 2>&1
If authenticated, check git config:
bash
git config --global user.name
git config --global user.email
If both
glab
auth and git config are set, inform the user:
GitLab is already configured. Skipping this step.
Skip to completion.
检查
glab
是否已完成身份验证:
bash
glab auth status 2>&1
如果已完成身份验证,检查git配置:
bash
git config --global user.name
git config --global user.email
如果
glab
身份验证和git配置均已设置,告知用户:
GitLab已完成配置。跳过此步骤。
直接跳至完成阶段。

Step 2: Authenticate GitLab CLI

步骤2:GitLab CLI身份验证

If
glab
is not authenticated:
bash
glab auth login
This 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.com
After completion, verify:
bash
glab auth status
如果
glab
未完成身份验证:
bash
glab auth login
这会打开一个交互式浏览器流程。请让用户完成该流程。
对于自托管GitLab实例,用户可以指定主机名:
bash
glab auth login --hostname gitlab.example.com
完成后,验证状态:
bash
glab auth status

Step 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")
提交中应显示什么邮箱? (例如:你的邮箱,或一个noreply地址)
然后设置这些值:
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.email
bash
glab auth status
git config --global user.name
git config --global user.email

Completion

完成

✓ GitLab CLI authenticated ✓ Git identity configured:
<name>
<
email
>
✓ GitLab CLI已完成身份验证 ✓ Git身份信息已配置:
<name>
<
email
>