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 🙏

© 2025 – Pkg Stats / Ryan Hefner

sed-cli

v1.0.7

Published

SED (Semantic Entity Design) - Connect AI to Your Database with Easy Integration

Readme

SED (Semantic Entities Designs)

SED automatically converts your raw database into an AI-ready semantic layer with intelligent business rules.

npm version npm downloads

SED creates a semantic layer that makes AI understand your business data instantly, with automatic business rule generation for security and compliance.

Overview

SED is a local-first database intelligence layer that bridges the gap between technical database schemas and business understanding. It automatically discovers your database structure, generates semantic mappings, and enforces business rules for AI applications.

What SED Does

1. Semantic Layer Generation

SED analyzes your database schema and creates business-friendly semantic mappings:

{
  "entities": [
    {
      "name": "Customer",
      "description": "A person who can place orders and has an account",
      "databaseTable": "users",
      "attributes": [
        {
          "name": "email",
          "description": "Email address",
          "databaseColumn": "email"
        }
      ]
    }
  ]
}

2. Business Rules Engine

SED automatically generates and enforces business rules:

  • PII Protection: Blocks access to sensitive data
  • Data Validation: Ensures data quality standards
  • Access Control: Role-based permissions
  • Metric Definitions: Standardized calculations
  • Custom Rules: Add your own business logic

3. Local-First Architecture

  • 100% Local Processing: No data leaves your machine
  • No API Keys Required: Works offline with pattern matching
  • Privacy-First: Your database schema stays private

Quick Start

1. Install SED

npm install -g sed-cli

2. Initialize Everything

npx sedql init

This interactive command will:

  • Set up your database connection
  • Build your semantic layer
  • Generate business rules automatically
  • Enable rules by default

Supported Databases:

  • PostgreSQL
  • MySQL
  • SQLite

3. Query Your Data

npx sedql query "show me customer orders from last month"

Use natural language to query your database. SED automatically:

  • Translates your request to SQL
  • Applies business rules for safety
  • Returns results with compliance

4. Manage Business Rules

# List all rules
npx sedql rules --list

# Disable a rule temporarily
npx sedql rules --disable pii-protection

# Add custom rules
npx sedql rules --add custom-rules.json

CLI Commands

Core Commands

  • sedql init - Initialize SED with database connection and setup everything
  • sedql build - Rebuild semantic layer and business rules
  • sedql query <query> - Query database using natural language
  • sedql validate - Validate semantic layer and business rules
  • sedql status - Show current SED status and configuration

Business Rules Management

  • sedql rules --list - List all business rules
  • sedql rules --add <file> - Add custom rules from JSON file
  • sedql rules --disable <rule-id> - Disable a specific rule
  • sedql rules --enable <rule-id> - Enable a specific rule

Export & Import

  • sedql export - Export semantic layer and configuration
  • sedql import <file> - Import configuration from file

Architecture

Database Support

  • PostgreSQL: Full support with schema discovery
  • MySQL: Comprehensive table and relationship analysis
  • SQLite: Lightweight file-based database support

Core Components

  • Connectors: Database-specific connection management
  • Semantic Layer: Business entity mapping and discovery
  • Business Logic Engine: Automatic rule generation and enforcement
  • Security Module: PII detection and access control
  • Cache Management: Performance optimization and connection pooling

Security & Privacy

  • Local Processing: All analysis happens on your machine
  • External Calls Off by Default: Anonymous usage analytics are opt-in via SED_ANALYTICS=true
  • Business Rules: Automatic PII protection and data validation
  • Environment Variables: Secure credential management
  • Input Validation: SQL injection protection

Business Rules Engine

Auto-Generated Rules

SED automatically creates business rules based on your database:

{
  "id": "pii-protection",
  "name": "PII Protection",
  "type": "access_policy",
  "severity": "block",
  "condition": {
    "type": "pattern",
    "pattern": ".*(ssn|password|email).*"
  },
  "action": {
    "type": "deny",
    "message": "Access to PII columns is not allowed"
  }
}

Rule Types

  • Access Policy: Control who can access what data
  • Data Validation: Enforce data quality standards
  • Metric Definitions: Standardize business calculations
  • Join Rules: Ensure proper table relationships
  • Custom Rules: Your own business logic

Rule Management

# See what rules exist
sedql rules --list

# Filter rules by type
sedql rules --list --type access_policy

# Add custom business hours rule
sedql rules --add business-hours.json

# Disable PII protection temporarily
sedql rules --disable pii-protection

Use Cases

AI Integration

  • Provide semantic context to LLMs
  • Enable natural language database queries
  • Bridge the gap between technical and business terminology

Data Governance

  • Automatic PII protection
  • Data quality enforcement
  • Compliance rule management

Development

  • Understand complex database schemas
  • Discover business entities and relationships
  • Generate semantic layer for applications

Contributing

We welcome contributions! Please see our Contributing Guidelines for details.

Development Setup

git clone https://github.com/holy182/sed-cli.git
cd sed-cli
npm install
npm run build
npm test

Running Tests

npm test
npm run test:security

License

GNU Affero General Public License v3.0 (AGPL-3.0) - see LICENSE file for details.

Important: This software is licensed under the AGPL-3.0 license. If you modify and distribute this software, you must make your source code available under the same license. This ensures that improvements to SED's security and governance capabilities are shared back with the community.

Support