Skip to content

Commit a3dab24

Browse files
committed
References and command update in setup module
1 parent 85b276f commit a3dab24

File tree

1 file changed

+71
-69
lines changed

1 file changed

+71
-69
lines changed

modules/gitssh-setup.sh

Lines changed: 71 additions & 69 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/bin/sh
22

33
#================================================================#
4-
# GIT-SSH SETUP MODULE
4+
# GitSSH SETUP MODULE
55
# Interactive SSH key setup for GitHub and GitLab
66
#================================================================#
77

@@ -67,15 +67,15 @@ setup_github() {
6767
return 1
6868
fi
6969

70-
# Step 8: Integration with Git-SSH Session Manager
70+
# Step 8: Integration with GitSSH Session Manager
7171
_integrate_with_session_manager "github"
7272

7373
_print_success "GitHub SSH setup completed successfully!"
7474
printf "\n"
75-
_print_info "You can now use the Git-SSH Session Manager:"
76-
printf " • Run 'session_set' to configure your identity for repositories\n"
77-
printf " • Use 'git_clone', 'git_push', etc. for enhanced Git operations\n"
78-
printf " • Run 'ssh_remote' to convert HTTPS repositories to SSH\n"
75+
_print_info "You can now use the GitSSH Session Manager:"
76+
printf " • Run 'gitssh session set' to configure your identity for repositories\n"
77+
printf " • Use 'gitssh clone', 'gitssh push', etc. for enhanced Git operations\n"
78+
printf " • Run 'gitssh remote convert' to convert HTTPS repositories to SSH\n"
7979
printf "\n"
8080
}
8181

@@ -133,15 +133,15 @@ setup_gitlab() {
133133
return 1
134134
fi
135135

136-
# Step 8: Integration with Git-SSH Session Manager
136+
# Step 8: Integration with GitSSH Session Manager
137137
_integrate_with_session_manager "gitlab"
138138

139139
_print_success "GitLab SSH setup completed successfully!"
140140
printf "\n"
141-
_print_info "You can now use the Git-SSH Session Manager:"
142-
printf " • Run 'session_set' to configure your identity for repositories\n"
143-
printf " • Use 'git_clone', 'git_push', etc. for enhanced Git operations\n"
144-
printf " • Run 'ssh_remote' to convert HTTPS repositories to SSH\n"
141+
_print_info "You can now use the GitSSH Session Manager:"
142+
printf " • Run 'gitssh session set' to configure your identity for repositories\n"
143+
printf " • Use 'gitssh clone', 'gitssh push', etc. for enhanced Git operations\n"
144+
printf " • Run 'gitssh remote convert' to convert HTTPS repositories to SSH\n"
145145
printf "\n"
146146
}
147147

