Skip to content

Supercharge your social media with on-device AI - summaries, smart writing, and content tools for Twitter/X, LinkedIn & Substack. Private, fast & free.

Notifications You must be signed in to change notification settings

diaorui/NanoCoffee

Repository files navigation

☕ NanoCoffee

AI Summaries & Smart Writing for Social Media

Chrome Web Store License: MIT

Supercharge your social media experience with on-device AI tools - all private, fast, and free.

🌐 Website: https://nanocoffee.ruidiao.dev/

✨ Features

Smart Summaries

Get instant AI-generated summaries of long posts, articles, and threads on Twitter/X, LinkedIn, and Substack. Summaries appear inline, styled to match each platform.

AI Writing Assistant

  • Generate contextual replies to posts with one click
  • Rewrite your drafts for clarity and impact
  • Adjust tone (casual/formal) instantly
  • Change length - make posts longer or shorter
  • Works directly in compose boxes on all supported platforms

Privacy First

  • 100% on-device processing using Chrome's built-in Gemini Nano
  • Zero data collection - your content never leaves your device
  • Works offline after initial setup
  • No accounts, no tracking, no servers

Native Integration

Seamlessly blends into Twitter/X, LinkedIn, and Substack with non-intrusive UI that matches each platform's design.

🚀 Installation

Option 1: Chrome Web Store (Recommended)

Install directly from the Chrome Web Store

Option 2: Load from Source

  1. Clone this repository
  2. Open Chrome and navigate to chrome://extensions
  3. Enable "Developer mode" (top right)
  4. Click "Load unpacked" and select the repository folder
  5. Visit Twitter/X, LinkedIn, or Substack to start using!

System Requirements

  • Chrome 138+ stable
  • 22 GB free disk space (for Gemini Nano model)
  • GPU with 4+ GB VRAM OR CPU with 16+ GB RAM
  • Desktop only (Windows 10+, macOS 13+, Linux)

Gemini Nano will download automatically on first use (may take a few minutes).

🛠️ Development

Project Structure

.
├── manifest.json           # Extension metadata and permissions
├── platform-config.js      # Platform-specific selectors and styling
├── summarizer-core.js      # Gemini Nano summarization logic
├── rewriter-core.js        # Gemini Nano rewriting logic
├── writer-core.js          # Gemini Nano writing logic
├── summarization-handler.js # Summary UI injection
├── rewrite-handler.js      # Writing UI injection
├── content-scripts/        # Platform-specific entry points
│   ├── twitter.js
│   ├── linkedin.js
│   └── substack.js
├── assets/                 # Icons
├── vendor/                 # Third-party libraries
├── dev/                    # Development files
└── docs/                   # GitHub Pages website

Adding Support for New Platforms

The extension is designed to be easily extensible. To add a new platform:

1. Identify CSS Selectors

Use browser developer tools to find CSS selectors for:

  • Post/article text content
  • Comment sections (if applicable)
  • Text input/compose boxes

2. Update platform-config.js

Add a new entry to the PLATFORM_CONFIGS object:

const PLATFORM_CONFIGS = {
  newplatform: {
    name: 'New Platform',
    contentTypes: {
      post: {
        name: 'Post',
        textSelector: '.post-content',
        // ... styling configuration
      }
    }
  }
};

Add host permissions and content script entry:

{
  "host_permissions": [
    "https://newplatform.com/*"
  ],
  "content_scripts": [
    {
      "matches": ["https://newplatform.com/*"],
      "js": ["platform-config.js", "summarization-handler.js", "content-scripts/newplatform.js"],
      "run_at": "document_end"
    }
  ]
}

4. Create Content Script

Create content-scripts/newplatform.js:

(function() {
  'use strict';
  const handler = new SummarizationHandler('newplatform', 'post');
  handler.initialize();
})();

5. Test

Reload the extension in chrome://extensions and test on the new platform.

Building for Distribution

./dev/pack-extension.sh

This creates extension.zip ready for Chrome Web Store submission.

📝 License

MIT License - feel free to use and modify!

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

🐛 Issues

Found a bug or have a feature request? Open an issue

💬 Support

For questions or feedback, please fill out this form.


Privacy Note: NanoCoffee uses Chrome's built-in Gemini Nano for all AI processing. Your data never leaves your device. See our Privacy Policy for details.