Skip to content

Download and Installation

Prerequisites

For JAR Distribution

  • Java 21 or later
  • JRE or JDK installation

Verify Java installation:

java -version
# openjdk version "21.0.1" 2023-10-17

For Native Executable

  • No Java required
  • Platform-specific binary

Distribution Options

JAR File

Standard Java executable archive.

Download:

# From releases
curl -L -o servicehop-cli.jar \
  https://releases.example.com/servicehop-cli-1.0.1.jar

Run:

java -jar servicehop-cli.jar

Native Executable

GraalVM native image for faster startup.

Available Platforms:

Platform File
Linux x64 servicehop-cli-linux-amd64
Linux ARM64 servicehop-cli-linux-arm64
macOS x64 servicehop-cli-darwin-amd64
macOS ARM64 servicehop-cli-darwin-arm64
Windows x64 servicehop-cli-windows-amd64.exe

Download:

# macOS ARM64 example
curl -L -o servicehop-cli \
  https://releases.example.com/servicehop-cli-darwin-arm64

chmod +x servicehop-cli

Run:

./servicehop-cli

Installation Locations

User Installation

# Create bin directory
mkdir -p ~/.local/bin

# Move executable
mv servicehop-cli ~/.local/bin/

# Add to PATH (add to ~/.bashrc or ~/.zshrc)
export PATH="$HOME/.local/bin:$PATH"

System Installation

# Requires sudo
sudo mv servicehop-cli /usr/local/bin/
sudo chmod +x /usr/local/bin/servicehop-cli

Configuration Setup

Create Configuration Directory

mkdir -p ~/.servicehop

Create Configuration File

cat > ~/.servicehop/config << EOF
api.url=https://api.example.com
api.token=shp_your_token_here
EOF

# Secure the file
chmod 600 ~/.servicehop/config

Environment Variables (Alternative)

# Add to ~/.bashrc or ~/.zshrc
export SERVICEHOP_API_URL="https://api.example.com"
export SERVICEHOP_API_TOKEN="shp_your_token_here"

Verification

Check Version

servicehop-cli --version
# ServiceHop CLI v1.0.1

Test Connection

servicehop-cli whoami
# Token: shp_abc...xyz
# Role: USER
# Expires: 2024-12-31T23:59:59Z

Run Help

servicehop-cli help
# Available commands:
#   insight   - Manage insights
#   call      - Manage calls
#   ingest    - Ingest data
#   ...

Upgrading

JAR

# Download new version
curl -L -o servicehop-cli-new.jar \
  https://releases.example.com/servicehop-cli-1.0.2.jar

# Replace old version
mv servicehop-cli-new.jar servicehop-cli.jar

Native Executable

# Download new version
curl -L -o servicehop-cli-new \
  https://releases.example.com/servicehop-cli-darwin-arm64

# Replace old version
mv servicehop-cli-new ~/.local/bin/servicehop-cli
chmod +x ~/.local/bin/servicehop-cli

Troubleshooting

Java Not Found

Error: JAVA_HOME is not set

Solution: Install Java 21+ and set JAVA_HOME.

Permission Denied

-bash: ./servicehop-cli: Permission denied

Solution: chmod +x servicehop-cli

Connection Refused

Error: Connection refused to https://api.example.com

Check: 1. API URL is correct 2. API server is running 3. Network connectivity

Invalid Token

Error: 401 Unauthorized

Check: 1. Token is correct 2. Token is not expired 3. Token is not revoked