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

mycontext-cli

v4.2.26

Published

The Context Engine for AI-Native Development - Generate high-fidelity scaffolds and Living Brains for AI-powered coding

Downloads

1,935

Readme

mycontext-cli

The Context Engine for AI-Native Development.
Generate high-fidelity scaffolds, maintain a Living Brain, and drive your entire codebase with a single source of truth.

npm version License: MIT


Table of Contents


What is MyContext?

MyContext treats your project spec as a Living Brain — a structured JSON document (.mycontext/context.json) that describes your app's goals, architecture, components, and design system.

Every CLI command — such as screen mapping or component discovery — automatically synchronizes its results back into this central Brain, ensuring your documentation and your code remain perfectly aligned.


Installation

npm install -g mycontext-cli
# or
pnpm add -g mycontext-cli

Verify:

mycontext --version

Quick Start

# 1. Go to your project folder (or an empty directory)
cd my-app

# 2. Initialise the Living Brain
mycontext init

# 3. Configure your AI provider
mycontext setup

# 4. Generate the full context from your PRD
mycontext generate context --full

# 5. Scaffold the entire application
mycontext build

Core Concepts

| Concept | What it is | |---|---| | Living Brain | .mycontext/context.json — single source of truth for your project | | Deterministic Runtime | MyContext ensures your code never drifts from your architectural spec | | PRD | .mycontext/01-prd.md — your product requirements document | | UX Brain (i18n) | Internationalization layer synchronized with the Living Brain | | Design Manifest | AI-derived design system snapshot | | Sub-agents | Specialised AI workers (CodeGen, QA, Architect, Security, …) | | FSR | Feature Spec Record — structured description of a single feature |


Command Reference

Project Setup

mycontext init [project-name]

Initialise a new MyContext project. Creates .mycontext/ with your PRD template, context skeleton, and (optionally) a framework scaffold.

mycontext init my-saas-app
mycontext init --framework nextjs          # Next.js + shadcn/ui + i18n
mycontext init --framework instantdb       # Next.js + InstantDB + shadcn (default)
mycontext init --interactive               # Guided 100%-complete spec wizard
mycontext init --i18n                      # Enable internationalization wizard
mycontext init --scope apps/my-app         # Scope context to a specific directory
mycontext init --ignore tests,docs         # Ignore specific patterns during scan

In a monorepo, running mycontext init at the root will trigger an interactive workspace selector and context scoping wizard.

mycontext setup

Configure AI providers (Anthropic, OpenAI, xAI) and your development stack.

mycontext setup
mycontext setup --stack nextjs-tailwind-shadcn

mycontext auth

Authenticate with the MyContext AI cloud service.

mycontext auth --login
mycontext auth --status
mycontext auth --logout

mycontext setup-shadcn

Add shadcn/ui to an existing project and wire it to the Living Brain.

mycontext setup-database

Set up a database provider (InstantDB, Supabase, Firebase) with schema and auth components.

mycontext setup-database --provider instantdb

mycontext setup-instantdb

Full InstantDB + MCP integration wizard.

mycontext setup-instantdb --app-id <id> --token <token>

mycontext setup-mcp

Configure a Model Context Protocol (MCP) server for AI-powered tooling.

mycontext setup-mcp --provider instantdb
mycontext setup-mcp --provider github
mycontext setup-mcp --provider custom --server <url>

Living Brain

mycontext generate [type]

Orchestrate the Living Brain — generate context files, types, brand tokens, and more. All generation commands automatically synchronize their results into .mycontext/context.json.

mycontext generate context --full          # Full PRD + A/B/C/D context files
mycontext generate context                 # Incremental update
mycontext generate:screens-list            # Sync routes to the Brain
mycontext generate:components-manifest     # Sync component specs to the Brain
mycontext generate design-prompt           # AI design brief for UI designer
mycontext generate actions                 # UI→backend action hooks
mycontext generate assets                  # Planned asset list
mycontext generate sample-data             # Seed data for development

mycontext sync

Auto-update context.json and README.md by scanning the live codebase.

mycontext sync                   # Sync both
mycontext sync --context         # context.json only
mycontext sync --readme          # README.md only
mycontext sync --dry-run         # Preview changes without writing

mycontext sync-readme

Synchronise the root README.md with your design manifest.

mycontext validate <target>

Validate your PRD or context files for completeness.

mycontext validate prd
mycontext validate context
mycontext validate --interactive

mycontext status

Show current project status and progress against the Living Brain.

mycontext status
mycontext status --detailed

AI Agent & Planning

mycontext agent [prompt]

Assess a natural-language prompt against the Living Brain and propose (or apply) changes.

mycontext agent "Add a dark mode toggle to the nav"
mycontext agent "Add a dark mode toggle" --execute   # Apply changes
mycontext agent "..." --execute --yes                # Skip confirmation

mycontext plan

Interactive feature planning session — produces an FSR (Feature Spec Record).

mycontext plan

mycontext build-strategy

Generate an AI-powered build strategy and execution plan from the current Brain state.

mycontext ideate

Generate creative UI/UX concepts based on project context.

mycontext ideate --industry fintech --count 5

Code Generation

mycontext build

Scaffold the entire application from the Living Brain in one shot.

