Public
Star 历史趋势
数据来源: GitHub API · 生成自 Stargazers.cn
README.md

px0: Read Code. Fast.

px0 is a fast, lightweight, read-only IDE designed for instant code navigation and review in your browser. Booting in under 1 ms and using ~20 MB of RAM, it turns your browser into a zero-latency inspection console with symbol-level navigation, deep search, and syntax highlighting across massive codebases.

Why a Read-Only IDE?

More and more, code generation happens directly in the terminal, driven by coding agents, CLI tools, and background orchestrators. We spend less time hand-typing boilerplate inside heavy, sluggish editors that consume gigabytes of memory and take seconds to boot.

Instead, the developer's role is shifting toward review, navigation, and audit:

  • Terminals drive generation: Tools generate the code, execute tests, and manage workflows.
  • Developers drive verification: We need to quickly inspect diffs, verify symbol references, trace definitions, and sanity-check architecture.
  • Desktop IDEs are overkill for review: Launching a massive Electron app or heavy IDE suite just to inspect generated code wastes time and system resources.

When you're reviewing code, you don't need a heavy editing environment, you need an instant, zero-latency window into your codebase. px0 is built for this: sub-millisecond startup, deep code intelligence, and instant search with virtually zero footprint.

Installation

Option 1: Quick Install (macOS, Linux, BSD)

Install or upgrade to the latest release with a single command:

curl -fsSL https://px0.ai/install.sh | sh

Option 2: Build from Source

Requires Go 1.24 or newer. No npm, no node, no CGO, and no system libraries required:

git clone https://github.com/px0-ai/px0.git
cd px0
make build
install -d ~/.local/bin && install px0 ~/.local/bin/

To cross-compile binaries for all 15 supported OS and architecture combinations:

make dist
# or ./build.sh

Features

  • Blazing Fast Code Navigation: Fuzzy search files (Cmd/Ctrl+P), document symbols (Cmd/Ctrl+Shift+O), and full project regex scan (Cmd/Ctrl+Shift+F) in milliseconds.
  • Rich Syntax Highlighting: Built-in native tokenization for ~280 languages via Chroma.
  • Custom Themes: Ships 14 built-in themes, including Tokyo Night (default), Paper, Catppuccin, Dracula, GitHub Dark, Gruvbox, Monokai, Nord, One Dark, Rose Pine, and Solarized. Switch via the button at the bottom of the sidebar or Select Theme in the command palette. See Styling & Themes to write your own.
  • Optional Language Server Protocol (LSP): Zero-config auto-detection of local LSPs (gopls, rust-analyzer, pyright, typescript-language-server, clangd, etc.) for precise Go-to-Definition (F12), Hover info, and cross-references. Falls back automatically to instant regex outlines when no LSP is installed.
  • Git Awareness: In a git repository, the file tree badges each file by its status (M modified, A added, D deleted, U untracked, R renamed), colouring changes green (added) or red (deleted/modified) and marking folders that contain changes. A changed only filter hides clean files, and a modified file gets Split/Unified buttons next to the tab bar (or Cmd/Ctrl+D) that open its diff against HEAD — side by side by default, or as a single unified column, each with old/new line numbers. Read-only like everything else, and disabled with -no-git or when no git is present.
  • Virtual DOM / Zero Overhead: Opening a 400,000-line file costs the same as a 10-line file; only visible lines render in the browser.
  • Clean Terminal Experience: CLI adheres to the Ape design spec with a subtle 256-color palette, Unix pipe detection, and quiet automation modes.
  • Completely Self-Contained: Single static binary embedding HTML, CSS, and JS. Zero runtime dependencies, no electron, and no cloud phone-homes.

Language Server (LSP) Setup (Optional)

px0 works entirely out of the box without any language servers: fuzzy file search, project grep, and outline parsing are completely built-in.

