gocd

Compare original and translation side by side

🇺🇸

Original

English
🇨🇳

Translation

Chinese

GoCD with orbit CLI

使用orbit CLI管理GoCD

Comprehensive GoCD management through the
orbit
CLI. Covers pipelines, pipeline groups, agents, environments, config repos, server administration, users, roles, authorization, plugins, backups, materials, artifact stores, elastic agent profiles, cluster profiles, stages, jobs, server configuration, templates, packages, package repositories, notification filters, dashboard, access tokens, secret configs, and server version. Works with self-hosted GoCD instances via the REST API, with multi-profile support and 1Password secret resolution.
通过
orbit
CLI对GoCD进行全面管理,涵盖流水线、流水线组、Agent、环境、配置仓库、服务器管理、用户、角色、授权、插件、备份、材料、制品仓库、弹性Agent配置文件、集群配置文件、阶段、任务、服务器配置、模板、包、包仓库、通知过滤器、仪表盘、访问令牌、机密配置以及服务器版本。通过REST API对接自托管GoCD实例,支持多配置文件和1Password机密解析。

Prerequisites

前提条件

  1. orbit
    binary built and accessible
  2. A profile with a
    gocd
    service configured in
    ~/.config/orbit/config.yaml
  3. Valid credentials (API token or basic auth) — can be stored in 1Password with
    op://
    prefix
  4. base_url
    is required (GoCD is always self-hosted)
  1. 已构建
    orbit
    二进制文件且可访问
  2. ~/.config/orbit/config.yaml
    中配置了包含
    gocd
    服务的配置文件
  3. 有效凭据(API令牌或基础认证)——可存储在1Password中,前缀为
    op://
  4. 必须提供
    base_url
    (GoCD始终为自托管)

Quick Reference

快速参考

All commands follow the pattern:
orbit -p <profile> gocd <command> [flags]
Alias:
orbit -p <profile> cd <command> [flags]
All commands support
-o json
and
-o yaml
for structured output. For full command details and all flags, see
references/commands.md
.
所有命令遵循以下格式:
orbit -p <profile> gocd <command> [flags]
别名:
orbit -p <profile> cd <command> [flags]
所有命令支持
-o json
-o yaml
以输出结构化数据。完整命令详情及所有参数请参阅
references/commands.md

Command Groups

命令组

GroupAliasDescription
pipeline
Pipeline CRUD, status, history, trigger, pause/unpause, comment, export, compare, lock/unlock
pipeline-group
pg
Pipeline group CRUD
agent
Agent list, get, enable, disable, delete, kill-task, update, job-history
environment
env
Environment CRUD, patch
config-repo
cr
,
configrepo
Config repo CRUD, status, trigger, definitions, preflight
server
Server health, maintenance mode
server-config
sc
Site URL, artifact config, job timeout, mail server
user
User CRUD, bulk delete, current user
role
Security role CRUD
authorization
auth-config
Authorization config CRUD
plugin
Plugin info, settings CRUD
backup
Backup config CRUD, schedule
material
Material list, get, usage, trigger-update
artifact
Artifact store CRUD
cluster-profile
cp
Elastic agent cluster profile CRUD
elastic-agent-profile
eap
Elastic agent profile CRUD, usage
stage
Stage cancel, run
job
Job run
encrypt
Encrypt values
template
tmpl
Pipeline template CRUD
package-repo
pkg-repo
Package repository CRUD
package
pkg
Package CRUD, usage
notification-filter
nf
Notification filter CRUD
dashboard
Dashboard overview
version
Server version info
access-token
token
Access token CRUD (user and admin)
secret-config
secret
Secret configuration CRUD
别名描述
pipeline
流水线的增删改查、状态查看、历史记录、触发、暂停/恢复、评论、导出、对比、锁定/解锁
pipeline-group
pg
流水线组的增删改查
agent
Agent的列表、详情查看、启用、禁用、删除、终止任务、更新、任务历史
environment
env
环境的增删改查、补丁更新
config-repo
cr
,
configrepo
配置仓库的增删改查、状态查看、触发、定义查看、预检查
server
服务器健康状态、维护模式
server-config
sc
站点URL、制品配置、任务超时、邮件服务器
user
用户的增删改查、批量删除、当前用户查看
role
安全角色的增删改查
authorization
auth-config
授权配置的增删改查
plugin
插件信息、设置的增删改查
backup
备份配置的增删改查、调度
material
材料的列表、详情查看、使用情况、触发更新
artifact
制品仓库的增删改查
cluster-profile
cp
弹性Agent集群配置文件的增删改查
elastic-agent-profile
eap
弹性Agent配置文件的增删改查、使用情况
stage
阶段的取消、运行
job
任务的运行
encrypt
加密值
template
tmpl
流水线模板的增删改查
package-repo
pkg-repo
包仓库的增删改查
package
pkg
包的增删改查、使用情况
notification-filter
nf
通知过滤器的增删改查
dashboard
仪表盘概览
version
服务器版本信息
access-token
token
访问令牌的增删改查(用户及管理员权限)
secret-config
secret
机密配置的增删改查

