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.
touchfs context [options] [path]
If no path is provided, uses the current directory.
--max-tokens
, -m
: Maximum number of tokens to include in context
# Example: Limit context size
touchfs context --max-tokens 4000
--exclude
, -e
: Glob patterns to exclude (can be specified multiple times)
# Example: Exclude specific patterns
touchfs context \
--exclude "*.pyc" \
--exclude "node_modules/*" \
--exclude ".git/*"
--include
, -i
: Glob patterns to include (can be specified multiple times)
# Example: Only include specific files
touchfs context \
--include "*.py" \
--include "*.md"
--debug-stdout
: Enable debug output to stdout
# Example: Debug context generation
touchfs context --debug-stdout
--list-files
, -l
: Only list file paths that would be included
# Example: Preview included files
touchfs context --list-files
The command generates a JSON structure containing:
Version Information:
File Resources:
Collection Metadata:
# Generate context from current directory
touchfs context
# Generate from specific directory
touchfs context /path/to/project
# Include only Python and documentation files
touchfs context \
--include "*.py" \
--include "*.md" \
--exclude "tests/*"
# Limit context size for large projects
touchfs context \
--max-tokens 8000 \
--exclude "*.min.js" \
--exclude "vendor/*"
# List files that would be included
touchfs context --list-files
# Preview with debug information
touchfs context --debug-stdout --list-files
The context command supports other TouchFS commands by: