Skip to content

Commit 4cc2ae0

Browse files
committed
Improve installation UX with SSH authentication support
- Updated install.sh to prefer SSH over HTTPS authentication - Added automatic SSH detection with fallback to HTTPS if needed - Added ZIP file download option for systems without git - Updated documentation to provide both SSH and HTTPS examples - Enhanced README with information about the installation options - Fixed the pip install command to work with SSH authentication
1 parent 69a1b2a commit 4cc2ae0

File tree

3 files changed

+69
-13
lines changed

3 files changed

+69
-13
lines changed

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,11 @@ Files-DB-MCP is a local vector database system that provides LLM coding agents w
2222
curl -fsSL https://raw.githubusercontent.com/randomm/files-db-mcp/main/install.sh | bash
2323
```
2424

25+
The installation script automatically:
26+
- Tries to use SSH for GitHub authentication if available
27+
- Falls back to HTTPS if SSH is not set up
28+
- Provides a ZIP download option if git is not installed
29+
2530
### Usage
2631

2732
After installation, just run in any project directory:

docs/installation_guide.md

Lines changed: 15 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,10 @@ The Docker Compose installation is the simplest and most reliable way to run Fil
2525
### Quick Install
2626

2727
```bash
28-
# Clone the repository
29-
git clone https://github.com/randomm/files-db-mcp.git
28+
# Clone the repository (using SSH, recommended if you have SSH keys set up)
29+
git clone [email protected]:randomm/files-db-mcp.git
30+
# Or using HTTPS
31+
# git clone https://github.com/randomm/files-db-mcp.git
3032
cd files-db-mcp
3133

3234
# Start the services
@@ -57,8 +59,10 @@ Files-DB-MCP can be installed as a global CLI tool for easy access from any proj
5759
# Install the latest stable version
5860
pip install files-db-mcp
5961

60-
# Or install the development version
62+
# Or install the development version (HTTPS)
6163
pip install git+https://github.com/randomm/files-db-mcp.git
64+
# Or if you prefer SSH
65+
# pip install git+ssh://[email protected]/randomm/files-db-mcp.git
6266
```
6367

6468
### Usage
@@ -96,8 +100,10 @@ Options:
96100
For advanced users who want to install from source:
97101

98102
```bash
99-
# Clone the repository
100-
git clone https://github.com/randomm/files-db-mcp.git
103+
# Clone the repository (using SSH, recommended if you have SSH keys set up)
104+
git clone [email protected]:randomm/files-db-mcp.git
105+
# Or using HTTPS
106+
# git clone https://github.com/randomm/files-db-mcp.git
101107
cd files-db-mcp
102108

103109
# Create and activate a virtual environment
@@ -116,8 +122,10 @@ python -m src.main
116122
For developers who want to contribute to Files-DB-MCP:
117123

118124
```bash
119-
# Clone the repository
120-
git clone https://github.com/randomm/files-db-mcp.git
125+
# Clone the repository (using SSH, recommended if you have SSH keys set up)
126+
git clone [email protected]:randomm/files-db-mcp.git
127+
# Or using HTTPS
128+
# git clone https://github.com/randomm/files-db-mcp.git
121129
cd files-db-mcp
122130

123131
# Create and activate a virtual environment

install.sh

Lines changed: 49 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -50,14 +50,57 @@ if command -v git >/dev/null 2>&1; then
5050
git pull
5151
else
5252
echo "Cloning repository..."
53-
git clone https://github.com/randomm/files-db-mcp.git "$INSTALL_DIR"
53+
54+
# Try cloning with SSH first (preferred for users with SSH keys)
55+
if ssh -T [email protected] 2>&1 | grep -q "successfully authenticated"; then
56+
echo "Using SSH for GitHub authentication..."
57+
git clone [email protected]:randomm/files-db-mcp.git "$INSTALL_DIR"
58+
else
59+
# Ask if user wants to try HTTPS instead
60+
echo "SSH authentication to GitHub may not be set up."
61+
read -p "Do you want to use HTTPS instead? (y/n) " -n 1 -r
62+
echo
63+
if [[ $REPLY =~ ^[Yy]$ ]]; then
64+
git clone https://github.com/randomm/files-db-mcp.git "$INSTALL_DIR"
65+
else
66+
echo "To clone with SSH, ensure your SSH key is added to your GitHub account."
67+
echo "See: https://docs.github.com/en/authentication/connecting-to-github-with-ssh"
68+
exit 1
69+
fi
70+
fi
5471
fi
5572
else
56-
# Option 2: Download zip file (placeholder)
57-
echo "Git not found, downloading files directly..."
58-
# This would be implemented with curl or wget to download a zip file
59-
echo "Not implemented yet, please install git"
60-
exit 1
73+
# Option 2: Download zip file
74+
echo "Git not found, downloading repository as zip file..."
75+
76+
if command -v curl >/dev/null 2>&1; then
77+
echo "Downloading with curl..."
78+
curl -L https://github.com/randomm/files-db-mcp/archive/refs/heads/main.zip -o "$INSTALL_DIR/main.zip"
79+
80+
if command -v unzip >/dev/null 2>&1; then
81+
unzip -o "$INSTALL_DIR/main.zip" -d "$INSTALL_DIR-temp"
82+
mv "$INSTALL_DIR-temp"/*/* "$INSTALL_DIR"
83+
rm -rf "$INSTALL_DIR-temp" "$INSTALL_DIR/main.zip"
84+
else
85+
echo "Error: unzip command not found. Please install unzip."
86+
exit 1
87+
fi
88+
elif command -v wget >/dev/null 2>&1; then
89+
echo "Downloading with wget..."
90+
wget https://github.com/randomm/files-db-mcp/archive/refs/heads/main.zip -O "$INSTALL_DIR/main.zip"
91+
92+
if command -v unzip >/dev/null 2>&1; then
93+
unzip -o "$INSTALL_DIR/main.zip" -d "$INSTALL_DIR-temp"
94+
mv "$INSTALL_DIR-temp"/*/* "$INSTALL_DIR"
95+
rm -rf "$INSTALL_DIR-temp" "$INSTALL_DIR/main.zip"
96+
else
97+
echo "Error: unzip command not found. Please install unzip."
98+
exit 1
99+
fi
100+
else
101+
echo "Error: Neither curl nor wget found. Please install git, curl, or wget."
102+
exit 1
103+
fi
61104
fi
62105

63106
# Create alias in ~/.bashrc or ~/.zshrc

0 commit comments

Comments
 (0)