@@ -187,7 +187,7 @@ ssh_status() {
187187

188188
if [ "$key_count" -eq 0 ]; then
189189
_print_warning "No SSH keys found"
190-
printf " Run 'setup_github' or 'setup_gitlab' to create keys\n"
190+
printf " Run 'gitssh setup github' or 'gitssh setup gitlab' to create keys\n"
191191
fi
192192
printf "\n"
193193

@@ -576,7 +576,7 @@ _generate_ssh_key() {
576576
printf "\nKey details:\n"
577577
printf " Private key: %s (keep this secret!)\n" "$KEY_PATH"
578578
printf " Public key: %s (this will be added to $service)\n" "$KEY_PATH.pub"
579-
printf " Fingerprint: "
579+
printf " Fingerprint: "gitssh ssh
580580
ssh-keygen -lf "$KEY_PATH.pub" 2>/dev/null | awk '{print $2}'
581581
else
582582
_print_error "Failed to generate SSH key"
@@ -893,21 +893,21 @@ _test_gitlab_connection() {
893893
# INTEGRATION FUNCTIONS
894894
#================================================================#
895895

896-
# Integrate with Git-SSH Session Manager
896+
# Integrate with GitSSH Session Manager
897897
_integrate_with_session_manager() {
898898
service="$1"
899899

900-
printf "Step 8: Integration with Git-SSH Session Manager\n"
900+
printf "Step 8: Integration with GitSSH Session Manager\n"
901901
printf "================================================\n"
902902

903-
_print_info "About Git-SSH Session Manager:"
903+
_print_info "About GitSSH Session Manager:"
904904
printf "This tool helps you manage multiple Git identities and SSH keys.\n"
905905
printf "It automatically configures the right user for each repository.\n\n"
906906

907-
# Check if Git-SSH Session Manager is available
907+
# Check if GitSSH Session Manager is available
908908
if ! _check_dependencies 2>/dev/null; then
909-
_print_warning "Git-SSH Session Manager not fully configured"
910-
printf "Run 'git_ssh_init' to complete the setup\n\n"
909+
_print_warning "GitSSH Session Manager not fully configured"
910+
printf "Run 'gitssh init' to complete the setup\n\n"
911911
return 0
912912
fi
913913

@@ -922,14 +922,14 @@ _integrate_with_session_manager() {
922922
esac
923923

924924
if ! _user_exists "$username" 2>/dev/null; then
925-
printf "Adding user to Git-SSH Session Manager...\n"
925+
printf "Adding user to GitSSH Session Manager...\n"
926926

927927
# Add user to config
928928
if _add_user_to_config "$username" "$USER_NAME" "$USER_EMAIL" "$SSH_HOST"; then
929929
_print_success "Added '$username' to session manager"
930930
else
931931
_print_warning "Failed to add user to session manager"
932-
printf "You can add manually later with 'git_add_user'\n"
932+
printf "You can add manually later with 'gitssh user add'\n"
933933
fi
934934
else
935935
_print_success "User '$username' already exists in session manager"
@@ -1104,7 +1104,7 @@ setup_github_multi() {
11041104

11051105
printf "\n"
11061106
_print_success "Multiple GitHub accounts setup completed!"
1107-
_print_info "Use 'ssh_status' to see all configured connections"
1107+
_print_info "Use 'gitssh ssh status' to see all configured connections"
11081108
}
11091109

11101110
# Quick SSH key generation (minimal prompts)
@@ -1266,7 +1266,7 @@ ssh_doctor() {
12661266

12671267
if [ "$key_count" -eq 0 ]; then
12681268
_print_warning "No SSH keys found"
1269-
printf " Generate with: setup_github or setup_gitlab\n"
1269+
printf " Generate with: gitssh setup github or gitssh setup gitlab\n"
12701270
issues_found=$((issues_found + 1))
12711271
fi
12721272
printf "\n"
@@ -1307,7 +1307,7 @@ ssh_doctor() {
13071307

13081308
if [ "$github_entries" -eq 0 ] && [ "$gitlab_entries" -eq 0 ]; then
13091309
_print_warning "No GitHub or GitLab SSH hosts configured"
1310-
printf " Setup with: setup_github or setup_gitlab\n"
1310+
printf " Setup with: gitssh setup github or gitssh setup gitlab\n"
13111311
issues_found=$((issues_found + 1))
13121312
fi
13131313
else
@@ -1363,7 +1363,7 @@ ssh_doctor() {
13631363
else
13641364
_print_warning "Found $issues_found issue(s) that need attention"
13651365
printf "\nSuggested fixes:\n"
1366-
printf " • For missing keys: run 'setup_github' or 'setup_gitlab'\n"
1366+
printf " • For missing keys: run 'gitssh setup github' or 'gitssh setup gitlab'\n"
13671367
printf " • For permission issues: chmod 700 ~/.ssh && chmod 600 ~/.ssh/id_*\n"
13681368
printf " • For agent issues: eval \$(ssh-agent -s) && ssh-add ~/.ssh/your_key\n"
13691369
printf " • For connection failures: check if keys are added to your account\n"
@@ -1473,7 +1473,7 @@ ssh_repair() {
14731473

14741474
if [ "$repairs_made" -gt 0 ]; then
14751475
_print_success "Completed $repairs_made repairs"
1476-
printf "Run 'ssh_status' to verify the fixes\n"
1476+
printf "Run 'gitssh ssh status' to verify the fixes\n"
14771477
else
14781478
_print_info "No repairs needed - SSH setup appears correct"
14791479
fi
@@ -1594,7 +1594,7 @@ _add_user_to_config() {
15941594
# Check if session manager is available
15951595
if command -v git_add_user >/dev/null 2>&1 && _check_dependencies 2>/dev/null; then
15961596
# Use existing session manager function
1597-
printf "Integrating with Git-SSH Session Manager...\n"
1597+
printf "Integrating with GitSSH Session Manager...\n"
15981598

15991599
# Create temporary script to automate git_add_user
16001600
temp_script=$(_create_temp_file)
@@ -1614,8 +1614,8 @@ EOF
16141614
fi
16151615
else
16161616
# Session manager not available - just inform user
1617-
printf "Git-SSH Session Manager not available\n"
1618-
printf "Run 'git_ssh_init' first to enable full integration\n"
1617+
printf "GitSSH Session Manager not available\n"
1618+
printf "Run 'gitssh init' first to enable full integration\n"
16191619
return 1
16201620
fi
16211621
}
@@ -1686,18 +1686,18 @@ ssh_learn() {
16861686

16871687
printf "Getting Started:\n"
16881688
printf "================\n"
1689-
printf "1. Run 'setup_github' or 'setup_gitlab' for guided setup\n"
1690-
printf "2. Use 'ssh_status' to check your configuration\n"
1691-
printf "3. Use 'ssh_doctor' if you have connection issues\n"
1692-
printf "4. Use 'session_set' to manage identities per repository\n\n"
1689+
printf "1. Run 'gitssh setup github' or 'gitssh setup gitlab' for guided setup\n"
1690+
printf "2. Use 'gitssh ssh status' to check your configuration\n"
1691+
printf "3. Use 'gitssh ssh doctor' if you have connection issues\n"
1692+
printf "4. Use 'gitssh session set' to manage identities per repository\n\n"
16931693

16941694
printf "Common Commands:\n"
16951695
printf "================\n"
1696-
printf "ssh_status - Check SSH setup status\n"
1697-
printf "ssh_doctor - Diagnose SSH issues\n"
1698-
printf "ssh_repair - Fix common problems\n"
1699-
printf "setup_github - Setup GitHub SSH\n"
1700-
printf "setup_gitlab - Setup GitLab SSH\n"
1696+
printf "gitsh ssh status - Check SSH setup status\n"
1697+
printf "gitsh ssh doctor - Diagnose SSH issues\n"
1698+
printf "gitsh ssh repair - Fix common problems\n"
1699+
printf "gitsh setup github - Setup GitHub SSH\n"
1700+
printf "gitsh setup gitlab - Setup GitLab SSH\n"
17011701
printf "• quick_ssh_key - Generate key quickly\n"
17021702
printf "• remove_ssh_setup - Clean removal\n\n"
17031703
}
@@ -1723,7 +1723,9 @@ ssh_troubleshoot() {
17231723
printf " Solutions:\n"
17241724
printf " • Verify key is added: ssh_status\n"
17251725
printf " • Check SSH agent: ssh-add -l\n"
1726-
printf " • Test connection: ssh -T git@github.com\n\n"
1726+
printf " • Test connection: ssh -T git@github.com\n"
1727+
printf " • Try adding the key to SSH agent again: ssh-add %s\n" "$KEY_PATH"
1728+
printf "\n"
17271729

17281730
printf "2. 'Could not open a connection to your authentication agent'\n"
17291731
printf " Solution:\n"
@@ -2045,53 +2047,53 @@ ssh_setup_help() {
20452047
printf "\n"
20462048
_print_color blue "=========================================="
20472049
printf "\n"
2048-
_print_color blue " Git-SSH Setup Module Help"
2050+
_print_color blue " GitSSH Setup Module Help"
20492051
printf "\n"
20502052
_print_color blue "=========================================="
20512053
printf "\n\n"
20522054

20532055
printf "SETUP COMMANDS:\n"
20542056
printf "===============\n"
2055-
printf "setup_github - Interactive GitHub SSH setup wizard\n"
2056-
printf "setup_gitlab - Interactive GitLab SSH setup wizard\n"
2057+
printf "gitssh setup github - Interactive GitHub SSH setup wizard\n"
2058+
printf "gitssh setupgitlab - Interactive GitLab SSH setup wizard\n"
20572059
printf "setup_github_multi - Setup multiple GitHub accounts\n"
20582060
printf "quick_ssh_key - Quick key generation\n\n"
20592061

20602062
printf "STATUS & DIAGNOSTICS:\n"
20612063
printf "=====================\n"
2062-
printf "ssh_status - Show complete SSH setup status\n"
2063-
printf "ssh_doctor - Diagnose SSH connection issues\n"
2064-
printf "ssh_repair - Automatically fix common problems\n\n"
2064+
printf "gitssh ssh status - Show complete SSH setup status\n"
2065+
printf "gitssh ssh doctor - Diagnose SSH connection issues\n"
2066+
printf "gitssh ssh repair - Fix common problems\n\n"
20652067

20662068
printf "MANAGEMENT:\n"
20672069
printf "===========\n"
2068-
printf "ssh_backup - Create backup of SSH configuration\n"
2069-
printf "ssh_restore <dir> - Restore from backup\n"
2070-
printf "remove_ssh_setup - Remove SSH setup for service\n\n"
2070+
printf "gitssh ssh backup - Create backup of SSH configuration\n"
2071+
printf "gitssh ssh restore <dir> - Restore from backup\n"
2072+
printf "remove_ssh_setup - Remove SSH setup for service\n\n"
20712073

20722074
printf "LEARNING:\n"
20732075
printf "=========\n"
2074-
printf "ssh_learn - Learn about SSH and Git\n"
2076+
printf "gitssh ssh learn - Learn about SSH and Git\n"
20752077
printf "ssh_troubleshoot - Troubleshooting guide\n"
20762078
printf "ssh_setup_help - This help message\n\n"
20772079

20782080
printf "GETTING STARTED:\n"
20792081
printf "================\n"
2080-
printf "1. Run 'setup_github' for GitHub setup\n"
2081-
printf "2. Or 'setup_gitlab' for GitLab setup\n"
2082-
printf "3. Use 'ssh_status' to verify setup\n"
2083-
printf "4. Run 'session_set' to configure repository identity\n\n"
2082+
printf "1. Run 'gitssh setup github' for GitHub setup\n"
2083+
printf "2. Or 'gitssh setup gitlab' for GitLab setup\n"
2084+
printf "3. Use 'gitssh ssh status' to verify setup\n"
2085+
printf "4. Run 'gitssh session set' to configure repository identity\n\n"
20842086

20852087
printf "INTEGRATION:\n"
20862088
printf "============\n"
2087-
printf "This module integrates with the Git-SSH Session Manager.\n"
2089+
printf "This module integrates with the GitSSH Session Manager.\n"
20882090
printf "After SSH setup, use these commands:\n"
2089-
printf "session_set - Configure user identity per repository\n"
2090-
printf "git_commit - Enhanced commit with user verification\n"
2091-
printf "git_push - Enhanced push with connection testing\n"
2092-
printf "ssh_remote - Convert HTTPS repositories to SSH\n\n"
2091+
printf "gitssh session set - Configure user identity per repository\n"
2092+
printf "gitssh commit - Enhanced commit with user verification\n"
2093+
printf "gitssh push - Enhanced push with connection testing\n"
2094+
printf "gitssh remote convert - Convert HTTPS repositories to SSH\n\n"
20932095

2094-
printf "For more help: ssh_learn\n"
2096+
printf "For more help: gitssh ssh learn\n"
20952097
printf "\n"
20962098
}
20972099

@@ -2104,31 +2106,31 @@ ssh_commands() {
21042106

21052107
# Core setup
21062108
printf "\nSETUP:\n"
2107-
printf " setup_github - GitHub SSH setup wizard\n"
2108-
printf " setup_gitlab - GitLab SSH setup wizard\n"
2109+
printf " gitssh setup_github - GitHub SSH setup wizard\n"
2110+
printf " gitssh setup_gitlab - GitLab SSH setup wizard\n"
21092111
printf " setup_github_multi - Multiple GitHub accounts\n"
21102112
printf " quick_ssh_key - Quick key generation\n"
21112113

21122114
# Status and diagnostics
21132115
printf "\nSTATUS:\n"
2114-
printf " ssh_status - Complete SSH status\n"
2115-
printf " ssh_doctor - Diagnose issues\n"
2116-
printf " ssh_repair - Fix common problems\n"
2116+
printf " gitssh ssh status - Complete SSH status\n"
2117+
printf " gitssh ssh doctor - Diagnose issues\n"
2118+
printf " gitssh ssh repair - Fix common problems\n"
21172119

21182120
# Management
21192121
printf "\nMANAGEMENT:\n"
2120-
printf " ssh_backup - Backup configuration\n"
2121-
printf " ssh_restore - Restore from backup\n"
2122-
printf " remove_ssh_setup - Remove service setup\n"
2122+
printf " gitssh ssh backup - Backup configuration\n"
2123+
printf " gitssh ssh restore - Restore from backup\n"
2124+
printf " remove_ssh_setup - Remove service setup\n"
21232125

21242126
# Help and learning
21252127
printf "\nHELP:\n"
2126-
printf " ssh_learn - Learning guide\n"
2128+
printf " gitssh ssh learn - Learning guide\n"
21272129
printf " ssh_troubleshoot - Troubleshooting\n"
21282130
printf " ssh_setup_help - Detailed help\n"
21292131
printf " ssh_commands - This command list\n"
21302132

21312133
printf "\n"
2132-
_print_info "Start with: setup_github or setup_gitlab"
2134+
_print_info "Start with: gitssh setup github or gitssh setup gitlab"
21332135
printf "\n"
21342136
}

0 commit comments

Comments
 (0)