Core Workflows

核心工作流

Pipeline CRUD

流水线增删改查

bash
undefined
bash
undefined

List all pipelines by group

List all pipelines by group

orbit -p myprofile gocd pipeline list
orbit -p myprofile gocd pipeline list

Create a pipeline from file

Create a pipeline from file

orbit -p myprofile cd pipeline create --group my-group --from-file pipeline.yaml
orbit -p myprofile cd pipeline create --group my-group --from-file pipeline.yaml

Update a pipeline configuration

Update a pipeline configuration

orbit -p myprofile cd pipeline update my-pipeline --from-file pipeline.yaml
orbit -p myprofile cd pipeline update my-pipeline --from-file pipeline.yaml

Delete a pipeline

Delete a pipeline

orbit -p myprofile cd pipeline delete my-pipeline
orbit -p myprofile cd pipeline delete my-pipeline

Check pipeline status

Check pipeline status

orbit -p myprofile cd pipeline status my-pipeline
orbit -p myprofile cd pipeline status my-pipeline

View pipeline run history

View pipeline run history

orbit -p myprofile gocd pipeline history my-pipeline --limit 5
orbit -p myprofile gocd pipeline history my-pipeline --limit 5

Get a specific pipeline instance

Get a specific pipeline instance

orbit -p myprofile gocd pipeline get my-pipeline --counter 42
orbit -p myprofile gocd pipeline get my-pipeline --counter 42

Trigger a pipeline run

Trigger a pipeline run

orbit -p myprofile cd pipeline trigger my-pipeline
orbit -p myprofile cd pipeline trigger my-pipeline

Pause/unpause a pipeline

Pause/unpause a pipeline

orbit -p myprofile gocd pipeline pause my-pipeline --reason "Maintenance window" orbit -p myprofile gocd pipeline unpause my-pipeline
orbit -p myprofile gocd pipeline pause my-pipeline --reason "Maintenance window" orbit -p myprofile gocd pipeline unpause my-pipeline

Comment on a pipeline instance

Comment on a pipeline instance

orbit -p myprofile cd pipeline comment my-pipeline --counter 42 --message "Deployed to staging"
orbit -p myprofile cd pipeline comment my-pipeline --counter 42 --message "Deployed to staging"

Export pipeline configuration

Export pipeline configuration

orbit -p myprofile cd pipeline export my-pipeline --plugin-id yaml.config.plugin
orbit -p myprofile cd pipeline export my-pipeline --plugin-id yaml.config.plugin

Compare two pipeline instances

Compare two pipeline instances

orbit -p myprofile cd pipeline compare my-pipeline --from 1 --to 5
orbit -p myprofile cd pipeline compare my-pipeline --from 1 --to 5

Lock/unlock a pipeline

Lock/unlock a pipeline

orbit -p myprofile gocd pipeline lock my-pipeline orbit -p myprofile gocd pipeline unlock my-pipeline
undefined
orbit -p myprofile gocd pipeline lock my-pipeline orbit -p myprofile gocd pipeline unlock my-pipeline
undefined

Pipeline Group Management

流水线组管理

bash
undefined
bash
undefined

List pipeline groups

List pipeline groups

orbit -p myprofile gocd pipeline-group list orbit -p myprofile cd pg list
orbit -p myprofile gocd pipeline-group list orbit -p myprofile cd pg list

Get pipeline group details

Get pipeline group details

orbit -p myprofile cd pg get my-group
orbit -p myprofile cd pg get my-group

Create/update/delete pipeline groups

Create/update/delete pipeline groups