mycontext build
mycontext build --force    # Regenerate all components

mycontext build-feature

Build a single feature end-to-end from an FSR.

mycontext generate-components [target]

Generate React components from the component manifest.

mycontext generate-components all
mycontext generate-components --core-only     # First 10 components only
mycontext generate-components --group forms
mycontext generate-components all --with-tests

mycontext add <component>

Add a context-aware component (shadcn primitive or custom).

mycontext add button
mycontext add UserCard --group cards
mycontext add dialog --shadcn

mycontext enhance

Enhance the project or specific components with AI suggestions.

mycontext refine

Refine context or components.

mycontext refine:component <componentName>

Refine a single component with targeted AI feedback.

mycontext refine:component HeroSection --variant mobile
mycontext refine:component NavBar --in-place

mycontext migrate [target]

Migrate components to new standards.

mycontext migrate rtl                          # RTL-friendly logical CSS properties
mycontext migrate rtl --path src/components/Nav.tsx
mycontext migrate radix --all                  # Refactor to Radix/shadcn primitives

Analysis & Diagnostics

mycontext analyze

Analyse an existing project and generate context files from the live codebase.

mycontext analyze
mycontext analyze --image ./screenshot.png    # Analyse a mockup instead
mycontext analyze --verbose

mycontext design

Design system analysis and manifest generation.

mycontext design --analyze
mycontext design --validate
mycontext design --summary
mycontext design --regenerate

mycontext scan

Scan the project tree and assess progress against the Living Brain.

mycontext scan
mycontext scan --assess          # AI progress assessment
mycontext scan --assess --json   # Machine-readable output

mycontext health-check

Run health checks across the project.

mycontext doctor

Full diagnostic check with auto-fix suggestions. Now includes deterministic checks for:

  • Structure Drift: Ensures code exists for all features defined in the Brain.
  • i18n Coverage: Detects hardcoded strings and missing dictionary keys.
  • Project Integrity: Validates monorepo scoping and workspace boundaries.
mycontext doctor
mycontext doctor --scope apps/my-app    # Limit checks to a specific scope
mycontext doctor --project my-pkg       # Filter by workspace project name
mycontext doctor --fix                  # Apply all safe fixes

mycontext sanitize

Find and optionally remove redundant, duplicate, or unreachable code.

mycontext sanitize
mycontext sanitize --fix
mycontext sanitize --verbose

mycontext generate-todos

Generate a contextual todo list from the project's current state.

mycontext generate-todos --count 10 --energy high --complexity moderate

Maintenance

mycontext update

Update the CLI to the latest published version.

mycontext update

mycontext clean

Clean and repair malformed context files.

mycontext clean
mycontext clean --project ./path/to/project

mycontext help [topic]

Context-aware help for any topic or command.

mycontext help
mycontext help agent
mycontext help generate --verbose

Monorepo Support

MyContext is designed for modern, multi-app monorepos. It intelligently handles workspace boundaries and shared packages.

Smart Scoping

When you initialize MyContext for a specific application within a monorepo (e.g., apps/admin), it:

  1. Detects Dependencies: Analyzes package.json to see which workspace packages (e.g., packages/ui) the app uses.
  2. Suggests Context: Offers to include those related packages in the context scope automatically.
  3. Isolates Context: Keeps the Living Brain focused on what matters for that specific service, while maintaining awareness of shared workspace rules.

Workspace Detection

Supports:

  • pnpm: Native pnpm-workspace.yaml parsing.
  • Turborepo: Automatic turbo.json detection.
  • npm/yarn: Standard workspaces field in package.json.

Typical Workflow

Starting a new project

mkdir my-app && cd my-app
mycontext init --spec-only            # Context files only
mycontext setup                       # Configure AI keys (Gemini, Claude, etc.)
mycontext generate context --full     # Build the Living Brain
mycontext generate:screens-list       # Map routes to Brain
mycontext generate:components-manifest # Map component specs to Brain
mycontext generate:design-prompt      # Ready for UI designer handoff

Adding a feature to an existing project

mycontext plan                        # Describe the feature interactively
mycontext build-feature               # Generate code from the FSR
mycontext sync                        # Keep context.json in sync

Adopting MyContext on an existing codebase

cd existing-project
mycontext analyze                     # Reverse-engineer context from code
mycontext generate context            # Fill gaps with AI
mycontext status                      # See what's covered

Environment Variables

MyContext loads .env files from your project automatically. You can also set these directly:

| Variable | Description | |---|---| | ANTHROPIC_API_KEY | Anthropic Claude API key | | OPENAI_API_KEY | OpenAI API key | | XAI_API_KEY | xAI (Grok) API key | | MYCONTEXT_API_KEY | MyContext cloud service key | | INSTANTDB_APP_ID | InstantDB application ID |

Loaded in order (first match wins):
.mycontext/.env.local.mycontext/.env.env.local.env


Configuration

All project configuration lives in .mycontext/:

.mycontext/
├── context.json        ← Living Brain (source of truth)
├── 01-prd.md           ← Product Requirements Document
├── .env.local          ← Local secrets (git-ignored)
└── ...                 ← Generated context files

Links


Built with MyContext — spec-driven development for the AI era.