However, having language servers installed gives px0 superpowers: semantic Go-to-Definition (F12), type hover docs, and jump-to-definition into standard library files. px0 does not ship any language server. It detects the ones below if they are on your PATH or in the usual install folders (~/go/bin, ~/.cargo/bin, ~/.local/bin, npm's global folder, and Homebrew's folders on macOS). Where a language has several, the first one found in the order listed is used:

LanguageServerQuick Install Command
Gogoplsgo install golang.org/x/tools/gopls@latest
Rustrust-analyzerrustup component add rust-analyzer
TypeScript / JavaScripttypescript-language-servernpm install -g typescript-language-server typescript
Pythonpyright, pylsp or ruffnpm install -g pyright or pipx install python-lsp-server. ruff (pip install ruff) is detected too, but gives no call trails
C / C++clangdsudo apt install clangd or brew install llvm
Zigzlsbrew install zls or download from zigtools/zls
Lualua-language-serverbrew install lua-language-server (macOS)
Rubysolargraphgem install solargraph
Javajdtlsbrew install jdtls (macOS)
C#omnisharpInstall OmniSharp and put omnisharp on PATH
LaTeXtexlabbrew install texlab (macOS)

Servers are spawned lazily on first request for that file type and shut down cleanly upon exit. You can also disable LSP detection entirely at any time using px0 -no-lsp.

No server for the file you are reading? The status bar shows LSP: set up. Click it, open the Calls tab, or run Set Up Language Server... from the command palette to see the install options for your OS. px0 runs user-level installers (go, rustup, npm, pipx, gem, brew) for you on request, finds the result in the usual install folders even when they are not on PATH, and starts the server without a restart. Installers that need an administrator (sudo apt, winget) are shown for you to copy and run. px0 has no installer for zls, lua-language-server, jdtls or texlab outside macOS, or for omnisharp and ruff anywhere: install those yourself, then click Detect and start. Installing only works from px0's own page opened by IP address or localhost.

Why a Dedicated Code Viewer?

Traditional IDEs (like VS Code and JetBrains) were architected when developers spent almost all their time manually typing code. They carry tens of thousands of editing features, bloated Electron/Node runtimes, complex file watchers, heavy background extensions, and gigabytes of memory overhead.

In the modern development workflow, with AI coding agents, fast branch reviews, pull requests, and automated generation, developers spend significantly more time inspecting, reviewing, navigating, and understanding codebases than typing boilerplate.

ParameterTraditional IDE (such as VS Code)px0 (Code Viewer)
Primary PurposeManual code authoring and plugin hostInstant code reading & navigation
Base Memory (RSS)~1,440 MB (1.4+ GB)~20 MB (~70x lighter)
Active Startup CPU Spike35% - 50%< 1%
Cold Startup TimeSeveral secondsSub-millisecond
Process Tree15+ Node.js/Electron processes1 single static Go binary
Workspace IndexingMulti-second background churn0 - 45 ms for entire repositories
Setup and ConfigConfig files, plugins, node, npmZero config, zero runtime

Key Numbers and Benchmarks

All metrics are measured on real-world repositories and reproducible using ./benchmark.sh.

Real Corpus Performance (px0 standalone)

RepositorySource SizeFiles IndexedIndex TimeFuzzy SearchFull-Tree Regex ScanResident RAM (RSS)
flask3 MB2351 ms0.8 ms2.3 ms20 MB
redis26 MB1,85513 ms1.0 ms18.2 ms17 MB
react63 MB7,17852 ms2.7 ms32.2 ms21 MB
django74 MB7,01439 ms1.3 ms26.8 ms20 MB
kubernetes370 MB25,926150 ms13.5 ms84.6 ms30 MB
TypeScript414 MB66,533566 ms6.2 ms150.3 ms69 MB
linux kernel1,809 MB95,710370 ms6.0 ms451.8 ms55 MB

Head-to-Head: px0 vs. VS Code