orbit -p myprofile cd pg create --from-file group.yaml orbit -p myprofile cd pg update my-group --from-file group.yaml orbit -p myprofile cd pg delete my-group
undefined
orbit -p myprofile cd pg create --from-file group.yaml orbit -p myprofile cd pg update my-group --from-file group.yaml orbit -p myprofile cd pg delete my-group
undefined

Agent Management

Agent管理

bash
undefined
bash
undefined

List all agents

List all agents

orbit -p myprofile gocd agent list
orbit -p myprofile gocd agent list

View agent details

View agent details

orbit -p myprofile cd agent get <uuid>
orbit -p myprofile cd agent get <uuid>

Enable/disable agents

Enable/disable agents

orbit -p myprofile gocd agent enable <uuid> orbit -p myprofile gocd agent disable <uuid>
orbit -p myprofile gocd agent enable <uuid> orbit -p myprofile gocd agent disable <uuid>

Update agent configuration

Update agent configuration

orbit -p myprofile cd agent update <uuid> --from-file agent.yaml
orbit -p myprofile cd agent update <uuid> --from-file agent.yaml

View agent job history

View agent job history

orbit -p myprofile cd agent job-history <uuid>
orbit -p myprofile cd agent job-history <uuid>

Kill running tasks on an agent

Kill running tasks on an agent

orbit -p myprofile cd agent kill-task <uuid>
orbit -p myprofile cd agent kill-task <uuid>

Delete an agent

Delete an agent

orbit -p myprofile gocd agent delete <uuid>
undefined
orbit -p myprofile gocd agent delete <uuid>
undefined

Environment Management

环境管理

bash
undefined
bash
undefined

List environments

List environments

orbit -p myprofile gocd environment list
orbit -p myprofile gocd environment list

View environment details

View environment details

orbit -p myprofile cd env get production
orbit -p myprofile cd env get production

Create environment with pipelines

Create environment with pipelines

orbit -p myprofile gocd environment create staging --pipeline my-app --pipeline my-api
orbit -p myprofile gocd environment create staging --pipeline my-app --pipeline my-api

Update environment from file

Update environment from file

orbit -p myprofile cd env update staging --from-file env.yaml
orbit -p myprofile cd env update staging --from-file env.yaml

Patch environment (add/remove pipelines and agents)

Patch environment (add/remove pipelines and agents)

orbit -p myprofile cd env patch staging --add-pipeline my-app --remove-pipeline old-app --add-agent agent1
orbit -p myprofile cd env patch staging --add-pipeline my-app --remove-pipeline old-app --add-agent agent1

Delete environment

Delete environment

orbit -p myprofile gocd environment delete staging
undefined
orbit -p myprofile gocd environment delete staging
undefined

Config Repo Operations

配置仓库操作

bash
undefined
bash
undefined

List config repos

List config repos

orbit -p myprofile gocd cr list
orbit -p myprofile gocd cr list

Get config repo details

Get config repo details

orbit -p myprofile cd cr get my-repo
orbit -p myprofile cd cr get my-repo

Create/update/delete config repos

Create/update/delete config repos

orbit -p myprofile cd cr create --from-file repo.yaml orbit -p myprofile cd cr update my-repo --from-file repo.yaml orbit -p myprofile cd cr delete my-repo
orbit -p myprofile cd cr create --from-file repo.yaml orbit -p myprofile cd cr update my-repo --from-file repo.yaml orbit -p myprofile cd cr delete my-repo

Check sync status

Check sync status

orbit -p myprofile cd cr status my-repo
orbit -p myprofile cd cr status my-repo

Trigger config repo update

Trigger config repo update

orbit -p myprofile cd cr trigger my-repo
orbit -p myprofile cd cr trigger my-repo

View definitions from a config repo

View definitions from a config repo

orbit -p myprofile cd cr definitions my-repo
orbit -p myprofile cd cr definitions my-repo

Run preflight check

Run preflight check

orbit -p myprofile cd cr preflight --plugin-id yaml.config.plugin --from-file pipeline.yaml
undefined
orbit -p myprofile cd cr preflight --plugin-id yaml.config.plugin --from-file pipeline.yaml
undefined

User Management

用户管理

bash
undefined
bash
undefined

List users

List users

orbit -p myprofile gocd user list
orbit -p myprofile gocd user list

Get user details

Get user details

orbit -p myprofile cd user get admin
orbit -p myprofile cd user get admin

Create/update/delete users

Create/update/delete users

