grain.social is a photo sharing platform built on atproto.
1#!/bin/bash
2
3set -e
4
5echo "🌾 Installing Grain CLI..."
6
7# Detect OS and architecture
8OS=$(uname -s | tr '[:upper:]' '[:lower:]')
9ARCH=$(uname -m)
10
11# Map architecture names
12case $ARCH in
13 x86_64)
14 ARCH="x86_64"
15 ;;
16 arm64|aarch64)
17 ARCH="aarch64"
18 ;;
19 *)
20 echo "❌ Unsupported architecture: $ARCH"
21 exit 1
22 ;;
23esac
24
25# Set GitHub repository (replace with your actual repo)
26REPO="grainsocial/grain"
27BINARY_NAME="grain-${OS}-${ARCH}"
28
29echo "📦 Downloading Grain CLI for ${OS}-${ARCH}..."
30
31# Download pre-built binary
32if ! curl -L "https://github.com/${REPO}/releases/latest/download/${BINARY_NAME}" -o grain; then
33 echo "❌ Pre-built binary not available for ${OS}-${ARCH}"
34 echo "Please build from source instead:"
35 echo " cargo build --release"
36 exit 1
37fi
38
39# Make executable
40chmod +x grain
41
42# Install to system
43echo "🔗 Installing to /usr/local/bin (requires sudo)..."
44sudo mv grain /usr/local/bin/
45
46echo "✅ Grain CLI installed successfully!"
47echo "📖 Run 'grain --help' to get started"
48echo "🔐 Run 'grain login' to authenticate"