Run ./benchmark.sh --vscode . to measure both on your active machine:

### px0 vs. VS Code Comparison

| Metric / Parameter | px0                    | VS Code (Server/Remote) | Notes                   |
| ------------------ | ---------------------- | ----------------------- | ----------------------- |
| Memory (RSS)       | 20 MB                  | 1,166 - 1,440 MB        | ~70x lighter            |
| Instant CPU %      | 0.0%                   | 4.0% - 39.0%            | Minimal CPU churn       |
| Index Time         | < 1 ms                 | ~4 - 10 s               | px0 is instantaneous    |
| Process Count      | 1 single Go binary     | 15+ processes           | Multi-process Node tree |

Usage

Run px0 with an optional file or directory:

px0                     # view the current workspace
px0 ~/src/kernel        # view another repository
px0 web/src/main.js     # view a file in its project workspace
px0 main.go:42          # open directly to a line number

px0 starts the local viewer, prints the URL, and opens your default browser immediately. When given a file, it detects the enclosing project repository (or working directory), sets that as the workspace, and opens the file to the requested line in a tab.

Updating px0

To check for updates and automatically upgrade px0 to the latest release:

px0 --update

px0 also checks asynchronously in the background once every 24 hours without delaying startup (<1 ms) and notifies you on stderr when an update is available.

CLI Flags

FlagDefaultDescription
-port N7777Port to listen on (0 picks an ephemeral free port)
-host H127.0.0.1Local address to bind
-no-openfalseDo not launch the web browser automatically
-no-lspfalseDisable language server discovery and use regex-based outline
-no-gitfalseDisable git awareness (tree status badges and the diff view)
-no-colorfalseStrip ANSI escape sequences from terminal output
-quietfalseSuppress CLI narration (errors still print to stderr)
-updatefalseCheck for updates and install the latest version
-versionfalsePrint version and architecture and exit

Keyboard Shortcuts

Cmd on macOS, Ctrl on Windows and Linux; Alt is Option on a Mac. The in-app sheet (?), footer hints and tooltips show each key the way your keyboard labels it (Cmd+Shift+F on a Mac, Ctrl+Shift+F elsewhere).

KeyAction
Cmd/Ctrl+KUniversal palette / quick open
Cmd/Ctrl+PGo to file
Cmd/Ctrl+Shift+PCommand palette
Cmd/Ctrl+Shift+OGo to symbol in file
Cmd/Ctrl+Shift+FFull workspace search
Cmd/Ctrl+FFind in active file (seeded with the current editor selection)
Cmd/Ctrl+GJump to line
Cmd/Ctrl+DToggle git diff of the active file (split or unified, whichever you used last)
F12, Cmd/Ctrl+ClickGo to definition
Shift+F12Find all references
Left / Right, Home / End (Cmd+Left / Cmd+Right on macOS)Move the (read-only) caret along the line; click places it
Ctrl+Home / Ctrl+End (Cmd+Up / Cmd+Down on macOS)Top / bottom of file
Alt+Z / Alt+LToggle word wrap / line numbers
Alt+C / Alt+A / Alt+UWith code selected: copy reference / copy for agent / find usages
Alt+Shift+HCall trail: callers and callees of the function under the cursor, expandable level by level
HoverType signature & doc hover
Cmd/Ctrl + HoverInspect identifier link
Alt+Left / Alt+RightNavigate back / forward in history
Cmd/Ctrl+BToggle file tree sidebar
Alt+WClose active tab (Cmd/Ctrl+W too, where the browser lets a page have it)
Ctrl+TabSwitch to next tab
Alt+1 ... Alt+9Select tab by position
?Show all keyboard shortcuts

Philosophy and Design Principles

  • Read-Only by Design: px0 does not attempt to be a code editor. Code authoring belongs to AI agents, CLI tools, or dedicated editors. px0 focuses exclusively on the reader experience.
  • Local and Private: Runs locally on 127.0.0.1 with zero accounts. Code, file paths, and symbol queries never leave your machine.
  • Ape Terminal & Web Aesthetics: Minimal, quiet, high information density, designed for pair-programming and flow state.