orbit -p myprofile cd user create --from-file user.yaml orbit -p myprofile cd user update admin --from-file user.yaml orbit -p myprofile cd user delete admin
orbit -p myprofile cd user create --from-file user.yaml orbit -p myprofile cd user update admin --from-file user.yaml orbit -p myprofile cd user delete admin

Bulk delete users

Bulk delete users

orbit -p myprofile cd user delete-bulk --user user1 --user user2
orbit -p myprofile cd user delete-bulk --user user1 --user user2

View current authenticated user

View current authenticated user

orbit -p myprofile cd user current
orbit -p myprofile cd user current

Update current user

Update current user

orbit -p myprofile cd user update-current --from-file user.yaml
undefined
orbit -p myprofile cd user update-current --from-file user.yaml
undefined

Security: Roles & Authorization

安全:角色与授权

bash
undefined
bash
undefined

List roles

List roles

orbit -p myprofile gocd role list
orbit -p myprofile gocd role list

CRUD roles

CRUD roles

orbit -p myprofile cd role get my-role orbit -p myprofile cd role create --from-file role.yaml orbit -p myprofile cd role update my-role --from-file role.yaml orbit -p myprofile cd role delete my-role
orbit -p myprofile cd role get my-role orbit -p myprofile cd role create --from-file role.yaml orbit -p myprofile cd role update my-role --from-file role.yaml orbit -p myprofile cd role delete my-role

List authorization configs

List authorization configs

orbit -p myprofile cd auth-config list
orbit -p myprofile cd auth-config list

CRUD authorization configs

CRUD authorization configs

orbit -p myprofile cd auth-config get my-auth orbit -p myprofile cd auth-config create --from-file auth.yaml orbit -p myprofile cd auth-config update my-auth --from-file auth.yaml orbit -p myprofile cd auth-config delete my-auth
undefined
orbit -p myprofile cd auth-config get my-auth orbit -p myprofile cd auth-config create --from-file auth.yaml orbit -p myprofile cd auth-config update my-auth --from-file auth.yaml orbit -p myprofile cd auth-config delete my-auth
undefined

Plugin Management

插件管理

bash
undefined
bash
undefined

List plugins

List plugins

orbit -p myprofile gocd plugin list
orbit -p myprofile gocd plugin list

Get plugin info

Get plugin info

orbit -p myprofile cd plugin get my-plugin-id
orbit -p myprofile cd plugin get my-plugin-id

Plugin settings CRUD

Plugin settings CRUD

orbit -p myprofile cd plugin get-settings my-plugin-id orbit -p myprofile cd plugin create-settings --from-file settings.yaml orbit -p myprofile cd plugin update-settings my-plugin-id --from-file settings.yaml
undefined
orbit -p myprofile cd plugin get-settings my-plugin-id orbit -p myprofile cd plugin create-settings --from-file settings.yaml orbit -p myprofile cd plugin update-settings my-plugin-id --from-file settings.yaml
undefined

Backup Management

备份管理

bash
undefined
bash
undefined

View backup configuration

View backup configuration

orbit -p myprofile gocd backup get-config
orbit -p myprofile gocd backup get-config

Create/delete backup config

Create/delete backup config

orbit -p myprofile cd backup create-config --from-file backup.yaml orbit -p myprofile cd backup delete-config
orbit -p myprofile cd backup create-config --from-file backup.yaml orbit -p myprofile cd backup delete-config

Schedule a backup

Schedule a backup

orbit -p myprofile cd backup schedule
undefined
orbit -p myprofile cd backup schedule
undefined

Material Operations

材料操作

bash
undefined
bash
undefined

List materials

List materials

orbit -p myprofile gocd material list
orbit -p myprofile gocd material list

Get material details

Get material details

orbit -p myprofile cd material get <fingerprint>
orbit -p myprofile cd material get <fingerprint>

View material usage (which pipelines use it)

View material usage (which pipelines use it)

orbit -p myprofile cd material usage <fingerprint>
orbit -p myprofile cd material usage <fingerprint>

Trigger material update check

Trigger material update check

orbit -p myprofile cd material trigger-update <fingerprint>
undefined
orbit -p myprofile cd material trigger-update <fingerprint>
undefined

Artifact Store Management

制品仓库管理

bash
undefined
bash
undefined

List artifact stores

List artifact stores

orbit -p myprofile gocd artifact list-store
orbit -p myprofile gocd artifact list-store

