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

kmail-cmail

v1.0.10

Published

An intelligent AI agent that performs various automated tasks

Downloads

1,145

Readme

Cmail

An intelligent AI agent that performs various automated tasks including file operations, data processing, text analysis, web scraping, and automation.

Installation

npm install kmail-cmail

Usage

const Cmail = require('cmail');

// Initialize the AI agent
const agent = new Cmail({
  name: 'My Assistant',
  debug: true
});

// Execute various tasks
async function runTasks() {
  try {
    // File operations
    const writeResult = await agent.executeTask('file_write', {
      filePath: './output.txt',
      content: 'Hello from Cmail AI Agent!'
    });
    
    const readResult = await agent.executeTask('file_read', {
      filePath: './output.txt'
    });
    
    // Data processing
    const dataResult = await agent.executeTask('data_process', {
      data: [1, 2, 3, 4, 5],
      operation: 'sum'
    });
    
    // Text analysis
    const textResult = await agent.executeTask('text_analyze', {
      text: 'Contact us at [email protected] or visit https://example.com',
      analysis: 'extract_emails'
    });
    
    // List files in directory
    const listResult = await agent.executeTask('file_list', {
      directory: './'
    });
    
    console.log('Task results:', { writeResult, readResult, dataResult, textResult, listResult });
    
    // View task history
    console.log('Task History:', agent.getTaskHistory());
    
    // View agent capabilities
    console.log('Capabilities:', agent.getCapabilities());
    
  } catch (error) {
    console.error('Error executing tasks:', error.message);
  }
}

runTasks();

Web UI

Cmail includes a modern, responsive web interface with enhanced UX:

Features

  • Modern Dark Theme: Beautiful gradient backgrounds with animated effects
  • Tabbed Interface: Organized workspace with Chat, Files, Tools, and Models sections
  • Keyboard Shortcuts: Ctrl+1/2/3/4 to quickly switch between tabs
  • Real-time Status: Live Ollama connection status indicator
  • Enhanced Chat: Typing indicators, message history, and markdown support
  • File Operations: Read, write, and list files with visual feedback
  • Data Analysis Tools: Text analysis and data processing utilities
  • Model Management: Visual model selection with status indicators
  • Copy to Clipboard: One-click copy for all outputs
  • Responsive Design: Works seamlessly on desktop and mobile devices
  • Loading States: Beautiful animated loading indicators
  • Error Handling: Clear error messages with visual feedback

Starting the Web UI

# Start the web server
cmail web

# Or specify custom port and host
cmail web --port 8080 --host 127.0.0.1

The web interface will be available at http://localhost:6000 by default.

Web UI Sections

Chat Tab

  • Select AI models from dropdown
  • Real-time conversation with typing indicators
  • Message history persistence
  • Clear chat functionality
  • Keyboard shortcuts (Enter to send, Shift+Enter for new line)

Files Tab

  • List directory contents
  • Read file contents
  • Write/create files
  • Visual file type indicators

Tools Tab

  • Text analysis (word count, character count, email/URL extraction)
  • Data processing (count, sum, average, filter, sort)
  • JSON validation for data operations
  • Copy results to clipboard

Models Tab

  • View installed Ollama models
  • Visual model selection
  • Refresh model list
  • Popular model badges
  • Real-time status indicators

CLI Commands

Constructor Options

  • name (string): Agent name (default: 'Cmail Agent')
  • version (string): Agent version (default: '1.0.0')
  • debug (boolean): Enable debug logging (default: false)

Methods

executeTask(taskType, params)

Executes a specific task with given parameters.

Parameters:

  • taskType (string): Type of task to execute
  • params (object): Task-specific parameters

Returns: Promise that resolves to an object with success, taskId, and result or error properties.

getTaskHistory()

Returns the history of all executed tasks.

getCapabilities()

Returns the list of available agent capabilities.

Task Types

File Operations

file_read

  • filePath (string): Path to the file to read

file_write

  • filePath (string): Path where to write the file
  • content (string): Content to write to the file

file_list

  • directory (string): Directory path to list files from

Data Processing

data_process

  • data (array/object): Data to process
  • operation (string): Operation type - 'count', 'sum', 'average', 'filter', 'sort'

Text Analysis

text_analyze

  • text (string): Text to analyze
  • analysis (string): Analysis type - 'word_count', 'character_count', 'line_count', 'extract_emails', 'extract_urls'

Web Scraping

web_scrape

  • url (string): URL to scrape
  • selector (string): CSS selector for content extraction

Automation

automation

  • script (string): Automation script to execute

Examples

Data Processing Example

const numbers = [10, 20, 30, 40, 50];
const result = await agent.executeTask('data_process', {
  data: numbers,
  operation: 'average'
});
console.log('Average:', result.result); // 30

Text Analysis Example

const text = 'Contact: [email protected], [email protected], [email protected]';
const emails = await agent.executeTask('text_analyze', {
  text: text,
  analysis: 'extract_emails'
});
console.log('Emails found:', emails.result);
// ['[email protected]', '[email protected]', '[email protected]']

File Management Example

// Create a directory and files
await agent.executeTask('file_write', {
  filePath: './data/report.txt',
  content: 'Quarterly Report Data'
});

// List files
const files = await agent.executeTask('file_list', {
  directory: './data'
});
console.log('Files:', files.result);

License

ISC