Skip to content

Commit fe509d7

Browse files
committed
docs(readme): update installation instructions and directory structure
- Added recommended install script method using curl - Reorganized installation section into "Option 1" and "Option 2" - Cleaned up directory structure overview by removing outdated entries chore(script): add install.sh for auto installation - Introduced a Bash script to fetch the latest release from GitHub - Automatically detects OS and architecture - Downloads and installs the correct binary to /usr/local/bin
1 parent fc87264 commit fe509d7

File tree

2 files changed

+37
-5
lines changed

2 files changed

+37
-5
lines changed

README.md

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,13 @@ $ git ch▍ # Press Ctrl+P (zsh Integration)
7979

8080
## 🛠 Installation
8181

82-
### 1. Install ghosttype
82+
### Option 1: Install Script (Recommended)
83+
84+
```bash
85+
curl -sL https://raw.githubusercontent.com/trknhr/ghosttype/main/script/install.sh | bash
86+
```
87+
88+
### Option 2: Go Install
8389

8490
```bash
8591
go install github.com/trknhr/ghosttype@latest
@@ -166,11 +172,7 @@ All models implement a unified `SuggestModel` interface and are combined via `en
166172
```
167173
.
168174
├── cmd/ # CLI (tui, suggest, root)
169-
├── history/ # Loaders for bash/zsh history
170-
├── model/ # All prediction models
171175
├── internal/ # Logging, utils, alias sync
172-
├── ollama/ # LLM/embedding interface
173-
├── parser/ # RC and alias parsing
174176
├── script/ # Shell helper scripts
175177
├── main.go
176178
└── go.mod

script/install.sh

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
REPO="trknhr/ghosttype"
5+
APP="ghosttype"
6+
OS=$(uname | tr '[:upper:]' '[:lower:]')
7+
ARCH=$(uname -m)
8+
9+
# x86_64 → amd64, aarch64 → arm64
10+
if [ "$ARCH" = "x86_64" ]; then ARCH=amd64; fi
11+
if [ "$ARCH" = "aarch64" ] || [ "$ARCH" = "arm64" ]; then ARCH=arm64; fi
12+
13+
echo "🔍 Fetching latest release..."
14+
TAG=$(curl -s https://api.github.com/repos/$REPO/releases/latest | grep tag_name | cut -d '"' -f 4)
15+
16+
echo "⬇️ Downloading $APP $TAG for $OS/$ARCH..."
17+
FILENAME="${APP}_main_${OS}_${ARCH}.tar.gz"
18+
URL="https://github.com/$REPO/releases/download/$TAG/$FILENAME"
19+
echo "📦 URL: $URL"
20+
curl -L "$URL" -o "${APP}.tar.gz"
21+
22+
echo "📦 Extracting..."
23+
tar -xzf "${APP}.tar.gz"
24+
rm "${APP}.tar.gz"
25+
26+
echo "🚀 Installing..."
27+
chmod +x $APP
28+
sudo mv $APP /usr/local/bin/
29+
30+
echo "✅ Installed $APP $TAG"

0 commit comments

Comments
 (0)