CRUD artifact stores

CRUD artifact stores

orbit -p myprofile cd artifact get-store my-store orbit -p myprofile cd artifact create-store --from-file store.yaml orbit -p myprofile cd artifact update-store my-store --from-file store.yaml orbit -p myprofile cd artifact delete-store my-store
undefined
orbit -p myprofile cd artifact get-store my-store orbit -p myprofile cd artifact create-store --from-file store.yaml orbit -p myprofile cd artifact update-store my-store --from-file store.yaml orbit -p myprofile cd artifact delete-store my-store
undefined

Elastic Agent Infrastructure

弹性Agent基础设施

bash
undefined
bash
undefined

Cluster profiles

Cluster profiles

orbit -p myprofile cd cp list orbit -p myprofile cd cp get my-cluster orbit -p myprofile cd cp create --from-file cluster.yaml orbit -p myprofile cd cp update my-cluster --from-file cluster.yaml orbit -p myprofile cd cp delete my-cluster
orbit -p myprofile cd cp list orbit -p myprofile cd cp get my-cluster orbit -p myprofile cd cp create --from-file cluster.yaml orbit -p myprofile cd cp update my-cluster --from-file cluster.yaml orbit -p myprofile cd cp delete my-cluster

Elastic agent profiles

Elastic agent profiles

orbit -p myprofile cd eap list orbit -p myprofile cd eap get my-profile orbit -p myprofile cd eap create --from-file profile.yaml orbit -p myprofile cd eap update my-profile --from-file profile.yaml orbit -p myprofile cd eap delete my-profile orbit -p myprofile cd eap usage my-profile
undefined
orbit -p myprofile cd eap list orbit -p myprofile cd eap get my-profile orbit -p myprofile cd eap create --from-file profile.yaml orbit -p myprofile cd eap update my-profile --from-file profile.yaml orbit -p myprofile cd eap delete my-profile orbit -p myprofile cd eap usage my-profile
undefined

Stage & Job Operations

阶段与任务操作

bash
undefined
bash
undefined

Cancel a running stage

Cancel a running stage

orbit -p myprofile cd stage cancel --pipeline my-pipeline --counter 5 --stage build --stage-counter 1
orbit -p myprofile cd stage cancel --pipeline my-pipeline --counter 5 --stage build --stage-counter 1

Run/re-run a stage

Run/re-run a stage

orbit -p myprofile cd stage run --pipeline my-pipeline --counter 5 --stage build
orbit -p myprofile cd stage run --pipeline my-pipeline --counter 5 --stage build

Run specific jobs in a stage

Run specific jobs in a stage

orbit -p myprofile cd job run --pipeline my-pipeline --stage build --pipeline-counter 5 --stage-counter 1 --job unit-test --job integration-test
undefined
orbit -p myprofile cd job run --pipeline my-pipeline --stage build --pipeline-counter 5 --stage-counter 1 --job unit-test --job integration-test
undefined

Server Administration

服务器管理

bash
undefined
bash
undefined

Server health

Server health

orbit -p myprofile gocd server health
orbit -p myprofile gocd server health

Maintenance mode

Maintenance mode

orbit -p myprofile cd server maintenance orbit -p myprofile cd server maintenance-on orbit -p myprofile cd server maintenance-off
orbit -p myprofile cd server maintenance orbit -p myprofile cd server maintenance-on orbit -p myprofile cd server maintenance-off

Site URLs

Site URLs

orbit -p myprofile cd sc site-url get orbit -p myprofile cd sc site-url update --url https://gocd.example.com --secure-url https://gocd.example.com
orbit -p myprofile cd sc site-url get orbit -p myprofile cd sc site-url update --url https://gocd.example.com --secure-url https://gocd.example.com

Artifact config

Artifact config

orbit -p myprofile cd sc artifact-config get orbit -p myprofile cd sc artifact-config update --from-file artifact.yaml
orbit -p myprofile cd sc artifact-config get orbit -p myprofile cd sc artifact-config update --from-file artifact.yaml

Job timeout

Job timeout

orbit -p myprofile cd sc job-timeout get orbit -p myprofile cd sc job-timeout update --timeout 30
orbit -p myprofile cd sc job-timeout get orbit -p myprofile cd sc job-timeout update --timeout 30

Mail server

Mail server

