Install logsh
Install logsh
logsh is the command-line interface for Logship. It is a single, self-contained executable available for all major platforms.
Pre-built binaries
Download the latest release from GitHub Releases.
Supported platforms
| Platform | Architecture |
|---|---|
| Linux | x86_64, aarch64, armv7 (RPi), arm, musl (static) |
| macOS | x86_64 (Intel), aarch64 (Apple Silicon) |
| Windows | x86_64, aarch64 |
| FreeBSD | x86_64 |
# Download latest release
curl -LO https://github.com/logship-io/logsh/releases/latest/download/logsh-linux-x86_64.tar.gz
tar -xzf logsh-linux-x86_64.tar.gz
# Install to PATH
sudo mv logsh /usr/local/bin/
logsh --helpcurl -LO https://github.com/logship-io/logsh/releases/latest/download/logsh-linux-armv7.tar.gz
tar -xzf logsh-linux-armv7.tar.gz
sudo mv logsh /usr/local/bin/
logsh --helpcurl -LO https://github.com/logship-io/logsh/releases/latest/download/logsh-macos-x86_64.tar.gz
tar -xzf logsh-macos-x86_64.tar.gz
sudo mv logsh /usr/local/bin/
logsh --helpcurl -LO https://github.com/logship-io/logsh/releases/latest/download/logsh-macos-aarch64.tar.gz
tar -xzf logsh-macos-aarch64.tar.gz
sudo mv logsh /usr/local/bin/
logsh --help# Download and extract
Invoke-WebRequest -Uri "https://github.com/logship-io/logsh/releases/latest/download/logsh-windows-x86_64.zip" -OutFile "logsh.zip"
Expand-Archive -Path "logsh.zip" -DestinationPath "$env:LOCALAPPDATA\logsh"
# Add to PATH (current user)
$path = [Environment]::GetEnvironmentVariable("PATH", "User")
[Environment]::SetEnvironmentVariable("PATH", "$path;$env:LOCALAPPDATA\logsh", "User")
# Open a new terminal and verify
logsh --helpDocker
Images are published to a container registry:
| Registry | Image |
|---|---|
| GitHub Container Registry | ghcr.io/logship-io/logsh |
docker run --rm ghcr.io/logship-io/logsh:latest --helpMulti-arch images available: linux/amd64, linux/arm64, linux/arm/v7
| Tag | Description |
|---|---|
latest | Latest stable release |
Persistent configuration with Docker
Mount your logsh config directory so contexts persist between runs:
docker run --rm \
-v ~/.logsh:/config:Z \
ghcr.io/logship-io/logsh:latest query -q 'MyTable | take 10'docker run --rm `
-v ${env:USERPROFILE}\.logsh:/config:Z `
ghcr.io/logship-io/logsh:latest query -q 'MyTable | take 10'Docker Compose
services:
logsh:
image: ghcr.io/logship-io/logsh:latest
volumes:
- ~/.logsh:/config:ZBuild from source
Requires Rust 1.70+.
git clone https://github.com/logship-io/logsh.git
cd logsh/logsh
cargo build --release
./target/release/logshgit clone https://github.com/logship-io/logsh.git
cd logsh\logsh
cargo build --release
Copy-Item target\release\logsh.exe "$env:LOCALAPPDATA\logsh\logsh.exe"Self-update
logsh can update itself in-place:
logsh version --update # Update to latest stable release
logsh version --update-prerelease # Update to latest dev build
logsh version --update --yes # Skip confirmation promptVerify installation
logsh version
logsh --helpShell completions (autocomplete)
logsh provides tab-completion for commands, flags, context names, and account names.
# Generate and install completions
mkdir -p ~/.local/share/bash-completion/completions
logsh completions bash > ~/.local/share/bash-completion/completions/logsh
# Reload in current session
source ~/.local/share/bash-completion/completions/logsh
# If you don't have bash-completion installed:
# Debian/Ubuntu: sudo apt install bash-completion
# RHEL/Fedora: sudo dnf install bash-completion
# Then add to your ~/.bashrc:
# echo 'source ~/.local/share/bash-completion/completions/logsh' >> ~/.bashrc# Create completions directory if needed
mkdir -p ~/.zfunc
# Generate completions
logsh completions zsh > ~/.zfunc/_logsh
# Add to your ~/.zshrc (if not already present)
echo 'fpath+=~/.zfunc' >> ~/.zshrc
echo 'autoload -Uz compinit && compinit' >> ~/.zshrc
# Reload
source ~/.zshrc# Create directory if needed
mkdir -p ~/.config/fish/completions
# Generate and install completions
logsh completions fish > ~/.config/fish/completions/logsh.fish
# Fish picks up completions automatically. No restart needed.# If your profile doesn't exist yet
if (!(Test-Path -Path $PROFILE)) { New-Item -ItemType File -Path $PROFILE -Force }
# Append completions to your PowerShell profile
logsh completions powershell >> $PROFILE
# Reload profile in current session
. $PROFILE# Generate completions on the host from the container
docker run --rm ghcr.io/logship-io/logsh:latest completions bash > ~/.local/share/bash-completion/completions/logshEnvironment variables
| Variable | Description |
|---|---|
LOGSH_CONFIG_PATH | Override the config file location (default: ~/.logsh/config.json) |
LOGSH_PAT_TOKEN | Personal access token for authentication |
LOGSH_UPDATE_REPOSITORY | Custom GitHub repository for self-update (default: logship-io/logsh) |
NO_COLOR | Disable colored output when set |
Quick start
# Add a connection
logsh ctx add https://my.logship.server
# Verify
logsh whoami
# Run a query
logsh query -q 'schema.tables | take 5'