LazyCPH
A terminal UI for competitive programming.

Features
- Run test cases against source files
- Competitive Companion integration for automatic test case retrieval
- Mouse support for panel selection and scrolling
- Configurable language engines for compilation and execution
Installation
go install github.com/thecomputerm/lazycph@main
Usage
Run in the current directory to open the file picker:
lazycph
Open a specific solution file:
lazycph path/to/solution.cpp
Enable Competitive Companion integration:
lazycph --companion
Configuration
Custom engines can be defined in ~/.config/lazycph.json. This file merges with the default configuration. Use {file} as a placeholder for the source file and {temp} for the compiled binary path.
{
"engines": {
".cpp": {
"mode": "compile",
"command": ["g++", "{file}", "-o", "{temp}", "-O3", "-std=c++20"]
},
".js": {
"mode": "interpret",
"command": ["node", "{file}"]
}
}
}
Competitive Companion
LazyCPH integrates with the Competitive Companion browser extension. When running with the --companion or -c flag, LazyCPH listens on standard ports for problem data. Sending a problem from the browser will trigger a dialog to create the source file and automatically populate it with the provided test cases.
Integration with Zed
You can easily integrate LazyCPH with the Zed editor for a seamless competitive programming experience. You just need to configure a task and bind it to a shortcut key.
// ~/.config/zed/tasks.json
[
{
"label": "lazycph",
"command": "lazycph",
"args": ["$ZED_FILE"],
"use_new_terminal": true,
}
]
// ~/config/zed/keymap.json
{
"context": "Workspace",
"bindings": {
"alt-g": [
"task::Spawn",
{ "task_name": "lazycph", "reveal_target": "center" }
]
}
}
Building from source
go build -o lazycph .
License
MIT