orbit -p myprofile cd sc mail-server get orbit -p myprofile cd sc mail-server update --from-file mail.yaml orbit -p myprofile cd sc mail-server delete
orbit -p myprofile cd sc mail-server get orbit -p myprofile cd sc mail-server update --from-file mail.yaml orbit -p myprofile cd sc mail-server delete

Encryption

Encryption

orbit -p myprofile gocd encrypt my-secret-password
undefined
orbit -p myprofile gocd encrypt my-secret-password
undefined

Pipeline Template Management

流水线模板管理

bash
undefined
bash
undefined

List templates

List templates

orbit -p myprofile gocd template list orbit -p myprofile cd tmpl list
orbit -p myprofile gocd template list orbit -p myprofile cd tmpl list

Get template details

Get template details

orbit -p myprofile cd tmpl get my-template
orbit -p myprofile cd tmpl get my-template

Create/update/delete templates

Create/update/delete templates

orbit -p myprofile cd tmpl create --from-file template.yaml orbit -p myprofile cd tmpl update my-template --from-file template.yaml orbit -p myprofile cd tmpl delete my-template
undefined
orbit -p myprofile cd tmpl create --from-file template.yaml orbit -p myprofile cd tmpl update my-template --from-file template.yaml orbit -p myprofile cd tmpl delete my-template
undefined

Package Repository & Package Management

包仓库与包管理

bash
undefined
bash
undefined

List package repositories

List package repositories

orbit -p myprofile gocd package-repo list orbit -p myprofile cd pkg-repo list
orbit -p myprofile gocd package-repo list orbit -p myprofile cd pkg-repo list

CRUD package repositories

CRUD package repositories

orbit -p myprofile cd pkg-repo get repo-id orbit -p myprofile cd pkg-repo create --from-file repo.yaml orbit -p myprofile cd pkg-repo update repo-id --from-file repo.yaml orbit -p myprofile cd pkg-repo delete repo-id
orbit -p myprofile cd pkg-repo get repo-id orbit -p myprofile cd pkg-repo create --from-file repo.yaml orbit -p myprofile cd pkg-repo update repo-id --from-file repo.yaml orbit -p myprofile cd pkg-repo delete repo-id

List packages

List packages

orbit -p myprofile gocd package list orbit -p myprofile cd pkg list
orbit -p myprofile gocd package list orbit -p myprofile cd pkg list

CRUD packages

CRUD packages

orbit -p myprofile cd pkg get pkg-id orbit -p myprofile cd pkg create --from-file package.yaml orbit -p myprofile cd pkg update pkg-id --from-file package.yaml orbit -p myprofile cd pkg delete pkg-id
orbit -p myprofile cd pkg get pkg-id orbit -p myprofile cd pkg create --from-file package.yaml orbit -p myprofile cd pkg update pkg-id --from-file package.yaml orbit -p myprofile cd pkg delete pkg-id

View package usage (which pipelines use it)

View package usage (which pipelines use it)

orbit -p myprofile cd pkg usage pkg-id
undefined
orbit -p myprofile cd pkg usage pkg-id
undefined

Notification Filter Management

通知过滤器管理

bash
undefined
bash
undefined

List notification filters

List notification filters

orbit -p myprofile gocd notification-filter list orbit -p myprofile cd nf list
orbit -p myprofile gocd notification-filter list orbit -p myprofile cd nf list

Get/create/delete notification filters

Get/create/delete notification filters

orbit -p myprofile cd nf get 1 orbit -p myprofile cd nf create --from-file filter.yaml orbit -p myprofile cd nf delete 1
undefined
orbit -p myprofile cd nf get 1 orbit -p myprofile cd nf create --from-file filter.yaml orbit -p myprofile cd nf delete 1
undefined

Dashboard & Version

仪表盘与版本

bash
undefined
bash
undefined

View dashboard overview

View dashboard overview

orbit -p myprofile gocd dashboard
orbit -p myprofile gocd dashboard

Check server version

Check server version

orbit -p myprofile gocd version
undefined
orbit -p myprofile gocd version
undefined

Access Token Management

访问令牌管理

bash
undefined
bash
undefined

List your access tokens

List your access tokens

orbit -p myprofile gocd access-token list orbit -p myprofile cd token list
orbit -p myprofile gocd access-token list orbit -p myprofile cd token list

Create a new token

Create a new token

orbit -p myprofile cd token create --description "CI token"
orbit -p myprofile cd token create --description "CI token"

