CLI Getting Started

Install the LogicStamp Context CLI to compile your TypeScript codebase into deterministic architectural contracts and dependency graphs.

Quick start
Global install
CLI Tool

Prerequisites

🟒

Node.js >= 20

Latest LTS recommended

βš›οΈ

TypeScript

Your project codebase

πŸ’»

Terminal

Basic CLI knowledge

Install LogicStamp Context

Install the CLI globally to use the stamp command from anywhere on your system.

npm install -g logicstamp-context

Initialize Your ProjectRecommended

Set up .gitignore patterns and LLM_CONTEXT.md. If you skip this step, stamp context uses safe defaults (CI-friendly, never prompts).

πŸ”’ Security: By default, stamp init runs a security scan to detect secrets in your JS/TS/JSON files. Use stamp ignore <file> to exclude files with detected secrets.

What stamp init does:

  • Sets up .gitignore patterns for generated files
  • Runs security scan for secrets (API keys, passwords, tokens)
  • Generates LLM_CONTEXT.md guide
  • Creates .logicstamp/config.json for preferences
cd your-react-project stamp init

Generate AI Context

Run the context generator to analyze your codebase and create structured bundles optimized for AI assistants.

stamp context

With Style extracts Tailwind CSS classes, SCSS modules, Material UI themes, styled-components, and framer-motion animations.

What You Get

LogicStamp generates structured context files in your project:

  • β€’context_main.json in your project root with an overview
  • β€’context.json files in each folder with component contracts

These files describe your components' props, hooks, dependencies, and relationshipsβ€”optimized for AI consumption.

your-project/ β”œβ”€β”€ context_main.json # Main index β”œβ”€β”€ context.json # Root folder bundles β”œβ”€β”€ src/ β”‚ └── context.json # Bundles from src/ └── src/components/ └── context.json # Bundles from src/components/

Next Steps

Keep Context Fresh (Watch Mode)

Automatically regenerate context as you code:

stamp context --watch

Strict Watch detects breaking changes (removed props/events) and tracks violations during refactors. Learn more about watch mode β†’

Advanced Options

Customize output and optimize token usage:

stamp context --compare-modes

Profiles: llm-chat (default), llm-safe (30 nodes max), ci-strict (contracts only)

Common Tasks

Exclude Files

Add files to .stampignore:

stamp ignore src/secrets.ts

Validate Context

Check context files for errors:

stamp context validate

Compare Context

Detect changes (drift detection):

stamp context compare

Security Scan

Scan for secrets in your codebase:

stamp security scan

Context generation automatically sanitizes detected secrets.

Common Workflows

Development Workflow

stamp init stamp context --watch

CI/CD Workflow

stamp context --profile ci-strict --strict-missing stamp context validate

Troubleshooting

Context files not generating?

Check Node.js version (requires >= 20), verify TypeScript files exist, or run with LOGICSTAMP_DEBUG=1 for detailed logs.

Large bundle sizes?

Reduce depth with --depth 1, use --profile llm-safe, or exclude files with .stampignore.

Missing dependencies?

External packages (React, lodash) are expected. Use --strict-missing in CI to catch unexpected missing dependencies.

Quick Reference

Installation

npm install -g logicstamp-context

Initialize

stamp init

Generate Context

stamp context

Watch Mode

stamp context --watch

With Style

stamp context style

Validate

stamp context validate

Compare

stamp context compare

Exclude Files

stamp ignore <file>

Next Steps

Explore the complete command reference or learn about advanced features.