Initialization Command

stamp init Command

Initialize LogicStamp in your project by setting up .gitignore patterns and other project configuration.

Syntax

stamp init [path] [options]

[path] – Target directory to initialize (default: current directory)

Options

OptionDescription
--no-secureSkip security scan (security scan runs by default in v0.3.0+)
-y, --yesSkip all prompts (non-interactive mode)
--skip-gitignoreSkip .gitignore setup
-h, --helpShow help

What It Does

The stamp init command sets up LogicStamp in your project by:

1

Creating or updating .gitignore with LogicStamp-specific patterns:

  • context.json – Context files generated per folder
  • context_*.json – Main index and other context variants
  • *.uif.json – UIF contract files
  • logicstamp.manifest.json – Dependency manifest files
  • .logicstamp/ – Configuration directory
  • stamp_security_report.json – 🔒 Security scan report file (contains sensitive information about detected secrets in .ts, .tsx, .js, .jsx, and .json files). Note: Secrets should never be hardcoded in source files - use environment variables instead.
2

Generating LLM_CONTEXT.md in the project root

A guide that helps AI assistants understand your project structure and how to work with LogicStamp context files (if it doesn't already exist)

3

Creating .logicstamp/config.json

Saves your preferences so stamp context respects them (CI-friendly, never prompts)

Examples

# Initialize LogicStamp in the current directory # Non-interactive by default (security scan runs automatically) stamp init # Explicitly skip prompts (redundant - already non-interactive by default) stamp init --yes # Skip security scan (enables interactive prompts in TTY mode) stamp init --no-secure # Initialize a specific directory stamp init ./my-project # Initialize without security scan for a specific directory stamp init ./my-project --no-secure # Skip .gitignore setup stamp init --skip-gitignore

Behavior

When .gitignore doesn't exist

Creates a new .gitignore file with LogicStamp patterns:

✅ Created .gitignore with LogicStamp patterns The following patterns were added/verified: - context.json - context_*.json - *.uif.json - logicstamp.manifest.json

When .gitignore exists but doesn't have LogicStamp patterns

Adds LogicStamp patterns to the existing .gitignore:

✅ Added LogicStamp patterns to existing .gitignore The following patterns were added/verified: - context.json - context_*.json - *.uif.json - logicstamp.manifest.json

When .gitignore already has LogicStamp patterns

No changes are made:

ℹ️ .gitignore already contains LogicStamp patterns The following patterns were added/verified: - context.json - context_*.json - *.uif.json - logicstamp.manifest.json

LLM_context.md Generation

stamp init also generates LLM_context.md in your project root:

✅ Created LLM_context.md # If LLM_context.md already exists: ℹ️ LLM_context.md already exists

This file provides guidance for AI assistants on how to understand and work with your LogicStamp context files. It includes information about project structure, context file organization, bundle structure, and interpreting missing dependencies.

Smart Detection in stamp context

The stamp context command includes smart setup management for both .gitignore and LLM_CONTEXT.md with the following behavior:

CI-Friendly Behavior

stamp context is CI-friendly and never prompts. It respects preferences saved in .logicstamp/config.json from stamp init.

  • Never prompts (works in CI/CD environments)
  • Respects preferences from stamp init
  • On first run (no config), defaults to skipping both .gitignore and LLM_CONTEXT.md setup
  • Use --skip-gitignore flag to skip .gitignore setup on a per-run basis

Default Behavior (Non-Interactive)

By default, stamp init is non-interactive because the security scan runs automatically:

  • No prompts are shown
  • All operations are performed automatically
  • Preferences are saved to config
  • Security scan runs by default (v0.3.0+)

To enable interactive mode: Use --no-secure to skip the security scan, which will enable interactive prompts (when running in a TTY environment).

Security Scan (Default Behavior)

By default, stamp init is non-interactive because the security scan runs automatically. This:

Sets up .gitignore patterns

Generates LLM_CONTEXT.md automatically (non-interactive by default)

Runs stamp security scan to scan for secrets (API keys, passwords, tokens)

Scans only: .ts, .tsx, .js, .jsx, and .json files

⚠️ Security Best Practice: Never hardcode secrets (API keys, passwords, tokens) in your source code files. Use environment variables or secret management systems instead.

The security scan helps detect accidental exposure, but secrets should never be committed to version control in the first place.

Note: Use --no-secure to skip the security scan and enable interactive prompts (when running in a TTY environment).

Runs 100% locally — nothing is uploaded or sent anywhere.

When to Use stamp init

Use stamp init when:

  • Setting up LogicStamp in a new project
  • You want explicit control over initialization
  • You want to set up .gitignore before generating context files
  • Non-interactive by default (security scan runs automatically; use --no-secure to enable interactive mode)

You don't need stamp init if:

  • You want stamp context to respect your preferences (CI-friendly, never prompts)
  • Your .gitignore already has the necessary patterns
  • You prefer to manually manage .gitignore

Safety

The stamp init command is:

Idempotent – Safe to run multiple times without duplicating patterns

Non-destructive – Preserves existing .gitignore content

Safe by default – Only adds patterns, never removes anything