Skip to content

TheComputerM/lazycph

Repository files navigation

LazyCPH

Workspace

A beautiful Terminal User Interface (TUI) for competitive programming that helps you test your solutions quickly and efficiently.

✨ Features

  • Beautiful TUI - Modern terminal interface built with Textual
  • Competitive Companion - Compatible with the competitive companion browser extension
  • Easy CRUD - Create, manage, and run multiple test cases for your solution
  • Multiple Languages - C,C++,Python,Rust,Zig are supported out of the box
  • Fast - Edit and Run your testcases quickly

🚀 Installation

pipx install lazycph
# or
uv tool install lazycph

Or if you prefer a standalone single-file binary; you can clone and setup the project, see CONTIBUTING, and then run uv run task build to generate the binary in the dist/ folder.

📖 Usage

Basic Usage

Launch LazyCPH in the current directory:

lazycph

Launch in a specific directory:

lazycph /path/to/your/code

Open a specific file:

lazycph solution.py

LazyCPH also allows you to import problems and testcases directly from platforms like codeforces use the competitive companion browser extension.

lazycph --companion
# or
lazycph -c

companion.mp4
Companion Demo

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": "uvx",
    "args": ["lazycph", "$ZED_FILE"],
    "use_new_terminal": true,
  }
]
// ~/config/zed/keymap.json
{
  "context": "Workspace",
  "bindings": {
    "alt-g": [
      "task::Spawn",
      { "task_name": "lazycph", "reveal_target": "center" }
    ]
  }
}

zed.mp4
Zed Demo

Web UI

You can also run LazyCPH in a web browser (for whatever reason you desire) because it's made with Textual, first create a file name web.py in the folder with your source code.

# /// script
# dependencies = ["textual-serve"]
# ///

from textual_serve.server import Server
server = Server(f"uvx lazycph")
server.serve()

And then run:

uv run web.py

So now whenever you press your keybind (alt+g in this case), a new terminal window opens with LazyCPH running on the current file. See how it looks.

🛠️ Development

Want to contribute? Check out the CONTRIBUTING.md for setup instructions and development guidelines.

Contributions are welcome! Please feel free to submit a Pull Request. For major changes, please open an issue first to discuss what you would like to change.

📝 License

This project is open source and available under the MIT License.

💡 Inspiration

Built for competitive programmers who want the features of CPH VSCode extension in any IDE or terminal.

About

Competitive Programming Helper in your terminal

Topics

Resources

License

Contributing

Stars

Watchers

Forks

Contributors

Languages