Skip to content

Repository files navigation

Lineforge

AI session manager for Claude Code and Codex CLIs. Spawn, monitor, and attach to AI coding sessions through a web UI or your terminal.

Features

  • PTY-based sessions — Spawn Claude Code or Codex in managed pseudo-terminals
  • Web UI — Dark-themed dashboard with xterm.js terminal, live log streaming via SSE
  • Terminal attach — Connect to any running session from your terminal with forge attach
  • iTerm2 integration — Auto-open sessions in iTerm2 windows on macOS
  • Settings TUI — Interactive ratatui-based configuration editor
  • Tailscale-first networking — Binds to your Tailscale IP by default for remote access
  • Yolo mode — Auto-approve AI tool calls for unattended sessions

Quick Start

# Install
curl -fsSL https://raw.githubusercontent.com/tonyjom/lineforge/main/scripts/install.sh | bash
# Start the server
forge serve
# Create a session and attach
forge new --label my-project --cwd ~/projects/myapp

Press Ctrl+] to detach from a session.

Installation

Install script (recommended)

Downloads a pre-built binary or falls back to building from source:

bash scripts/install.sh

To force a source build:

bash scripts/install.sh --from-source

The binary installs to ~/.local/bin/forge.

Build from source

Requires Rust (install via rustup.rs):

git clone https://github.com/tonyjom/lineforge.git
cd lineforge
cargo build --release
cp target/release/forge ~/.local/bin/

CLI Reference

forge serve

Start the backend server and web UI.

forge serve [--port <PORT>] [--bind <BIND>] [--config <PATH>]
FlagDefaultDescription
--port42067Port to listen on
--bindtailscaleBind address (tailscale auto-resolves your Tailscale IP, falls back to 127.0.0.1)
--config~/.config/lineforge/config.tomlConfig file path

forge new

Create a new session and attach to it immediately.

forge new [--label <NAME>] [--cwd <DIR>] [--tool <claude|codex>] [--no-iterm] [-- extra args...]
FlagDefaultDescription
--labelauto-generatedSession name
--cwdcurrent directoryWorking directory for the AI CLI
--toolfrom config (claude)AI CLI to use
--no-itermSkip auto-opening iTerm2
trailing argsExtra arguments passed to the AI CLI

forge new-session

Create a session without attaching. Prints the session ID. Takes the same flags as forge new.

forge attach <ID>

Attach your terminal to a running session via Unix socket. Supports UUID prefix matching.

forge list

List all sessions with status, tool, and creation time.

forge kill <ID>

Stop a running session (sends SIGTERM). Supports UUID prefix matching.

forge settings

Open the interactive TUI settings editor.

KeyAction
j/k or arrowsNavigate
Enter / SpaceToggle value
h/l or arrowsAdjust numbers
sSave
q / EscQuit

Configuration

Config file: ~/.config/lineforge/config.toml

port = 42067bind = "tailscale"default_tool = "claude"# tool_path = "/usr/local/bin/claude"# default_dirs = ["/home/user/projects"]iterm_enabled = truelog_retention_days = 7max_log_lines = 10000yolo_mode = false
FieldDefaultDescription
port42067Server port
bind"tailscale"Bind address (set to "127.0.0.1" for local-only)
default_tool"claude"Default AI CLI (claude or codex)
tool_pathCustom path to the AI CLI binary
default_dirs[]Suggested working directories
iterm_enabledtrueEnable iTerm2 integration (macOS)
log_retention_days7Days to keep session logs
max_log_lines10000Ring buffer size for in-memory logs
yolo_modefalseAuto-approve AI tool calls (--dangerously-skip-permissions for Claude, --yolo for Codex)

Web UI

Once the server is running, open http://<bind>:<port> in your browser.

  • Dashboard (/) — List all sessions with status badges
  • New session (/new) — Form to create a session
  • Session view (/sessions/{id}) — Live terminal via xterm.js, stop/iTerm2 buttons

API

MethodEndpointDescription
GET/healthHealth check
GET/api/sessionsList sessions (JSON)
POST/api/sessionsCreate session
GET/api/sessions/{id}Get session metadata
POST/api/sessions/{id}/inputSend input to session PTY
POST/api/sessions/{id}/stopStop session
GET/api/sessions/{id}/logsStream logs (SSE)
POST/api/sessions/{id}/open-itermOpen in iTerm2

Architecture

┌─────────────┐ ┌──────────────┐ ┌─────────────────┐
│ Web UI │────▶│ Axum Server │────▶│ SessionManager │
│ (xterm.js) │◀─SSE│ (port 42067)│ │ │
└─────────────┘ └──────────────┘ │ HashMap<Uuid, │
│ LiveSession> │
┌─────────────┐ ┌──────────────┐ │ │
│ forge CLI │────▶│ Unix Socket │────▶│ PTY ──▶ claude │
│ (attach) │◀────│ (/tmp/lineforge) │ or codex │
└─────────────┘ └──────────────┘ └─────────────────┘

Each session runs as a child process in a PTY. Output flows through a ring buffer and broadcast channel to both SSE (web) and Unix socket (terminal attach) clients. Session metadata persists to ~/.local/share/lineforge/sessions/{id}/meta.json.

Development

# Run in development
cargo run -- serve
# Run checks
cargo fmt --check
cargo clippy --all-targets -- -D warnings
cargo test# Build release
cargo build --release

CI runs on push/PR to main via GitHub Actions (format, lint, build, test). Releases are automated on version tags — version bumps follow conventional commits.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages