Skip to content

Commit ab773ad

Browse files
committed
Add improved installation method with SSH support
- Created separate setup.sh script for post-clone setup - Updated installation instructions to support SSH keys - Added explicit warning in install.sh about SSH alternatives - Made setup.sh script executable - Updated README with clearer installation options
1 parent 4cc2ae0 commit ab773ad

File tree

3 files changed

+90
-5
lines changed

3 files changed

+90
-5
lines changed

README.md

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,20 @@ Files-DB-MCP is a local vector database system that provides LLM coding agents w
1818

1919
### One-Line Installation
2020

21+
For SSH authentication (recommended if you use SSH keys with GitHub):
2122
```bash
22-
curl -fsSL https://raw.githubusercontent.com/randomm/files-db-mcp/main/install.sh | bash
23+
git clone [email protected]:randomm/files-db-mcp.git ~/.files-db-mcp && bash ~/.files-db-mcp/setup.sh
24+
```
25+
26+
For HTTPS authentication:
27+
```bash
28+
git clone https://github.com/randomm/files-db-mcp.git ~/.files-db-mcp && bash ~/.files-db-mcp/setup.sh
2329
```
2430

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
31+
Or download with curl (may require GitHub credentials):
32+
```bash
33+
curl -fsSL https://raw.githubusercontent.com/randomm/files-db-mcp/main/install.sh | bash
34+
```
2935

3036
### Usage
3137

install.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,9 @@ echo " Files-DB-MCP - Vector Search for Code Projects "
1010
echo "=================================================="
1111
echo " Installation Script "
1212
echo "=================================================="
13+
echo "NOTE: For SSH authentication, use the following command instead:"
14+
echo "git clone [email protected]:randomm/files-db-mcp.git ~/.files-db-mcp && bash ~/.files-db-mcp/setup.sh"
15+
echo "=================================================="
1316
echo
1417

1518
# Check if Docker and Docker Compose are installed

setup.sh

Lines changed: 76 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
#!/bin/bash
2+
# Setup script for Files-DB-MCP (called after cloning)
3+
4+
# Stop on error
5+
set -e
6+
7+
# Print banner
8+
echo "=================================================="
9+
echo " Files-DB-MCP - Vector Search for Code Projects "
10+
echo "=================================================="
11+
echo " Setup Script "
12+
echo "=================================================="
13+
echo
14+
15+
# Check if Docker and Docker Compose are installed
16+
if ! command -v docker >/dev/null 2>&1; then
17+
echo "Warning: Docker is not installed or not in PATH"
18+
echo "Please install Docker: https://docs.docker.com/get-docker/"
19+
echo
20+
read -p "Do you want to continue anyway? (y/n) " -n 1 -r
21+
echo
22+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
23+
exit 1
24+
fi
25+
fi
26+
27+
if ! docker compose version >/dev/null 2>&1; then
28+
echo "Warning: Docker Compose is not installed or not in PATH"
29+
echo "Please install Docker Compose: https://docs.docker.com/compose/install/"
30+
echo
31+
read -p "Do you want to continue anyway? (y/n) " -n 1 -r
32+
echo
33+
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
34+
exit 1
35+
fi
36+
fi
37+
38+
# Determine installation directory - use directory of this script
39+
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )"
40+
INSTALL_DIR="$HOME/.files-db-mcp"
41+
42+
# Create alias in ~/.bashrc or ~/.zshrc
43+
SHELL_RC=""
44+
if [ -f "$HOME/.zshrc" ]; then
45+
SHELL_RC="$HOME/.zshrc"
46+
elif [ -f "$HOME/.bashrc" ]; then
47+
SHELL_RC="$HOME/.bashrc"
48+
fi
49+
50+
if [ -n "$SHELL_RC" ]; then
51+
echo "Adding alias to $SHELL_RC..."
52+
53+
# Remove old alias if it exists
54+
sed -i.bak '/alias files-db-mcp=/d' "$SHELL_RC"
55+
56+
# Add new alias
57+
echo "alias files-db-mcp='$SCRIPT_DIR/run.sh'" >> "$SHELL_RC"
58+
59+
echo "Alias added. You can now use 'files-db-mcp' command in any project directory."
60+
echo "Please restart your shell or run 'source $SHELL_RC' to use the command."
61+
else
62+
echo "Could not find .zshrc or .bashrc to add alias."
63+
echo "To use Files-DB-MCP, run:"
64+
echo " $SCRIPT_DIR/run.sh"
65+
fi
66+
67+
# Make scripts executable
68+
chmod +x "$SCRIPT_DIR/run.sh"
69+
70+
echo
71+
echo "Setup complete!"
72+
echo
73+
echo "To start Files-DB-MCP in any project directory, simply run:"
74+
echo " files-db-mcp"
75+
echo
76+
echo "Happy coding!"

0 commit comments

Comments
 (0)