Skip to content

thereseseldon/freshell

 
 

Repository files navigation

Node.js Version Platform Support License

🐚πŸ”₯freshell

Claudes Code, terminals, and other CLI friends in your browser. Speak with the dead, jump to your phone, and lots more

Run multiple terminals in tabs | Detach & reattach sessions | Browse Claude Code history | What if tmux and Claude fell in love?


freshell screenshot

Features

  • Multi-tab terminal sessions β€” Run shell, Claude Code, and Codex in parallel tabs
  • Split panes β€” Divide any tab into independent terminal panes (horizontal/vertical)
  • Detach/reattach β€” Background terminals persist across browser sessions
  • Search & browse β€” Filter Claude sessions by project, date, or content
  • Speak with the dead β€” Invoke the spirits of ancient Claudes and ask them what they were thinking
  • Keep it tidy β€” AI (or your pedantic self) names, summarizes, and organizes
  • Dark/light themes β€” Are we savages?
  • Keyboard-driven β€” tmux-style prefix shortcuts for power users

Quick Start

# Clone the repository
git clone https://github.com/danshapiro/freshell.git
cd freshell

# Install dependencies
npm install

# Configure environment
cp .env.example .env
# Edit .env and set AUTH_TOKEN to a secure random value

# Build and run
npm run serve

Open http://localhost:3001/?token=YOUR_AUTH_TOKEN

Prerequisites

Platform Requirements
All Node.js 18+ (20+ recommended), npm
Windows Build tools for native modules (see below)
macOS Xcode Command Line Tools
Linux build-essential, python3

Note: WSL is optional on Windows. The app defaults to cmd.exe for terminals. Set WINDOWS_SHELL=wsl or WINDOWS_SHELL=powershell to change. WSL is only needed if your Claude sessions live inside the Linux filesystem.

Platform-Specific Setup

Windows
  1. Install Node.js (LTS version)
  2. Install build tools for native modules:
    npm install -g windows-build-tools
  3. (Optional) Install WSL2 if you want Linux terminals or need to access Claude sessions stored in WSL:
    wsl --install -d Ubuntu
    Then set WINDOWS_SHELL=wsl in your .env file.
macOS
  1. Install Xcode Command Line Tools:
    xcode-select --install
  2. Install Node.js via Homebrew:
    brew install node
Linux (Debian/Ubuntu)
# Install build dependencies
sudo apt update
sudo apt install -y build-essential python3

# Install Node.js (via NodeSource)
curl -fsSL https://deb.nodesource.com/setup_20.x | sudo -E bash -
sudo apt install -y nodejs

Installation

# Clone
git clone https://github.com/yourusername/freshell.git
cd freshell

# Install dependencies
npm install

# Create environment file
cp .env.example .env

Edit .env with your configuration:

# Required: secure random token (min 16 characters)
AUTH_TOKEN=your-secure-random-token-here

# Optional: server port (default 3001)
PORT=3001

# Windows only: shell type (cmd, powershell, or wsl). Default: cmd
# WINDOWS_SHELL=cmd

# Windows/WSL: path to Claude home (use WSL path if using WSL)
CLAUDE_HOME=\\wsl$\Ubuntu\home\your-user\.claude
WSL_DISTRO=Ubuntu

# Optional: Gemini API key for AI summaries
GOOGLE_GENERATIVE_AI_API_KEY=your-api-key

Usage

Development

Run the client and server with hot reload:

npm run dev

Or run them separately:

# Terminal 1 - Server
npm run dev:server

# Terminal 2 - Client
npm run dev:client

Production

# Build and run (recommended)
npm run serve

Or build and run separately:

npm run build
npm start

Access the app at http://localhost:3001/?token=YOUR_AUTH_TOKEN

Keyboard Shortcuts

freshell uses a tmux-style prefix system. Press Ctrl+B followed by a command key:

Shortcut Action
Ctrl+B T New terminal tab
Ctrl+B W Close current tab
Ctrl+B S Sessions view
Ctrl+B O Overview view
Ctrl+B , Settings

Configuration

Environment Variables

Variable Required Description
AUTH_TOKEN Yes Authentication token for API and WebSocket
PORT No Server port (default: 3001)
ALLOWED_ORIGINS No Comma-separated allowed CORS origins
CLAUDE_HOME No Path to Claude config directory
WINDOWS_SHELL No Windows shell: cmd (default), powershell, or wsl
WSL_DISTRO No WSL distribution name (Windows only)
CLAUDE_CMD No Claude CLI command override
CODEX_CMD No Codex CLI command override
GOOGLE_GENERATIVE_AI_API_KEY No Gemini API key for AI summaries

Windows + WSL (Optional)

If your Claude Code sessions live inside WSL at ~/.claude, configure access from Windows:

WINDOWS_SHELL=wsl
CLAUDE_HOME=\\wsl$\Ubuntu\home\your-username\.claude
WSL_DISTRO=Ubuntu

The server will watch CLAUDE_HOME/projects/**/sessions/*.jsonl for new sessions.

Security

  • AUTH_TOKEN is mandatory β€” The server refuses to start without it
  • API authentication β€” All /api/* routes require x-auth-token header
  • WebSocket handshake β€” Connections must send a valid token in the hello message
  • Origin restriction β€” WebSocket connections limited to allowed origins

Testing

# Run all tests
npm test

# Run with UI
npm run test:ui

# Run specific test suites
npm run test:unit          # Unit tests only
npm run test:server        # Server tests only
npm run test:client        # Client tests only
npm run test:coverage      # With coverage report

Tech Stack

  • Frontend: React 18, Redux Toolkit, Tailwind CSS, xterm.js
  • Backend: Express, WebSocket (ws), node-pty
  • Build: Vite, TypeScript
  • AI: Vercel AI SDK with Google Gemini

Project Structure

freshell/
β”œβ”€β”€ src/                  # Frontend source
β”‚   β”œβ”€β”€ components/       # React components
β”‚   β”œβ”€β”€ store/            # Redux store & slices
β”‚   β”œβ”€β”€ lib/              # Utilities & API client
β”‚   └── hooks/            # Custom React hooks
β”œβ”€β”€ server/               # Backend source
β”‚   β”œβ”€β”€ index.ts          # Server entry point
β”‚   β”œβ”€β”€ ws-handler.ts     # WebSocket handling
β”‚   └── claude-session.ts # Session indexer
β”œβ”€β”€ test/                 # Test suites
└── dist/                 # Build output

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

MIT License β€” see LICENSE for details.


Made with terminals and caffeine

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • TypeScript 99.6%
  • Other 0.4%