npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lazy-gravity

v0.5.0

Published

Control Antigravity from anywhere — a local, secure bot (Discord + Telegram) that lets you remotely operate Antigravity on your home PC from your smartphone.

Readme

LazyGravity

LazyGravity is a local, secure bot that lets you remotely operate Antigravity on your home PC — from your smartphone, anywhere. Supports Discord and Telegram (optional).

Send natural language instructions like "fix that bug" or "start designing the new feature" from your phone. Antigravity executes them locally on your home PC using its full resources, and reports results back to your chat platform.

https://github.com/user-attachments/assets/08eac63e-5ede-469b-ac6c-1c40ec77b0c0

Quick Setup

Runtime: Node >= 18.

npm install -g lazy-gravity
lazy-gravity setup

The interactive wizard walks you through Discord bot creation, token setup, and workspace configuration. When done:

lazy-gravity open     # Launch Antigravity with CDP enabled
lazy-gravity start    # Start the bot (Discord by default, or both platforms)

Or run directly without installing:

npx lazy-gravity

Features

  1. Fully Local & Secure

    • No external server or port exposure — runs as a local process on your PC, communicating directly with Discord/Telegram.
    • Whitelist access control: only authorized user IDs can interact with the bot (per-platform allowlists).
    • Secure credential management: Bot tokens and API keys are stored locally (never in source code).
    • Path traversal prevention & resource protection: sandboxed directory access and concurrent task limits prevent abuse.
  2. Multi-Platform Support

    • Discord (default): Full feature set with slash commands, rich embeds, reactions, and channel management.
    • Telegram (optional): Send prompts, receive responses, and use inline keyboard buttons. Requires grammy (npm install grammy).
    • Run both platforms simultaneously from a single process, or use either one standalone.
  3. Project Management (Channel-Directory Binding)

    • Discord: Use /project to bind a channel to a local project directory via an interactive select menu.
    • Telegram: Use /project to bind a chat to a workspace directory.
    • Messages sent in a bound channel/chat are automatically forwarded to Antigravity with the correct project context.
  4. Context-Aware Replies

    • Discord: Results delivered as rich Embeds. Use Reply to continue the conversation with full context preserved.
    • Telegram: Results delivered as formatted HTML messages with inline keyboard buttons.
  5. Real-Time Progress Monitoring

    • Long-running Antigravity tasks report progress as a series of messages (delivery confirmed / planning / analysis / execution / implementation / final summary).
  6. File Attachments & Context Parsing

    • Send images (screenshots, mockups) or text files — they are automatically forwarded to Antigravity as context.

Usage & Commands

Natural Language Messages

Just type in any bound channel:

refactor the components under src/components. Make the layout look like yesterday's screenshot (with image attached)

Slash Commands

  • 📂 /project list — Browse projects via select menu; selecting one auto-creates a category and session channel
  • 📂 /project create <name> — Create a new project directory + Discord category/channel
  • 💬 /new — Start a new Antigravity chat session in the current project
  • 💬 /chat — Show current session info and list all sessions in the project
  • ⚙️ /model [name] — Switch the LLM model (e.g. gpt-4o, claude-3-opus, gemini-1.5-pro)
  • ⚙️ /mode — Switch execution mode via dropdown (code, architect, ask, etc.)
  • 📝 /template list — Display registered templates with execute buttons
  • 📝 /template add <name> <prompt> — Register a new prompt template
  • 📝 /template delete <name> — Delete a template
  • 🔗 /join — Join an existing Antigravity session (shows up to 20 recent sessions)
  • 🔗 /mirror — Toggle PC→Discord message mirroring for the current session
  • 🛑 /stop — Force-stop a running Antigravity task
  • 📸 /screenshot — Capture and send Antigravity's current screen
  • 🔧 /status — Show bot connection status, current mode, and active project
  • ✅ /autoaccept [on|off|status] — Toggle auto-approval of file edit dialogs
  • 📝 /output [embed|plain] — Toggle output format between Embed and Plain Text (plain text is easier to copy on mobile)
  • 📋 /logs [lines] [level] — View recent bot logs (ephemeral)
  • 🏓 /ping — Check bot latency
  • 🧹 /cleanup [days] — Scan and clean up inactive session channels (default: 7 days)
  • ❓ /help — Display list of available commands

Telegram Commands

Telegram commands use underscores instead of subcommand syntax (Telegram does not allow hyphens or spaces in command names).

  • /project — Manage workspace bindings (list, select, create)
  • /project_create <name> — Create a new workspace directory
  • /new — Start a new chat session
  • /template — List prompt templates with execute buttons
  • /template_add <name> <prompt> — Add a new prompt template
  • /template_delete <name> — Delete a prompt template
  • /mode — Switch execution mode
  • /model — Switch LLM model
  • /screenshot — Capture Antigravity screenshot
  • /autoaccept [on|off] — Toggle auto-accept mode
  • /logs [count] — Show recent log entries
  • /stop — Interrupt active LLM generation
  • /status — Show bot status and connections
  • /ping — Check bot latency
  • /help — Show available commands

CLI Commands

lazy-gravity              # Auto: runs setup if unconfigured, otherwise starts the bot
lazy-gravity setup        # Interactive setup wizard
lazy-gravity open         # Open Antigravity with CDP (auto-selects available port)
lazy-gravity start        # Start the Discord bot
lazy-gravity doctor       # Check environment and dependencies
lazy-gravity --verbose    # Show debug-level logs (CDP details, detector events, etc.)
lazy-gravity --quiet      # Only show errors
lazy-gravity --version    # Show version
lazy-gravity --help       # Show help

