Skip to content

klaas-sh/cli

Repository files navigation

klaas - Remote Terminal Access

Release License Website

klaas demo


What is klaas?

klaas wraps your AI coding agent sessions and streams them to the cloud, enabling remote access from any device via a web interface. Perfect for:

  • Real-time streaming - See terminal output character by character, as it happens
  • Multi-device access - Start on desktop, check progress from your phone
  • Remote approval - Approve tool calls from anywhere when your agent needs permission
  • Remote instructions - Send prompts and guide your agent from any device
  • End-to-end encrypted - Your sessions are encrypted. We can't read them.

Supported Agents

Agent Shortcut Hooks
Claude Code [A] Full
Gemini CLI [G] Full
Codex CLI [O] Partial
GitHub Copilot [C] -
Vibe CLI [M] -
Aider - -
Goose - -
Open Interpreter - -

You can also configure your own agent.

Installation

macOS / Linux / WSL

curl -fsSL https://klaas.sh/install.sh | bash

Windows PowerShell

irm https://klaas.sh/install.ps1 | iex

Homebrew (macOS/Linux)

brew install klaas-sh/tap/klaas

Scoop (Windows)

scoop bucket add klaas https://github.com/klaas-sh/scoop-bucket
scoop install klaas

Nix (NixOS/Linux/macOS)

Requires Nix with flakes enabled. To enable flakes, add to ~/.config/nix/nix.conf:

experimental-features = nix-command flakes

Then install klaas:

# Run directly without installing
nix run github:klaas-sh/cli

# Install to profile
nix profile install github:klaas-sh/cli

Usage

Starting Sessions (Host Mode)

# Auto-detect installed agent (interactive if multiple)
klaas

# Use a specific agent
klaas --agent claude
klaas -a gemini

# Name your session for easy reconnection
klaas --name refactor-tests
klaas -n api-work

# Resume the previous session
klaas --resume

# Pass arguments to the agent (after --)
klaas -- --model sonnet --allowedTools "Bash(git*)"

On first run, you'll be prompted to authenticate via your browser. Once authenticated, your session is automatically streamed to the klaas dashboard.

Connecting to Sessions (Guest Mode)

# List your sessions (interactive selection)
klaas sessions

# Connect to a session by name
klaas connect refactor-tests
klaas connect api-work

# Connect to a session by ID
klaas connect 01HQXK7V8G3N5M2R4P6T1W9Y0Z

When connected as a guest, you have full terminal interaction - you can see output and send input just like the host.

Other Commands

# List installed agents
klaas agents

# Upgrade to the latest version
klaas upgrade

# Uninstall klaas
klaas uninstall

How It Works

┌─────────────┐     ┌─────────────┐     ┌─────────────┐
│   klaas     │────▶│   Agent     │────▶│  Terminal   │
│   CLI       │◀────│   CLI       │◀────│  Output     │
└─────────────┘     └─────────────┘     └─────────────┘
       │                                       │
       │         ┌─────────────┐               │
       └────────▶│   klaas     │◀──────────────┘
        (E2EE)   │   Cloud     │
                 └─────────────┘
                       │
                 ┌─────────────┐
                 │    Web      │
                 │  Dashboard  │
                 └─────────────┘
  1. klaas detects installed agents and spawns your choice in a PTY
  2. All input/output is captured and encrypted client-side
  3. Encrypted output is streamed to the klaas cloud in real-time
  4. Access your session from the web dashboard at klaas.sh
  5. For agents with hooks support, permission requests trigger notifications

Commands

Flags

Short Long Description
-a --agent <AGENT> Start with specific agent
-n --name <NAME> Set a name for this session (must be unique)
-q --qr Show a scannable QR code next to auth URLs (off by default)
-r --resume Resume previous session
-v --version Show version
-h --help Show help

Subcommands

Command Description
klaas agents List installed agents
klaas connect <id|name> Connect to a session as guest
klaas sessions List your sessions (interactive selection)
klaas uninstall Uninstall klaas
klaas upgrade Upgrade to the latest version

Terminology

Term Description
Host The CLI that started the session (owns the PTY)
Guest Any client viewing/interacting with a session

The CLI can act as both host (when starting sessions) and guest (when connecting to existing sessions).

Configuration

klaas stores credentials securely in your system keychain (macOS Keychain, Windows Credential Manager, or Linux Secret Service).

Configuration File

Create .klaas/config.toml in your project or ~/.klaas/config.toml globally:

# Default agent when multiple are available
default_agent = "claude"

# Only show these agents (even if others are installed)
only = ["claude", "gemini"]

# Or add custom agents alongside built-in ones
also = ["my-custom-agent"]

# Define custom agents
[agents.my-custom-agent]
command = "/path/to/my-agent"
name = "My Custom Agent"
hooks_type = "claude"  # "claude", "gemini", "codex", or "none"
shortcut = "X"

# Disable anonymous analytics (tracks install/upgrade/uninstall
# events with version and platform only, no personal data)
analytics = false

# Multi-connection input configuration
[session.input]
mode = "auto-lock"     # "host-only", "auto-lock", or "free-for-all"
idle_timeout_ms = 1500 # Lock timeout for auto-lock mode

Multi-Connection Input Modes

When multiple clients connect to your session (e.g., from different devices or browsers), klaas controls who can send terminal input:

Mode Description
host-only Only the host CLI can send input. Dashboard users can view only.
auto-lock First keystroke acquires a lock. Others see "X is typing". Lock auto-releases after idle timeout. (default)
free-for-all Anyone can send input anytime. Use with caution.

auto-lock mode (default) provides the best experience for most use cases:

  • Start typing from any device to acquire the input lock
  • Other connected clients see who is typing
  • Lock automatically releases after 1.5 seconds of inactivity
  • No explicit "take control" action needed

Example configurations:

# View-only for dashboard users (most restrictive)
[session.input]
mode = "host-only"

# Auto-lock with longer timeout (default mode, custom timeout)
[session.input]
mode = "auto-lock"
idle_timeout_ms = 3000  # 3 seconds

# Open input from any client (least restrictive)
[session.input]
mode = "free-for-all"

Building from Source

# Clone the repository
git clone https://github.com/klaas-sh/cli.git
cd cli

# Build
cargo build --release

# Run
./target/release/klaas

License

MIT License - see LICENSE for details.

Links

About

Remote access CLI for Claude Code, control your sessions from anywhere

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors