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

@hskksk/mem-ai-cli

v0.2.0

Published

CLI tool for mem.ai API

Readme

mem-ai CLI

npm version License: MIT

Command-line interface for mem.ai API.

Installation

npm install -g @hskksk/mem-ai-cli

Or use without installing:

npx @hskksk/mem-ai-cli <command>

Configuration

Get your API key from mem.ai settings and set it as an environment variable:

export MEM_API_KEY=your_api_key_here

Or pass it directly with the --api-key flag:

mem-ai --api-key your_api_key_here note list

Optionally, override the API base URL:

export MEM_API_BASE_URL=https://api.mem.ai

Usage

mem-ai [options] <command>

Global Options

| Option | Description | |--------|-------------| | --api-key <key> | API key (overrides MEM_API_KEY env var) | | --json | Output as JSON | | -V, --version | Show version | | -h, --help | Show help |

Commands

Mem It

mem-ai mem-it <text> [options]

| Option | Description | |--------|-------------| | --instructions <text> | Processing instructions | | --context <text> | Background context | | --timestamp <iso> | ISO 8601 timestamp |

Notes

mem-ai note list [options]
mem-ai note get <id>
mem-ai note create [options]
mem-ai note delete <id> [--force]
mem-ai note search [query] [options]

note list options:

| Option | Description | |--------|-------------| | --limit <n> | Number of notes (1-100) | | --page <cursor> | Pagination cursor | | --order-by <field> | created_at | updated_at | | --collection-id <uuid> | Filter by collection | | --open-tasks | Only notes with open tasks | | --tasks | Only notes with tasks | | --images | Only notes with images | | --files | Only notes with files | | --with-content | Include note content in response |

note create options:

| Option | Description | |--------|-------------| | --content <text> | Markdown content | | --file <path> | Read content from file (- for stdin) | | --collection-id <uuid> | Add to collection by ID (repeatable) | | --collection-title <title> | Add to collection by title (repeatable) | | --id <uuid> | Specify note ID | | --created-at <iso> | Creation timestamp (ISO 8601) |

note search options:

| Option | Description | |--------|-------------| | --collection-id <uuid> | Filter by collection ID (repeatable) | | --open-tasks | Only notes with open tasks | | --tasks | Only notes with tasks | | --images | Only notes with images | | --files | Only notes with files | | --include-snippet | Include snippet in results | | --include-content | Include full content in results |

Collections

mem-ai collection list [options]
mem-ai collection get <id>
mem-ai collection create <title> [--description <text>]
mem-ai collection delete <id> [--force]
mem-ai collection search [query] [--include-description]

collection list options:

| Option | Description | |--------|-------------| | --limit <n> | Number of collections (1-100) | | --page <cursor> | Pagination cursor | | --order-by <field> | created_at | updated_at |

Examples

# Send text to mem.ai
mem-ai mem-it "Remember to review the Q1 roadmap"
mem-ai mem-it "Task complete" --instructions "Mark as done"

# List notes
mem-ai note list
mem-ai note list --limit 10 --order-by updated_at --json

# Get a specific note
mem-ai note get <note-id>

# Create a note from text
mem-ai note create --content "# Meeting Notes\n\n- Item 1"

# Create a note from a file
mem-ai note create --file meeting.md

# Create a note from stdin
cat meeting.md | mem-ai note create --file -

# Add a note to a collection
mem-ai note create --file note.md --collection-title "Work"

# Delete a note (prompts for confirmation)
mem-ai note delete <note-id>
mem-ai note delete <note-id> --force

# Search notes
mem-ai note search "roadmap"
mem-ai note search --open-tasks

# Manage collections
mem-ai collection list
mem-ai collection create "Work" --description "Work related notes"
mem-ai collection get <collection-id>
mem-ai collection search "work"
mem-ai collection delete <collection-id> --force

Development

Prerequisites

  • Node.js >= 20.0.0
  • pnpm (recommended) or npm

Setup

git clone https://github.com/hskksk/mem-ai-cli.git
cd mem-ai-cli
pnpm install

Commands

pnpm dev         # Run in development mode (with auto-reload)
pnpm build       # Build
pnpm test        # Run tests
pnpm type-check  # Type check
pnpm lint        # Lint

Project Structure

src/
├── cli.ts                      # Entry point
├── client/
│   └── mem-api-client.ts       # mem.ai API client
├── cli/
│   ├── commands/               # Command implementations
│   │   ├── mem-it.ts
│   │   ├── note/
│   │   └── collection/
│   ├── formatters/             # Output formatters
│   │   ├── note-formatter.ts
│   │   └── collection-formatter.ts
│   └── utils.ts
├── types/
│   └── api.ts                  # API type definitions
└── utils/
    └── error-handler.ts        # Error classes

Error Handling

  • 401 Unauthorized: Invalid API key
  • 404 Not Found: Resource not found
  • 429 Too Many Requests: Rate limit exceeded
  • 500 Server Error: Internal server error

Errors are written to stderr. Use --json for machine-readable error output.

API Documentation

See the mem.ai API documentation.

License

MIT - see LICENSE.

Links

Changelog

See CHANGELOG.md for the full version history.