Documentation Index
Fetch the complete documentation index at: https://mintlify.com/go-gitea/gitea/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Gitea provides a comprehensive command-line interface for administrative tasks. All commands are accessed through thegitea binary.
Command Structure
Admin Commands
Theadmin command provides administrative operations (see cmd/admin.go:22-89).
User Management
All user management commands are undergitea admin user (see cmd/admin_user.go).
Create User
Create a new user account (seecmd/admin_user_create.go:22-101):
Username for the new account
Email address for the new account
Password for the account (required unless using
--random-password)Generate a random password
Length of the generated random password
Create user as administrator
Require password change on first login (default for all users except the first)
Create as a restricted user account
User type:
individual or botFull, human-readable name of the user
Generate an access token for the user
Name for the generated access token
Comma-separated scopes:
all, read:user, write:repository, etc.List Users
Change Password
Delete User
--id- Delete by user ID instead of username--purge- Purge user data completely
Generate Access Token
Force Password Change
Authentication Sources
Manage external authentication sources via CLI (seecmd/admin_auth.go).
List Authentication Sources
- ID
- Name
- Type (LDAP, OAuth2, SMTP, etc.)
- Enabled status
Add LDAP Authentication
See Authentication Documentation for detailed LDAP configuration.Add OAuth2 Authentication
Add SMTP Authentication
Update Authentication Source
Delete Authentication Source
Repository Operations
Sync Repository Releases
Synchronize repository releases with Git tags (seecmd/admin.go:98-157):
- Scans all repositories
- Compares tags with releases
- Creates releases for tags without corresponding releases
Regenerate Data
Regenerate Git hooks and SSH keys (seecmd/admin_regenerate.go).
Regenerate Git Hooks
- Gitea upgrades
- Manual hook modifications
- Repository corruption
Regenerate SSH Keys
authorized_keys file from the database.
Send Mail to All Users
Send an administrative message to all users:Backup and Restore
See Backup and Restore Documentation for complete details.Create Backup
Restore Repository
Database Operations
Run Migrations
Migrate Storage
Migrate storage between different backends:lfs- LFS objectsavatars- User avatarsattachments- Issue/comment attachmentspackages- Package registry datarepo-avatars- Repository avatars
Configuration Management
View Configuration
- Default values
- app.ini overrides
- Environment variable overrides
Logging Management
Doctor Commands
Diagnostic and repair tools:Available Checks
paths- Check path configurationsdb-version- Verify database versiondb-consistency- Check database consistencyrepo-integrity- Verify repository integritycheck-hooks- Validate Git hookscheck-db-consistency- Advanced database checksauthorized-keys- Check SSH authorized_keys fileconfig- Validate configuration
Run Specific Check
Repair Mode
Convert Database Encoding
Certificate Management
Generate Self-Signed Certificate
cert.pem- Certificatekey.pem- Private key
Web Server
Start Gitea
--port- Override HTTP port--pid- Write PID to file--config- Specify config file location
Generate Commands
Generate Secret Keys
Hook Commands
Internal Git hook commands (used by Git, not for manual execution):Service Commands
Manager Commands
Environment Variables
Common environment variables for CLI commands:Best Practices
Use Configuration File
Always specify
--config or set GITEA_CUSTOM to ensure commands use the correct configuration