CLI Getting Started
Install the LogicStamp Context CLI to compile your TypeScript codebase into deterministic architectural contracts and dependency graphs.
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-contextThe Try (no install) tab uses npx -y so package installs do not block on prompts—especially in CI or when a host starts npx without a terminal. Full explanation: Getting started · MCP configuration.
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:
- Updates
.gitignoreforcontext.json,context_*.json,context.toon,*.uif.json,.logicstamp/,stamp_security_report.json - Runs security scan for secrets (API keys, passwords, tokens)
- Generates
LLM_CONTEXT.md - Creates
.logicstamp/config.jsonsostamp contextstays non-interactive (CI-friendly)
cd your-react-project
stamp initGenerate AI Context
Run the context generator to analyze your codebase and create structured bundles optimized for AI assistants.
stamp contextWith Style extracts Tailwind CSS classes, SCSS modules, Material UI themes, styled-components, and framer-motion animations. LogicStamp analyzes .ts and .tsx only.
LogicStamp runs alongside tsc—it does not replace your typechecker. See TypeScript support.
What You Get
LogicStamp generates structured context files in your project:
- •
context_main.jsonin your project root with an overview - •
context.jsonfiles 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 --watchStrict 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-modesProfiles: llm-chat (default), llm-safe (30 nodes max), ci-strict (contracts only)
Common Tasks
Exclude Files
Add files to .stampignore:
stamp ignore src/secrets.tsValidate Context
Check context files for errors:
stamp context validateCompare Context
Detect changes (drift detection):
stamp context compareSecurity Scan
Scan for secrets in your codebase:
stamp security scanContext generation automatically sanitizes detected secrets.
Common Workflows
Development Workflow
stamp init
stamp context --watchCI/CD Workflow
stamp context --profile ci-strict --strict-missing
stamp context validate
stamp context compareTroubleshooting
Context files not generating?
Check Node.js version (requires >= 20), verify .ts / .tsx files exist, or run LOGICSTAMP_DEBUG=1 stamp context (Unix) for detailed logs.
npx vs global stamp
If one works and the other fails, remove conflicting globals and pick a single workflow:
npm uninstall -g logicstamp-contextThen reinstall globally or use npx -y logicstamp-context@latest context only.
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.