This project provides a command-line interface (CLI) tool to quickly interact with web from the CLI. It fetches page content, summarizes it using an AI model, and allows users to select and interact with identified actions (like forms or links) on the page. This tool acts as a smart filter for the web, right in your CLI. It parses a page to surface only the essential content and the most common next steps, streamlining tasks like reading the news, researching on Wikipedia, or getting a quick weather update.
The project is organized into a modular structure for better maintainability and scalability:
.
├── src/
│ ├── types.ts # Defines shared TypeScript interfaces (e.g., PageAction).
│ ├── browserUtils.ts # Handles Playwright browser automation and Chrome profile detection.
│ ├── aiUtils.ts # Contains logic for AI-powered page summarization using OpenAI/Gemini.
│ └── cliHandler.ts # Manages all command-line user interactions using @clack/prompts.
├── index.ts # The main entry point, orchestrating the application flow.
├── package.json # Project metadata and dependencies.
├── tsconfig.json # TypeScript configuration.
├── .gitignore # Specifies intentionally untracked files to ignore.
└── README.md # Project documentation.
-
Set up Environment Variable: Ensure you have your Gemini API key set as an environment variable:
export GEMINI_API_KEY="YOUR_GEMINI_API_KEY"
-
Install Dependencies:
bun install
-
Run the Application:
npm install
Node Example with type stripping attribute:
npm run start https://example.com
- Web Page Fetching: Retrieves HTML content and title from a given URL.
- AI Summarization: Uses a configured AI model (Gemini) to summarize page content concisely.
- Action Identification: Identifies potential user actions (forms, links) on the page based on AI analysis.
- Interactive CLI: Provides a user-friendly command-line interface to select and interact with identified page actions.
- Chrome Profile Detection: [WIP] Automatically detects common Chrome user profile paths for persistent browser sessions (though currently configured for non-persistent headless mode).
This is a silly project built while I'm looking for new opportunities around building AI-powered platforms and tools. If you're hiring, message me on https://www.linkedin.com/in/jonathandunlap/