TouchFS Context Command

The touchfs context command generates MCP-compliant context from files for LLM content generation. It provides structured file content collection with metadata that follows Model Context Protocol principles.

Usage

touchfs context [options] [path]

If no path is provided, uses the current directory.

Options

Output Format

The command generates a JSON structure containing:

  1. Version Information:

  2. File Resources:

  3. Collection Metadata:

Common Use Cases

Basic Context Generation

# Generate context from current directory
touchfs context

# Generate from specific directory
touchfs context /path/to/project

Filtered Context Generation

# Include only Python and documentation files
touchfs context \
  --include "*.py" \
  --include "*.md" \
  --exclude "tests/*"

Token Management

# Limit context size for large projects
touchfs context \
  --max-tokens 8000 \
  --exclude "*.min.js" \
  --exclude "vendor/*"

Context Preview

# List files that would be included
touchfs context --list-files

# Preview with debug information
touchfs context --debug-stdout --list-files

Use Cases for Context Generation

Development Support

Content Generation

Project Analysis

Error Handling

Integration with Other Commands

The context command supports other TouchFS commands by:

  1. Mount Command: Provides context for filesystem generation
  2. Generate Command: Supplies context for content generation
  3. Touch Command: Informs filename suggestions and file organization

See Also