Friendly identifier for the repository. Used when switching between repositories.
'hyve git'
The hyve git command group manages Git repositories for state management in Hyve. All cluster configurations, workflows, and templates are stored in Git repositories, enabling GitOps workflows and version control.
Overview
Hyve requires at least one Git repository for storing cluster state. You can configure multiple repositories for different environments (e.g., production, staging, development) and switch between them.
Commands
hyve git add
Add a new Git repository configuration for state management.
hyve git add [repository-name] --repo-url <url> [flags]repository-name string required --repo-url string required Git repository URL (HTTPS or SSH format)
--username string Git username for authentication (stored in repository config)
--set-current boolean default: false Set this repository as the current active repository after adding
--path string Custom local path for the repository clone. Defaults to ~/.hyve/repositories/<repository-name> if omitted. Persisted β no need to pass --path again on future commands. Change it later with hyve git set-path.
Example:
# Add a production repositoryhyve git add production --repo-url https://github.com/company/hyve-prod.git
# Add with username and set as currenthyve git add staging \ --repo-url https://github.com/company/hyve-staging.git \ --username myuser \ --set-current
# Clone somewhere other than the default ~/.hyve/repositories/<name>hyve git add production \ --repo-url https://github.com/company/hyve-prod.git \ --path ~/code/hyve-prodOutput:
Adding Git repository 'production': https://github.com/company/hyve-prod.gitTesting Git repository connection...β
Git repository connected successfully!Repository 'production' added successfully!Repository URL: https://github.com/company/hyve-prod.gitLocal path: /Users/username/.hyve/repositories/productionAuthentication: β
Global credentials configured
π‘ Tips: - Use 'hyve git list' to see all repositories - Use 'hyve git use <name>' to switch repositories - Use 'hyve git credentials' to manage global Git authenticationhyve git list
List all configured Git repositories and their status.
hyve git listExample:
hyve git listOutput:
π Configured Git repositories (3):
production (current) β URL: https://github.com/company/hyve-prod.git Local: /Users/username/.hyve/repositories/production User: myuser Added: 2024-01-15 10:30
staging URL: https://github.com/company/hyve-staging.git Local: /Users/username/.hyve/repositories/staging Added: 2024-01-14 09:15
development URL: https://github.com/company/hyve-dev.git Local: /Users/username/.hyve/repositories/development Added: 2024-01-13 14:45
π Authentication: β
Global credentials configured (myuser)π Environment Fallback: β
HYVE_GIT_TOKEN configuredhyve git use
Switch to a different Git repository as the current active repository.
hyve git use [repository-name]repository-name string required Name of the repository to switch to
Example:
hyve git use stagingOutput:
β
Switched to repository 'staging'Repository URL: https://github.com/company/hyve-staging.gitLocal path: /Users/username/.hyve/repositories/staginghyve git status
Show current Git configuration status and test repository connection.
hyve git statusExample:
hyve git statusOutput:
β
Current repository: productionRepository URL: https://github.com/company/hyve-prod.gitLocal path: /Users/username/.hyve/repositories/productionUsername: myuserAuthentication: β
Global credentials configured (myuser)
Testing connection...β
Connection successfulhyve git path
Print a repositoryβs absolute local filesystem path β nothing else is written to stdout, so it composes with shell substitution for quickly navigating to the repo.
hyve git path [flags]--repo string Repository name. Defaults to the current repository.
Example:
cd "$(hyve git path)"
# A different repositorycd "$(hyve git path --repo staging)"Output:
/Users/username/.hyve/repositories/productionhyve git set-path
Move a repositoryβs local clone to a new location on disk and persist it β no --path flag is needed on any future command, the new location is remembered.
hyve git set-path <new-path> [flags]new-path string required Where to move the repositoryβs local clone.
--repo string Repository name to move. Defaults to the current repository.
Example:
hyve git set-path ~/code/hyve-prod
# A different repositoryhyve git set-path /Volumes/external/hyve-staging --repo stagingOutput:
β
Repository 'production' local path updated Old: /Users/username/.hyve/repositories/production New: /Users/username/code/hyve-prod
π‘ No --path flag needed going forward β this is persisted.hyve git reset-path
Move a repositoryβs local clone back to the default location (~/.hyve/repositories/<name>), undoing a previous hyve git set-path.
hyve git reset-path [flags]--repo string Repository name to reset. Defaults to the current repository.
Example:
hyve git reset-pathhyve git remove
Remove a Git repository configuration from storage and delete its local clone from disk.
hyve git remove [repository-name] [flags]repository-name string required Name of the repository to remove
--keep-files boolean default: false Keep the local clone on disk instead of deleting it
Example:
hyve git remove developmentOutput:
β
Repository 'development' removed successfullyRemoved local clone at "/Users/you/.hyve/repositories/development"Current repository is now: productionPass --keep-files to drop the configuration without touching the clone on disk β useful if --path pointed the repository at a directory you manage yourself.
hyve git reset
Remove all Git repository configurations and their local clones, and revert to local state directory.
hyve git reset [flags]--keep-files boolean default: false Keep local clones on disk instead of deleting them
Example:
hyve git resetOutput:
β
All Git configurations resetAdd a Git repository to continue using Hyve: hyve git add <name> --repo-url <url>hyve git credentials
Manage global Git credentials for authentication.
hyve git credentials [flags]--username string Git username for authentication
--password string Git password or personal access token
--clear boolean default: false Clear all stored credentials
Examples:
# Store credentialshyve git credentials --username myuser --password ghp_xxxxxxxxxxxx
# View current credentialshyve git credentials
# Clear credentialshyve git credentials --clearOutput (store):
β
Global Git credentials stored securelyUsername: myuserPassword: β
Stored and encryptedOutput (view):
β
Global Git credentials:Username: myuserPassword: β
Stored and encryptedUpdated: 2024-01-15 10:30:45
π‘ Environment token also available as fallbackhyve git credentials-migrate
Migrate credentials encryption from hostname-based keys to portable keys.
hyve git credentials-migrate [old-hostname]old-hostname string required Hostname that was used when credentials were originally encrypted
Example:
hyve git credentials-migrate "old-macbook.local"Output:
π Starting credentials encryption migrationπ Old hostname: old-macbook.local
β
Migration completed successfully!
π Your credentials have been re-encrypted with the new portable key format.π‘ Your credentials will now work across different machines without hostname dependencies.Branch Management
hyve git branch list
List all branches in the current Git repository.
hyve git branch listExample:
hyve git branch listOutput:
πΏ Branches in repository 'production':
* main (a1b2c3d) feature/new-cluster (e4f5g6h) hotfix/cluster-config (i7j8k9l)
π‘ Commands: hyve git branch create <name> # Create new branch hyve git branch switch <name> # Switch to branch hyve git branch delete <name> # Delete branchhyve git branch create
Create a new branch from the current HEAD.
hyve git branch create [branch-name] [flags]branch-name string required Name of the new branch to create
--switch boolean default: false Switch to the new branch after creating it
--push boolean default: false Push the branch to remote after creating it
Example:
# Create and switch to new branchhyve git branch create feature/add-monitoring --switch
# Create, switch, and pushhyve git branch create feature/new-env --switch --pushOutput:
Creating branch 'feature/add-monitoring' from 'main'...β
Branch 'feature/add-monitoring' created successfullyβ
Switched to branch 'feature/add-monitoring'hyve git branch delete
Delete a branch from the local repository.
hyve git branch delete [branch-name] [flags]branch-name string required Name of the branch to delete
--force boolean default: false Force delete the branch (even if unmerged)
Example:
hyve git branch delete feature/old-feature --forceOutput:
Deleting branch 'feature/old-feature'...β
Branch 'feature/old-feature' deleted successfully
π‘ The branch has been deleted locally.π‘ To delete from remote, use: git push origin --delete feature/old-featurehyve git branch switch
Switch to a different branch (git checkout).
hyve git branch switch [branch-name] [flags]branch-name string required Name of the branch to switch to
--pull boolean default: false Pull latest changes after switching
Example:
hyve git branch switch main --pullOutput:
Switching from 'feature/add-monitoring' to 'main'...β
Switched to branch 'main'Pulling latest changes...β
Pulled latest changes
π‘ Your working directory now reflects the 'main' branchπ‘ Changes made will be tracked on this branchSynchronization
hyve git pull
Pull the latest changes from the remote repository for the current branch.
hyve git pullExample:
hyve git pullOutput:
Pulling latest changes from 'main'...β
Successfully pulled latest changes
π‘ Your local branch is now up to date with remotehyve git push
Stage all changes, commit with a message, and push to remote.
hyve git push [commit-message]commit-message string Commit message. If not provided, a default message will be generated based on changes.
Example:
hyve git push "Add new production cluster configuration"Output:
π Changes detected: 2 files changed, 45 insertions(+)Committing changes to 'main'...β
Changes committed successfullyPushing to remote 'main'...β
Changes pushed successfully
π‘ Branch 'main' is now synchronized with remotehyve git sync
Pull latest changes from remote and push any local changes.
hyve git sync [commit-message]commit-message string Commit message for local changes. If not provided, youβll be prompted.
Example:
hyve git sync "Sync cluster configurations"Output:
π Syncing branch 'main' with remote...
1. Pulling latest changes from remote...β
Pulled latest changes
2. Local changes detected: 3 files changed, 67 insertions(+)
3. Committing local changes...β
Changes committed
4. Pushing to remote...β
Changes pushed
β
Branch 'main' is now fully synchronizedAuthentication
Hyve supports multiple authentication methods for Git operations:
- Global Credentials (Recommended): Store credentials securely using
hyve git credentials - Environment Variable: Set
HYVE_GIT_TOKENwith your personal access token - Repository-specific Username: Provide username with
--usernameflag when adding repository
Priority Order
- Global credentials (username + password from
hyve git credentials) - Environment token (
HYVE_GIT_TOKEN) - No authentication (for public repositories)
Storage
All Git repository metadata is stored in:
~/.hyve/βββ repositories.db # Repository configurations (SQLite)βββ credentials.db # Encrypted credentials (AES-GCM)βββ repositories/ # Cloned repository storage βββ production/ β βββ clusters/ β βββ workflows/ β βββ templates/ βββ staging/Common Use Cases
Multi-Environment Setup
# Add repositories for each environmenthyve git add production --repo-url https://github.com/company/hyve-prod.githyve git add staging --repo-url https://github.com/company/hyve-staging.githyve git add development --repo-url https://github.com/company/hyve-dev.git
# Switch between environmentshyve git use production # Work with production clustershyve git use staging # Switch to stagingFeature Branch Workflow
# Create feature branchhyve git branch create feature/add-monitoring --switch
# Make changes to cluster configshyve cluster add monitoring-cluster --provider civo --region PHX1
# Commit and push changeshyve git push "Add monitoring cluster configuration"
# Switch back to mainhyve git branch switch mainCredential Management
# Store credentials securelyhyve git credentials --username myuser --password ghp_xxxxxxxxxxxx
# Or use environment variableexport HYVE_GIT_TOKEN=ghp_xxxxxxxxxxxx
# Verify authenticationhyve git statusRelated Commands
- hyve cluster - Manage cluster definitions stored in Git
- hyve workflow - Manage workflows stored in Git
- hyve template - Manage templates stored in Git