跳到主要内容

Command reference

Every command, subcommand and flag the semaphore binary accepts, in the order semaphore help walks the tree. Use it to confirm a flag name or a default; the pages next to it explain what the commands are for.

Every command reads the same configuration as the server, so point it at the right configuration file with --config when you run more than one instance on a host. See CLI for the lookup order.

Global flags

These are accepted by every command.

FlagTypeDefaultDescription
--configstringConfiguration file path
--debug-filterstringDebug namespace filter (only with DEBUG level), e.g. 'runner,task_' or ',-db'
--log-levelstringLog level: DEBUG, INFO, WARN, ERROR, FATAL, PANIC
--no-configboolDon't use configuration file

semaphore migrate

Execute migrations

semaphore migrate
FlagTypeDefaultDescription
--apply-tostringApply to specific version
--err-log-sizeint0Error log size
--merge-existing-usersboolReuse existing users matched by username instead of failing on conflict
--skip-task-outputboolSkip task output importing during migration
--undo-tostringUndo to specific version

semaphore projects

Manage projects

semaphore projects

Aliases: project.

SubcommandPurpose
semaphore projects exportExport project backup
semaphore projects importImport project(s)

semaphore projects export

Export project backup

semaphore projects export
FlagTypeDefaultDescription
--filestringOutput file path (default: stdout)
--project-idint0Project ID to export
--project-namestringProject name to export

semaphore projects import

Import project(s)

semaphore projects import
FlagTypeDefaultDescription
--dirstringDirectory path with project backups to import
--filestringBackup file path to import
--project-namestringOverride project name (only valid with --file)

semaphore runner

Run in runner mode

semaphore runner
SubcommandPurpose
semaphore runner registerRegister runner on the server
semaphore runner setupPerform interactive setup
semaphore runner startRun in runner mode
semaphore runner unregisterUnregister runner from the server

semaphore runner register

Register runner on the server

semaphore runner register
FlagTypeDefaultDescription
--enabledbooltrueEnable or disable the runner on the server
--namestringRunner name to register with
--project-idint0Project ID for project-level runner (global runner if not provided)
--registration-token-filestringRead registration token from a file
--stdin-registration-tokenboolRead registration token from stdin
--tagsstringSliceRunner tags (comma-separated or repeat the flag)
--webhookstringRunner webhook URL

semaphore runner setup

Perform interactive setup

semaphore runner setup

semaphore runner start

Run in runner mode

semaphore runner start
FlagTypeDefaultDescription
--auto-registerboolRegister new runner if not registered
--registerboolAlias of --auto-register

semaphore runner unregister

Unregister runner from the server

semaphore runner unregister

semaphore server

Run in server mode

semaphore server

Aliases: service.

semaphore setup

Perform interactive setup

semaphore setup

semaphore users

Manage users

semaphore users

Aliases: user.

SubcommandPurpose
semaphore users addAdd new user
semaphore users change-by-emailChange user found by email
semaphore users change-by-loginChange user found by login
semaphore users deleteRemove existing user
semaphore users getShow user's data
semaphore users listPrint all users
semaphore users tokenManage user API tokens
semaphore users totpManage TOTP verification

semaphore users add

Add new user

semaphore users add
FlagTypeDefaultDescription
--adminboolMark new user as admin
--emailstringNew user email
--externalboolMark new user as external (LDAP or OIDC user)
--loginstringNew user login
--namestringNew user name
--passwordstringNew user password

semaphore users change-by-email

Change user found by email

semaphore users change-by-email
FlagTypeDefaultDescription
--adminboolMark user as admin
--emailstringUser's new email
--loginstringUser login
--namestringUser's new name
--passwordstringUser's new password

semaphore users change-by-login

Change user found by login

semaphore users change-by-login
FlagTypeDefaultDescription
--adminboolMark user as admin
--emailstringUser's new email
--loginstringUser login
--namestringUser's new name
--passwordstringUser's new password

semaphore users delete

Remove existing user

semaphore users delete
FlagTypeDefaultDescription
--emailstringEmail of the user you want to delete
--loginstringLogin of the user you want to delete

semaphore users get

Show user's data

semaphore users get
FlagTypeDefaultDescription
--emailstringEmail of the user you want to see
--loginstringLogin of the user you want to see

semaphore users list

Print all users

semaphore users list

semaphore users token

Manage user API tokens

semaphore users token
SubcommandPurpose
semaphore users token createCreate new API token
semaphore users token listList user API tokens

semaphore users token create

Create new API token

semaphore users token create
FlagTypeDefaultDescription
--loginstringLogin of the token owner
--namestringToken name
--ttlstringToken lifetime (e.g. 1h, 30m, 24h). Token never expires if omitted

semaphore users token list

List user API tokens

semaphore users token list
FlagTypeDefaultDescription
--loginstringLogin of the token owner

semaphore users totp

Manage TOTP verification

semaphore users totp
SubcommandPurpose
semaphore users totp disableDisable TOTP verification
semaphore users totp enableEnable TOTP verification
semaphore users totp showShow TOTP details

semaphore users totp disable

Disable TOTP verification

semaphore users totp disable
FlagTypeDefaultDescription
--loginstringUser login

semaphore users totp enable

Enable TOTP verification

semaphore users totp enable
FlagTypeDefaultDescription
--loginstringUser login

semaphore users totp show

Show TOTP details

semaphore users totp show
FlagTypeDefaultDescription
--loginstringUser login

semaphore vaults

Manage access keys and other secrets

semaphore vaults

Aliases: vault.

SubcommandPurpose
semaphore vaults checkReport which key id encrypts each stored secret
semaphore vaults rekeyRe-encrypt all stored secrets under the active encryption key

semaphore vaults check

Read-only. Reports, per key id, how many locally stored Access Key secrets and the JWT signing key it encrypts, plus the JWT option's status. Use it after vault rekey to confirm a retired key is safe to remove: a key with zero references can be deleted from the keyset. Rows whose key id is missing from the keyset are flagged and cause a non-zero exit.

semaphore vaults check

semaphore vaults rekey

Re-encrypt all locally stored secrets (access keys and the JWT signing key) under the active key, stamping its key id into each value. Zero-downtime rotation: 1. Add a new key to the keyset (a file in keys_folder, or a keys: entry) and point active.access_key (or access_key_file) at it; reload applies it within keys_poll_interval, or send kill -HUP <pid>. 2. Run vault rekey to re-encrypt existing data to the new key. 3. Run vault check; once the old key shows 0 rows it is safe to remove. Legacy: vault rekey --old-key <old-key> decrypts un-prefixed data with an explicit old key.

semaphore vaults rekey
FlagTypeDefaultDescription
--backupstringWrite a backup of current access key ciphertexts to this file before re-encrypting
--old-keystringExplicit old encryption key (legacy single-key migration; not needed when the old key is configured as a secondary)
--rollbackstringRestore access key ciphertexts from a backup file instead of re-encrypting

semaphore version

Print the version of Semaphore

semaphore version