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-contextInitialize 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
.gitignorepatterns for generated files - Runs security scan for secrets (API keys, passwords, tokens)
- Generates
LLM_CONTEXT.mdguide - Creates
.logicstamp/config.jsonfor preferences
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.
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 validateTroubleshooting
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.