Telemetry & Privacy

px0 collects lightweight, anonymous backend session metrics (via PostHog) strictly to calculate DAU/MAU and session duration (start time and stop time).

What is NEVER collected:

  • No feature interactions, user actions, or command activity
  • No frontend events, browser fingerprinting, or client trackers
  • No code snippets, file contents, or diffs
  • No file names, directory paths, or repository names
  • No symbol names, function signatures, or search queries
  • No personal data or user accounts

How to opt out: You can disable telemetry completely at any time through any of the following:

  • CLI flag: px0 -no-telemetry
  • Environment variable: export DO_NOT_TRACK=1 or export PX0_TELEMETRY=0

Reproducing Benchmarks

All benchmark figures can be measured directly on your own system:

# 1. Fetch benchmark corpus (~3 GB shallow clones of Linux, K8s, TypeScript, etc.)
./benchmark.sh --clone

# 2. Run the full benchmark suite
./benchmark.sh

# 3. Compare px0 directly against VS Code process tree on your workspace
./benchmark.sh --vscode .

# 4. Profile memory lifecycle across index, search, and idle recovery
./benchmark.sh --memory bench-repos/linux

# 5. Measure LSP latency (definition, hover, references)
./benchmark.sh --lsp .

See Performance Benchmarks for full methodology and detailed charts.

Contributing

Contributions that keep px0 fast, minimal, and dependable are welcome. Please read CONTRIBUTING.md before submitting issues or pull requests.

Development Workflow

  1. Clone the repository:
git clone https://github.com/px0-ai/px0.git
cd px0
  1. Run tests:
make test
# or go test ./...
  1. Live frontend development (serves web/ assets from disk without rebuilding the binary):
go run . -dev . .
  1. Verify CLI formatting and builds:
go vet ./...
make dist

Architecture & Internals

For comprehensive technical deep-dives into the architecture, indexing, virtualized rendering, syntax highlighting, and LSP subsystems, see the Internals Documentation.

  • main.go / ui.go: CLI entrypoint, flag parsing, signal management, Ape terminal experience.
  • update.go: Self-updater and asynchronous daily version check.
  • server.go: HTTP routes, JSON API, gzip compression, and embedded asset serving.
  • index.go: Concurrently walks workspace, honors .gitignore (ignored files stay visible but dimmed in the explorer, and are never indexed or searched), builds in-memory path and trie structures in milliseconds.
  • search.go / fuzzy.go: High-performance substring and fuzzy file/symbol matching algorithms.
  • lsp.go / lspnav.go / calls.go: Lightweight JSON-RPC client communicating with local language servers over stdio, plus definitions, references and call trails.
  • lspservers.go / lspsetup.go: Language server registry, discovery, and install on request.
  • web/: Native zero-dependency ES module frontend (custom virtual scroll, syntax highlight rendering, tab manager).
  • web/themes/: One CSS file per colour theme, joined by the server into /static/themes.css. Token reference in Styling & Themes.

License

MIT License (c) 2026 Arpit Bhayani

关于 About

px0 is a fast, lightweight, read-only IDE designed for instant code navigation and review in your browser. Booting in under 1 ms and using ~20 MB of RAM, it turns your browser into a zero-latency inspection console with symbol-level navigation, deep search, and syntax highlighting across massive codebases.
code-viewerdeveloper-toolsgoidelsp

语言 Languages

JavaScript45.6%
Go36.6%
CSS9.5%
Shell5.5%
HTML2.4%
Makefile0.4%

提交活跃度 Commit Activity

代码提交热力图
过去 52 周的开发活跃度
35
Total Commits
峰值: 35次/周
Less
More

核心贡献者 Contributors