HackerRank Native for VS Code & Antigravity

HackerRank Native is a lightweight, cloud-native VS Code and Antigravity IDE extension that allows you to browse, code, test, and submit HackerRank challenges directly within a unified workbench — without touching your local file workspace or installing local language compilers.

✨ Features
- Single-Window Hallmark Workbench:
- Problem Statement (Left Pane): Formatted challenge descriptions with KaTeX mathematical notation, difficulty tags, and track/chapter breadcrumbs.
- Embedded Monaco Editor (Right Pane Top): Full-featured code editor with syntax highlighting, automatic indentation, auto-save to global extension sandbox, and bidirectional clipboard copy/paste bridge (
Ctrl+C/Cmd+C, Ctrl+V/Cmd+V).
- Interactive Test Console (Right Pane Bottom): Test case cards displaying compiler input, expected output, actual output, runtime error logs, and evaluation verdict banners.
- Dialect & Multi-Language Support:
- SQL Family: MySQL, Oracle SQL, MS SQL Server (T-SQL), IBM DB2.
- C / C++: C, C++14, C++20.
- Python: Python 3, PyPy, PyPy 3.
- General Purpose: Java, C#, Go, Rust, Ruby, PHP, Swift, Kotlin, TypeScript, JavaScript, Bash / Shell, Scala, Clojure, Perl, R, Lua, etc.
- Automatic language boilerplate assembly with local fallback templates.
- Explorer Tree View:
- Browse tracks (Algorithms, Data Structures, SQL, etc.), chapters, and challenges directly from the Activity Bar.
- Visual checkmarks (
✓) for solved challenges and clean difficulty indicators.
- 100% Cloud Remote Execution:
- Run Code: Compiles and executes code remotely against sample test cases via HackerRank compile APIs.
- Submit Solution: Evaluates code against full hidden test suites on the official HackerRank evaluation judge.
- Non-Invasive Sandbox Storage:
- Solutions are safely isolated in VS Code global extension storage. Your project workspace is never polluted with challenge files.
- Export Solution:
- Export your working solution to any local directory or project folder at any time.
- Secure Authentication:
- Session cookie sign-in (
_hrank_session) compatible with Google, GitHub, LinkedIn, and Email/Password logins.
- Automatic CSRF token handshake and storage in your OS native keychain (
SecretStorage).
🚀 Quick Start
1. Installation
Package and install the extension:
# Package the extension
npx @vscode/vsce package
# Install into VS Code or Antigravity
code --install-extension hackerrank-native-0.1.0.vsix
2. Sign In
- Open HackerRank in your browser and sign in.
- Open DevTools (
F12), go to Application (or Storage) > Cookies > https://www.hackerrank.com, and copy the value of _hrank_session.
- In VS Code, open the Command Palette (
Ctrl+Shift+P or Cmd+Shift+P).
- Run
HackerRank: Sign In with Cookie and paste your _hrank_session cookie. The CSRF token is negotiated automatically.
3. Solving Challenges
- Click the HackerRank icon on the Activity Bar.
- Expand a Track (e.g. Algorithms) and Chapter (e.g. Warmup).
- Click any challenge to open the single-window workbench.
- Select your preferred programming language from the top bar dropdown.
- Code directly in the embedded Monaco Editor.
- Click Run Code to test against sample test cases in the bottom console.
- Click Submit Solution to run against hidden test cases and receive your score.
- Click Export to save a copy of your solution to any local workspace folder.
🛠 Available Commands
| Command |
Title |
Description |
hackerrank.signin |
HackerRank: Sign In (via HackerRank Cookie) |
Sign in by pasting your session cookie. |
hackerrank.checkStatus |
HackerRank: Check Login Status |
Verify current active session and username. |
hackerrank.logout |
HackerRank: Sign Out |
Clear saved credentials from secure storage. |
hackerrank.refreshChallenges |
HackerRank: Refresh Challenges |
Reload tracks, chapters, and challenge status. |
🔒 Security & Privacy
- OS Keyring Encryption: Session cookies and CSRF tokens are encrypted via VS Code's
vscode.secrets API (OS Keychain / Secret Service).
- Strict Content Security Policy: Embedded webviews enforce strict CSP headers with random cryptographic nonces, blocking inline script execution and unauthorized network endpoints.
- Path Traversal Protection: Track slugs, challenge slugs, and language IDs are strictly sanitized (
/^[a-zA-Z0-9_-]+$/).
- Workspace Isolation: Solution files and cached outputs reside entirely in the global extension data folder, leaving your workspace undisturbed.
💻 Development & Packaging
# Install dependencies
npm install
# Compile TypeScript and bundle pruned Monaco & KaTeX assets
npm run compile
# Run full test suite with coverage
npm test
# Build production VSIX package
npx @vscode/vsce package
📄 License
This project is licensed under the MIT License.
| |