Setup (Detailed)

Option A: npm (Recommended)

npm install -g lazy-gravity
lazy-gravity setup

The wizard guides you through 4 steps:

  1. Discord Bot Token — create a bot at the Discord Developer Portal.
    • Enable Privileged Gateway Intents: PRESENCE, SERVER MEMBERS, MESSAGE CONTENT.
    • Generate an OAuth2 invite URL with the following bot permissions: Manage Channels (required for /project), Send Messages, Embed Links, Attach Files, Read Message History, and Add Reactions.
    • Invite the bot to your server, then copy the bot token. Client ID is extracted from the token automatically.
  2. Guild (Server) ID — for instant slash command registration (optional; press Enter to skip).
  3. Allowed User IDs — Discord users authorized to interact with the bot.
  4. Workspace Directory — parent directory where your coding projects live.

Config is saved to ~/.lazy-gravity/config.json.

Option B: From source

git clone https://github.com/tokyoweb3/LazyGravity.git
cd LazyGravity
npm install

Set up your .env file:

cp .env.example .env

Edit .env and fill in the required values:

DISCORD_BOT_TOKEN=your_bot_token_here
GUILD_ID=your_guild_id_here
ALLOWED_USER_IDS=123456789,987654321
WORKSPACE_BASE_DIR=~/Code
# ANTIGRAVITY_PATH=/path/to/antigravity.AppImage  # Optional: For Linux users or custom installations

Then start the bot:

npm run start

Adding Telegram Support (Optional)

  1. Install grammy: npm install grammy
  2. Create a bot via @BotFather on Telegram and copy the token.
  3. Add the following to your .env:
PLATFORMS=discord,telegram        # or just "telegram" for Telegram-only
TELEGRAM_BOT_TOKEN=your_telegram_bot_token_here
TELEGRAM_ALLOWED_USER_IDS=123456789    # Your Telegram numeric user ID

For Telegram-only deployments, Discord credentials (DISCORD_BOT_TOKEN, CLIENT_ID, ALLOWED_USER_IDS) are not required.

Alternatively, you can build and use the CLI:

npm run build
node dist/bin/cli.js setup    # or: node dist/bin/cli.js start

Launch Antigravity with CDP

LazyGravity connects to Antigravity via Chrome DevTools Protocol (CDP). You need to launch Antigravity with a remote debugging port enabled.

# Easiest way (auto-selects an available port):
lazy-gravity open

If you cloned from source, you can also use the bundled launcher scripts (they auto-detect an available port from 9222–9666):

macOS

Double-click start_antigravity_mac.command in the repo root.

  • First run: if you get a permission error, run chmod +x start_antigravity_mac.command once in the terminal.

Windows

Double-click start_antigravity_win.bat in the repo root.

  • If it doesn't launch: the executable may not be in your PATH. Right-click the file, edit it, and replace "Antigravity.exe" with the full install path (e.g. "%LOCALAPPDATA%\Programs\Antigravity\Antigravity.exe").

Linux

On Linux (especially when using AppImages), the antigravity command might not be globally available. You can specify the exact path to your executable by setting the ANTIGRAVITY_PATH environment variable in your .env file:

ANTIGRAVITY_PATH=/opt/applications/antigravity.AppImage

Tip: CDP ports are auto-scanned from candidates (9222, 9223, 9333, 9444, 9555, 9666). Launch Antigravity first, then start the bot — it connects automatically.


Troubleshooting

If the bot is unresponsive or you've updated the code, restart it:

  1. Stop the bot — press Ctrl + C in the terminal, or:
    pkill -f "lazy-gravity"
  2. Restart
    lazy-gravity start
    # or, from source: npm run start

If Antigravity is restarted, the bot automatically attempts CDP reconnection. Sending a message triggers automatic project reconnection.

Run lazy-gravity doctor to diagnose configuration and connectivity issues.


How CDP Connection Works

  1. The bot scans debug ports (default: 9222) and auto-detects the Antigravity target
  2. Connects via WebSocket to CDP (Runtime.evaluate for DOM operations)
  3. Injects messages into the chat input, monitors Antigravity responses, and captures screenshots

On disconnect: automatically retries up to 3 times (maxReconnectAttempts). If all retries fail, an error notification is sent to the active chat platform.

Platform Architecture

LazyGravity uses a platform abstraction layer so the core bot logic is platform-independent:

src/platform/
├── types.ts              # Shared interfaces (PlatformMessage, PlatformChannel, etc.)
├── adapter.ts            # PlatformAdapter interface
├── richContentBuilder.ts # Immutable builder for rich content (embeds/HTML)
├── discord/              # Discord adapter (discord.js wrappers)
│   ├── discordAdapter.ts
│   └── wrappers.ts
└── telegram/             # Telegram adapter (grammy-compatible wrappers)
    ├── telegramAdapter.ts
    ├── telegramFormatter.ts  # Markdown → Telegram HTML conversion
    └── wrappers.ts

Both adapters implement the same PlatformAdapter interface and emit events through PlatformAdapterEvents. The EventRouter dispatches events to platform-agnostic handlers, and the WorkspaceQueue serializes concurrent requests per workspace across platforms.

License

MIT