From 9da60c6c877fb2d81cc4f395c070bd2801f73201 Mon Sep 17 00:00:00 2001 From: zhenghaoz Date: Sun, 18 Oct 2026 12:53:47 +0800 Subject: [PATCH 1/3] docs: add Windows PowerShell quick-start tabs --- src/docs/quick-start.md | 49 +++++++++++++++++++++++++++++++++----- src/zh/docs/quick-start.md | 49 +++++++++++++++++++++++++++++++++----- 2 files changed, 86 insertions(+), 12 deletions(-) diff --git a/src/docs/quick-start.md b/src/docs/quick-start.md index a525cd2..f8b5094 100644 --- a/src/docs/quick-start.md +++ b/src/docs/quick-start.md @@ -73,28 +73,65 @@ Open http://localhost:8088 in browser and the dashboard summarizes all status an Suppose Bob is a developers who interested in LLM related repositories. We insert his star feedback to Gorse via the RESTful API. +::: tabs + +@tab:active Linux/macOS + ```bash -read -d '' JSON << EOF +JSON=$(cat <<'EOF' [ - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"ollama:ollama\", \"Value\": 1, \"Timestamp\": \"2022-02-24\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"huggingface:transformers\", \"Value\": 1, \"Timestamp\": \"2022-02-25\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"asbt:llms-from-scratch\", \"Value\": 1, \"Timestamp\": \"2022-02-26\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"vllm-project:vllm\", \"Value\": 1, \"Timestamp\": \"2022-02-27\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"hiyouga:llama-factory\", \"Value\": 1, \"Timestamp\": \"2022-02-28\" } + { "FeedbackType": "star", "UserId": "bob", "ItemId": "ollama:ollama", "Value": 1, "Timestamp": "2022-02-24" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "huggingface:transformers", "Value": 1, "Timestamp": "2022-02-25" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "asbt:llms-from-scratch", "Value": 1, "Timestamp": "2022-02-26" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "vllm-project:vllm", "Value": 1, "Timestamp": "2022-02-27" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "hiyouga:llama-factory", "Value": 1, "Timestamp": "2022-02-28" } ] EOF +) curl -X POST http://localhost:8087/api/feedback \ -H 'Content-Type: application/json' \ -d "$JSON" ``` +@tab Windows + +```powershell +$JSON = @' +[ + { "FeedbackType": "star", "UserId": "bob", "ItemId": "ollama:ollama", "Value": 1, "Timestamp": "2022-02-24" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "huggingface:transformers", "Value": 1, "Timestamp": "2022-02-25" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "asbt:llms-from-scratch", "Value": 1, "Timestamp": "2022-02-26" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "vllm-project:vllm", "Value": 1, "Timestamp": "2022-02-27" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "hiyouga:llama-factory", "Value": 1, "Timestamp": "2022-02-28" } +] +'@ + +Invoke-RestMethod -Method Post -Uri "http://localhost:8087/api/feedback" ` + -ContentType "application/json" ` + -Body $JSON +``` + +::: + Then, fetch 10 recommended items from Gorse. +::: tabs + +@tab:active Linux/macOS + ```bash curl http://localhost:8087/api/recommend/bob?n=10 ``` +@tab Windows + +```powershell +Invoke-RestMethod -Uri "http://localhost:8087/api/recommend/bob?n=10" +``` + +::: + ::: tip Access http://localhost:8088 for RESTful API of Gorse-in-one, and http://localhost:8087 for RESTful API of Gorse cluster. ::: diff --git a/src/zh/docs/quick-start.md b/src/zh/docs/quick-start.md index 3a7287f..ce76d9a 100644 --- a/src/zh/docs/quick-start.md +++ b/src/zh/docs/quick-start.md @@ -73,28 +73,65 @@ docker compose restart master 假设 Bob 是一位对 LLM 相关仓库感兴趣的开发人员。我们通过 RESTful API 将他的星标反馈插入 Gorse。 +::: tabs + +@tab:active Linux/macOS + ```bash -read -d '' JSON << EOF +JSON=$(cat <<'EOF' [ - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"ollama:ollama\", \"Value\": 1, \"Timestamp\": \"2022-02-24\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"huggingface:transformers\", \"Value\": 1, \"Timestamp\": \"2022-02-25\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"asbt:llms-from-scratch\", \"Value\": 1, \"Timestamp\": \"2022-02-26\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"vllm-project:vllm\", \"Value\": 1, \"Timestamp\": \"2022-02-27\" }, - { \"FeedbackType\": \"star\", \"UserId\": \"bob\", \"ItemId\": \"hiyouga:llama-factory\", \"Value\": 1, \"Timestamp\": \"2022-02-28\" } + { "FeedbackType": "star", "UserId": "bob", "ItemId": "ollama:ollama", "Value": 1, "Timestamp": "2022-02-24" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "huggingface:transformers", "Value": 1, "Timestamp": "2022-02-25" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "asbt:llms-from-scratch", "Value": 1, "Timestamp": "2022-02-26" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "vllm-project:vllm", "Value": 1, "Timestamp": "2022-02-27" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "hiyouga:llama-factory", "Value": 1, "Timestamp": "2022-02-28" } ] EOF +) curl -X POST http://localhost:8087/api/feedback \ -H 'Content-Type: application/json' \ -d "$JSON" ``` +@tab Windows + +```powershell +$JSON = @' +[ + { "FeedbackType": "star", "UserId": "bob", "ItemId": "ollama:ollama", "Value": 1, "Timestamp": "2022-02-24" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "huggingface:transformers", "Value": 1, "Timestamp": "2022-02-25" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "asbt:llms-from-scratch", "Value": 1, "Timestamp": "2022-02-26" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "vllm-project:vllm", "Value": 1, "Timestamp": "2022-02-27" }, + { "FeedbackType": "star", "UserId": "bob", "ItemId": "hiyouga:llama-factory", "Value": 1, "Timestamp": "2022-02-28" } +] +'@ + +Invoke-RestMethod -Method Post -Uri "http://localhost:8087/api/feedback" ` + -ContentType "application/json" ` + -Body $JSON +``` + +::: + 然后,从 Gorse 获取 10 个推荐物品。 +::: tabs + +@tab:active Linux/macOS + ```bash curl http://localhost:8087/api/recommend/bob?n=10 ``` +@tab Windows + +```powershell +Invoke-RestMethod -Uri "http://localhost:8087/api/recommend/bob?n=10" +``` + +::: + ::: tip 对于 Gorse-in-one,请访问 http://localhost:8088 获取 RESTful API,对于 Gorse 集群,请访问 http://localhost:8087。 ::: From a056d4530aeb19a82ae6e5ae4860da5680dc8be5 Mon Sep 17 00:00:00 2001 From: zhenghaoz Date: Sun, 18 Oct 2026 12:59:13 +0800 Subject: [PATCH 2/3] docs: add Windows download and dataset import commands --- src/docs/quick-start.md | 51 ++++++++++++++++++++++++++++++++++++++ src/zh/docs/quick-start.md | 51 ++++++++++++++++++++++++++++++++++++++ 2 files changed, 102 insertions(+) diff --git a/src/docs/quick-start.md b/src/docs/quick-start.md index f8b5094..7e5d3d3 100644 --- a/src/docs/quick-start.md +++ b/src/docs/quick-start.md @@ -32,6 +32,10 @@ There is an example [docker-compose.yml](https://github.com/gorse-io/gorse/blob/ 1. Download [docker-compose.yml](https://github.com/gorse-io/gorse/blob/master/docker-compose.yml) and the config file [config.toml](https://github.com/gorse-io/gorse/blob/master/config/config.toml). +::: tabs + +@tab:active Linux/macOS + ```bash # Create a new directory mkdir github @@ -42,6 +46,21 @@ wget https://raw.githubusercontent.com/gorse-io/gorse/master/docker-compose.yml wget https://raw.githubusercontent.com/gorse-io/gorse/master/config/config.toml -P config ``` +@tab Windows + +```powershell +# Create a new directory +New-Item -ItemType Directory -Path github +Set-Location github +New-Item -ItemType Directory -Path config + +# Download docker-compose.yml and config.toml +Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/gorse-io/gorse/master/docker-compose.yml" -OutFile "docker-compose.yml" +Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/gorse-io/gorse/master/config/config.toml" -OutFile "config/config.toml" +``` + +::: + 2. Setup the Gorse cluster using Docker Compose. ```bash @@ -50,6 +69,10 @@ docker compose up -d 3. Download the dump file [github.bin.gz](https://cdn.gorse.io/example/github.bin.gz) and import to Gorse. This dataset consists of GitHub users, GitHub repositories and interactions between users and repositories. +::: tabs + +@tab:active Linux/macOS + ```bash # Download sample data. wget https://cdn.gorse.io/example/github.bin.gz @@ -61,6 +84,34 @@ gzip -d github.bin.gz curl -X POST --data-binary @github.bin http://localhost:8088/api/restore ``` +@tab Windows + +```powershell +# Download sample data. +Invoke-WebRequest -UseBasicParsing -Uri "https://cdn.gorse.io/example/github.bin.gz" -OutFile "github.bin.gz" + +# Decompress sample data. +$inputStream = [System.IO.File]::OpenRead((Join-Path $PWD "github.bin.gz")) +$gzipStream = [System.IO.Compression.GZipStream]::new($inputStream, [System.IO.Compression.CompressionMode]::Decompress) +try { + $outputStream = [System.IO.File]::Create((Join-Path $PWD "github.bin")) + try { + $gzipStream.CopyTo($outputStream) + } finally { + $outputStream.Dispose() + } +} finally { + $gzipStream.Dispose() +} + +# Import sample data. +Invoke-RestMethod -Method Post -Uri "http://localhost:8088/api/restore" ` + -ContentType "application/octet-stream" ` + -InFile "github.bin" +``` + +::: + 4. Restart the master node to reload imported data immediately. ```bash diff --git a/src/zh/docs/quick-start.md b/src/zh/docs/quick-start.md index ce76d9a..5dfaca9 100644 --- a/src/zh/docs/quick-start.md +++ b/src/zh/docs/quick-start.md @@ -32,6 +32,10 @@ docker run -p 8088:8088 zhenghaoz/gorse-in-one --playground 1. 下载 [docker-compose.yml](https://github.com/gorse-io/gorse/blob/master/docker-compose.yml) 和配置文件 [config.toml](https://github.com/gorse-io/gorse/blob/master/config/config.toml)。 +::: tabs + +@tab:active Linux/macOS + ```bash # 创建一个新目录 mkdir github @@ -42,6 +46,21 @@ wget https://raw.githubusercontent.com/gorse-io/gorse/master/docker-compose.yml wget https://raw.githubusercontent.com/gorse-io/gorse/master/config/config.toml -P config ``` +@tab Windows + +```powershell +# 创建一个新目录 +New-Item -ItemType Directory -Path github +Set-Location github +New-Item -ItemType Directory -Path config + +# 下载 docker-compose.yml 和 config.toml +Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/gorse-io/gorse/master/docker-compose.yml" -OutFile "docker-compose.yml" +Invoke-WebRequest -UseBasicParsing -Uri "https://raw.githubusercontent.com/gorse-io/gorse/master/config/config.toml" -OutFile "config/config.toml" +``` + +::: + 2. 使用 Docker Compose 搭建 Gorse 集群。 ```bash @@ -50,6 +69,10 @@ docker compose up -d 3. 下载转储文件 [github.bin.gz](https://cdn.gorse.io/example/github.bin.gz) 并导入 Gorse。该数据集包含 GitHub 用户、GitHub 仓库以及用户和仓库之间的交互记录。 +::: tabs + +@tab:active Linux/macOS + ```bash # 下载示例数据。 wget https://cdn.gorse.io/example/github.bin.gz @@ -61,6 +84,34 @@ gzip -d github.bin.gz curl -X POST --data-binary @github.bin http://localhost:8088/api/restore ``` +@tab Windows + +```powershell +# 下载示例数据。 +Invoke-WebRequest -UseBasicParsing -Uri "https://cdn.gorse.io/example/github.bin.gz" -OutFile "github.bin.gz" + +# 解压示例数据。 +$inputStream = [System.IO.File]::OpenRead((Join-Path $PWD "github.bin.gz")) +$gzipStream = [System.IO.Compression.GZipStream]::new($inputStream, [System.IO.Compression.CompressionMode]::Decompress) +try { + $outputStream = [System.IO.File]::Create((Join-Path $PWD "github.bin")) + try { + $gzipStream.CopyTo($outputStream) + } finally { + $outputStream.Dispose() + } +} finally { + $gzipStream.Dispose() +} + +# 导入示例数据。 +Invoke-RestMethod -Method Post -Uri "http://localhost:8088/api/restore" ` + -ContentType "application/octet-stream" ` + -InFile "github.bin" +``` + +::: + 4. 重新启动主节点以立即重新加载导入的数据。 ```bash From fbf1cd64b4e352e0b233583f01d066e2a55536d0 Mon Sep 17 00:00:00 2001 From: zhenghaoz Date: Sun, 18 Oct 2026 13:05:25 +0800 Subject: [PATCH 3/3] docs: shorten Windows gzip decompression example --- src/docs/quick-start.md | 15 +++------------ src/zh/docs/quick-start.md | 15 +++------------ 2 files changed, 6 insertions(+), 24 deletions(-) diff --git a/src/docs/quick-start.md b/src/docs/quick-start.md index 7e5d3d3..749a73c 100644 --- a/src/docs/quick-start.md +++ b/src/docs/quick-start.md @@ -91,18 +91,9 @@ curl -X POST --data-binary @github.bin http://localhost:8088/api/restore Invoke-WebRequest -UseBasicParsing -Uri "https://cdn.gorse.io/example/github.bin.gz" -OutFile "github.bin.gz" # Decompress sample data. -$inputStream = [System.IO.File]::OpenRead((Join-Path $PWD "github.bin.gz")) -$gzipStream = [System.IO.Compression.GZipStream]::new($inputStream, [System.IO.Compression.CompressionMode]::Decompress) -try { - $outputStream = [System.IO.File]::Create((Join-Path $PWD "github.bin")) - try { - $gzipStream.CopyTo($outputStream) - } finally { - $outputStream.Dispose() - } -} finally { - $gzipStream.Dispose() -} +$gzip = [IO.Compression.GZipStream]::new([IO.File]::OpenRead("$PWD/github.bin.gz"), [IO.Compression.CompressionMode]::Decompress) +$output = [IO.File]::Create("$PWD/github.bin") +try { $gzip.CopyTo($output) } finally { $output.Dispose(); $gzip.Dispose() } # Import sample data. Invoke-RestMethod -Method Post -Uri "http://localhost:8088/api/restore" ` diff --git a/src/zh/docs/quick-start.md b/src/zh/docs/quick-start.md index 5dfaca9..4d790dc 100644 --- a/src/zh/docs/quick-start.md +++ b/src/zh/docs/quick-start.md @@ -91,18 +91,9 @@ curl -X POST --data-binary @github.bin http://localhost:8088/api/restore Invoke-WebRequest -UseBasicParsing -Uri "https://cdn.gorse.io/example/github.bin.gz" -OutFile "github.bin.gz" # 解压示例数据。 -$inputStream = [System.IO.File]::OpenRead((Join-Path $PWD "github.bin.gz")) -$gzipStream = [System.IO.Compression.GZipStream]::new($inputStream, [System.IO.Compression.CompressionMode]::Decompress) -try { - $outputStream = [System.IO.File]::Create((Join-Path $PWD "github.bin")) - try { - $gzipStream.CopyTo($outputStream) - } finally { - $outputStream.Dispose() - } -} finally { - $gzipStream.Dispose() -} +$gzip = [IO.Compression.GZipStream]::new([IO.File]::OpenRead("$PWD/github.bin.gz"), [IO.Compression.CompressionMode]::Decompress) +$output = [IO.File]::Create("$PWD/github.bin") +try { $gzip.CopyTo($output) } finally { $output.Dispose(); $gzip.Dispose() } # 导入示例数据。 Invoke-RestMethod -Method Post -Uri "http://localhost:8088/api/restore" `