Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 36 additions & 3 deletions apps/memos-local-plugin/install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,15 @@ set -euo pipefail
# ─── MemTensor Memory for Hermes Agent — One-line Installer ───
#
# Usage (remote):
# curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install-memory.sh | bash
# curl -fsSL https://raw.githubusercontent.com/MemTensor/MemOS/openclaw-local-plugin-20260408/apps/memos-local-plugin/install.sh | bash
# curl ... | bash -s -- --version 1.0.0-beta.1
#
# Usage (local, after extracting the npm package):
# bash install.sh
#
# Options:
# --version <ver> - Install a specific version (default: latest from npm)
#
# Environment variables:
# MEMOS_INSTALL_DIR - Override install directory (default: ~/.hermes/memos-plugin)
# MEMOS_STATE_DIR - Override memory DB location
Expand All @@ -20,6 +24,21 @@ set -euo pipefail

NPM_PACKAGE="@memtensor/memos-local-hermes-plugin"
INSTALL_DIR="${MEMOS_INSTALL_DIR:-$HOME/.hermes/memos-plugin}"
PKG_VERSION=""

# ─── Parse arguments ───

while [[ $# -gt 0 ]]; do
case "$1" in
--version)
PKG_VERSION="$2"
shift 2
;;
*)
shift
;;
esac
done

# ─── Colors ───

Expand Down Expand Up @@ -171,8 +190,22 @@ else
trap "rm -rf '$TMP_DIR'" EXIT

cd "$TMP_DIR"
info "Downloading from npm..."
npm pack "$NPM_PACKAGE" --loglevel=error 2>/dev/null

# Resolve version: use --version if given, otherwise query npm for latest
if [[ -z "$PKG_VERSION" ]]; then
PKG_VERSION=$(npm view "$NPM_PACKAGE" dist-tags.latest 2>/dev/null || true)
if [[ -z "$PKG_VERSION" ]]; then
PKG_VERSION=$(npm view "$NPM_PACKAGE" version 2>/dev/null || true)
fi
if [[ -z "$PKG_VERSION" ]]; then
error "Cannot determine latest version of $NPM_PACKAGE"
error "Use --version to specify: bash install.sh --version 1.0.0-beta.1"
exit 1
fi
fi

info "Downloading $NPM_PACKAGE@$PKG_VERSION from npm..."
npm pack "$NPM_PACKAGE@$PKG_VERSION" --loglevel=error 2>/dev/null
TARBALL=$(ls -1 memtensor-memos-local-hermes-plugin-*.tgz 2>/dev/null | head -1)

if [[ -z "$TARBALL" || ! -f "$TARBALL" ]]; then
Expand Down
4 changes: 2 additions & 2 deletions apps/memos-local-plugin/www/docs/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -306,8 +306,8 @@ <h4><span class="lang-zh">一键安装(推荐)</span><span class="lang-en">O
<div class="install-note"><span class="lang-zh"># 自动下载、安装依赖、配置 Hermes、启动记忆面板</span><span class="lang-en"># Auto-downloads, installs deps, configures Hermes, starts memory panel</span></div>
<div class="install-row">
<span class="prompt">$</span>
<span class="cmd">curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install-memory.sh | bash</span>
<button type="button" class="install-copy-btn" data-copy="curl -fsSL https://raw.githubusercontent.com/NousResearch/hermes-agent/main/scripts/install-memory.sh | bash" title="Copy" aria-label="Copy"><svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg><svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg></button>
<span class="cmd">curl -fsSL https://raw.githubusercontent.com/MemTensor/MemOS/openclaw-local-plugin-20260408/apps/memos-local-plugin/install.sh | bash</span>
<button type="button" class="install-copy-btn" data-copy="curl -fsSL https://raw.githubusercontent.com/MemTensor/MemOS/openclaw-local-plugin-20260408/apps/memos-local-plugin/install.sh | bash" title="Copy" aria-label="Copy"><svg class="copy-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><rect x="9" y="9" width="13" height="13" rx="2"></rect><path d="M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"></path></svg><svg class="check-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2"><polyline points="20 6 9 17 4 12"></polyline></svg></button>
</div>
</div>
</div>
Expand Down