Revoke a token

Revoke a token

orbit -p myprofile cd token revoke 42 --cause "No longer needed"
orbit -p myprofile cd token revoke 42 --cause "No longer needed"

Admin: list all tokens across users

Admin: list all tokens across users

orbit -p myprofile cd token list-all
orbit -p myprofile cd token list-all

Admin: revoke any user's token

Admin: revoke any user's token

orbit -p myprofile cd token revoke-admin 42 --cause "Security review"
undefined
orbit -p myprofile cd token revoke-admin 42 --cause "Security review"
undefined

Secret Configuration Management

机密配置管理

bash
undefined
bash
undefined

List secret configurations

List secret configurations

orbit -p myprofile gocd secret-config list orbit -p myprofile cd secret list
orbit -p myprofile gocd secret-config list orbit -p myprofile cd secret list

CRUD secret configurations

CRUD secret configurations

orbit -p myprofile cd secret get my-secret orbit -p myprofile cd secret create --from-file secret.yaml orbit -p myprofile cd secret update my-secret --from-file secret.yaml orbit -p myprofile cd secret delete my-secret
undefined
orbit -p myprofile cd secret get my-secret orbit -p myprofile cd secret create --from-file secret.yaml orbit -p myprofile cd secret update my-secret --from-file secret.yaml orbit -p myprofile cd secret delete my-secret
undefined

Common Patterns

通用模式

Create/Update Resources from File

从文件创建/更新资源

Most CRUD commands accept
--from-file
for YAML or JSON input:
bash
orbit -p myprofile cd pipeline create --group my-group --from-file pipeline.yaml
orbit -p myprofile cd cr create --from-file config-repo.json
orbit -p myprofile cd role create --from-file role.yaml
大多数增删改查命令接受
--from-file
参数,支持YAML或JSON输入:
bash
orbit -p myprofile cd pipeline create --group my-group --from-file pipeline.yaml
orbit -p myprofile cd cr create --from-file config-repo.json
orbit -p myprofile cd role create --from-file role.yaml

ETag-Based Updates

基于ETag的更新

For resources that require optimistic locking (pipelines, pipeline groups, environments, config repos, roles, auth configs, plugins, cluster profiles, elastic agent profiles, artifact stores), the CLI handles ETag retrieval automatically — just provide the
--from-file
with updated config.
对于需要乐观锁的资源(流水线、流水线组、环境、配置仓库、角色、授权配置、插件、集群配置文件、弹性Agent配置文件、制品仓库),CLI会自动处理ETag获取——只需提供包含更新配置的
--from-file
参数即可。

Debug a Failing Config Repo

调试失败的配置仓库

bash
orbit -p myprofile cd cr status my-config-repo
orbit -p myprofile cd cr definitions my-config-repo
orbit -p myprofile cd cr trigger my-config-repo
bash
orbit -p myprofile cd cr status my-config-repo
orbit -p myprofile cd cr definitions my-config-repo
orbit -p myprofile cd cr trigger my-config-repo

Prepare for Maintenance

Prepare for Maintenance

bash
orbit -p myprofile cd agent list
orbit -p myprofile cd server maintenance-on
bash
orbit -p myprofile cd agent list
orbit -p myprofile cd server maintenance-on

... perform maintenance ...

... perform maintenance ...

orbit -p myprofile cd server maintenance-off
undefined
orbit -p myprofile cd server maintenance-off
undefined

Important Notes

重要说明

  • GoCD API uses versioned Accept headers — handled automatically by the CLI.
  • Update operations use ETag-based optimistic locking — the CLI handles this transparently.
  • The
    --service
    flag is only needed when a profile has multiple GoCD services configured.
  • base_url
    is required in service configuration (GoCD is always self-hosted).
  • All destructive operations execute immediately without confirmation prompts.
  • Output formats:
    table
    (default),
    json
    ,
    yaml
    .
  • GoCD API使用版本化的Accept请求头——CLI会自动处理。
  • 更新操作使用基于ETag的乐观锁——CLI会透明处理此过程。
  • 当配置文件中配置了多个GoCD服务时,才需要使用
    --service
    参数。
  • 服务配置中必须包含
    base_url
    (GoCD始终为自托管)。
  • 所有破坏性操作会立即执行,无确认提示。
  • 输出格式:
    table
    (默认)、
    json
    yaml