Skip to content

Commit db80681

Browse files
committed
Add release installer script
1 parent 87a51b3 commit db80681

2 files changed

Lines changed: 142 additions & 1 deletion

File tree

README.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
- **Source control (Git)**: Built-in Changes panel with real-time status updates, per-file revert, commit, push, and pull.
1515
- **Integrated terminal**: Full-featured terminal emulator with WebSocket-based communication, supporting real-time command execution and output.
1616
- **Search functionality**: Powerful search capabilities including local search within files and global search across project.
17-
- **ACP integration**: Agent Client Protocol (ACP) support for seamless integration with AI agents, including tool-call streaming and history-backed undo.
17+
- **ACP integration**: Agent Client Protocol (ACP) support for seamless integration with AI agents, including tool-call streaming, history-backed undo, session resume, frontend-controlled permission mode, model and reasoning selectors, streamed markdown and code blocks, markdown file links, and improved tool-call diff display.
1818

1919
## Architecture
2020

@@ -29,6 +29,16 @@ The project consists of several packages:
2929
## Installation
3030
### From releases
3131

32+
One-shot installer:
33+
```bash
34+
curl -fsSL https://raw.githubusercontent.com/anycode-ide/anycode/main/install.sh | sh
35+
```
36+
37+
You can also pin a version:
38+
```bash
39+
curl -fsSL https://raw.githubusercontent.com/anycode-ide/anycode/main/install.sh | sh -s -- --version v0.0.7
40+
```
41+
3242
Linux (x86_64):
3343
```bash
3444
curl -L https://github.com/anycode-ide/anycode/releases/latest/download/anycode-linux-x86_64-musl.tar.gz | tar -xz

install.sh

Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
#!/bin/sh
2+
3+
set -eu
4+
5+
REPO="${ANYCODE_REPO:-anycode-ide/anycode}"
6+
VERSION="${ANYCODE_VERSION:-latest}"
7+
PREFIX="${ANYCODE_INSTALL_DIR:-}"
8+
9+
usage() {
10+
cat <<'EOF'
11+
Usage: install.sh [--version TAG] [--prefix DIR] [--repo OWNER/REPO]
12+
13+
Environment variables:
14+
ANYCODE_REPO GitHub repository, default: anycode-ide/anycode
15+
ANYCODE_VERSION Release tag to install, default: latest
16+
ANYCODE_INSTALL_DIR Installation directory, default: ~/.local/bin or /usr/local/bin for root
17+
EOF
18+
}
19+
20+
while [ $# -gt 0 ]; do
21+
case "$1" in
22+
--version)
23+
VERSION="${2:?missing value for --version}"
24+
shift 2
25+
;;
26+
--prefix)
27+
PREFIX="${2:?missing value for --prefix}"
28+
shift 2
29+
;;
30+
--repo)
31+
REPO="${2:?missing value for --repo}"
32+
shift 2
33+
;;
34+
-h|--help)
35+
usage
36+
exit 0
37+
;;
38+
*)
39+
echo "Unknown argument: $1" >&2
40+
usage >&2
41+
exit 1
42+
;;
43+
esac
44+
done
45+
46+
os="$(uname -s)"
47+
arch="$(uname -m)"
48+
49+
case "$os" in
50+
Darwin)
51+
asset="anycode-universal-apple-darwin.tar.gz"
52+
;;
53+
Linux)
54+
case "$arch" in
55+
x86_64|amd64)
56+
asset="anycode-linux-x86_64-musl.tar.gz"
57+
;;
58+
aarch64|arm64)
59+
asset="anycode-linux-aarch64-musl.tar.gz"
60+
;;
61+
*)
62+
echo "Unsupported Linux architecture: $arch" >&2
63+
exit 1
64+
;;
65+
esac
66+
;;
67+
*)
68+
echo "Unsupported operating system: $os" >&2
69+
exit 1
70+
;;
71+
esac
72+
73+
if [ -z "$PREFIX" ]; then
74+
if [ "$(id -u)" -eq 0 ]; then
75+
PREFIX="/usr/local/bin"
76+
else
77+
PREFIX="${HOME}/.local/bin"
78+
fi
79+
fi
80+
81+
mkdir -p "$PREFIX"
82+
83+
if [ ! -w "$PREFIX" ]; then
84+
echo "Install directory is not writable: $PREFIX" >&2
85+
echo "Try: sudo sh install.sh --prefix /usr/local/bin" >&2
86+
exit 1
87+
fi
88+
89+
tmpdir="$(mktemp -d)"
90+
trap 'rm -rf "$tmpdir"' EXIT INT TERM
91+
92+
archive="$tmpdir/$asset"
93+
extract_dir="$tmpdir/extract"
94+
mkdir -p "$extract_dir"
95+
96+
download_url="https://github.com/$REPO/releases/latest/download/$asset"
97+
if [ "$VERSION" != "latest" ]; then
98+
download_url="https://github.com/$REPO/releases/download/$VERSION/$asset"
99+
fi
100+
101+
echo "Downloading $asset from $download_url"
102+
103+
if command -v curl >/dev/null 2>&1; then
104+
curl -fsSL "$download_url" -o "$archive"
105+
elif command -v wget >/dev/null 2>&1; then
106+
wget -qO "$archive" "$download_url"
107+
else
108+
echo "Need either curl or wget to download the release" >&2
109+
exit 1
110+
fi
111+
112+
tar -xzf "$archive" -C "$extract_dir"
113+
114+
if [ ! -f "$extract_dir/anycode" ]; then
115+
echo "Archive did not contain expected binary: anycode" >&2
116+
exit 1
117+
fi
118+
119+
install_bin="$PREFIX/anycode"
120+
cp "$extract_dir/anycode" "$install_bin"
121+
chmod 755 "$install_bin"
122+
123+
echo "Installed anycode to $install_bin"
124+
125+
case ":$PATH:" in
126+
*":$PREFIX:"*)
127+
;;
128+
*)
129+
echo "Add $PREFIX to your PATH if it is not there yet."
130+
;;
131+
esac

0 commit comments

Comments
 (0)