Releases: context-hub/generator
1.28.0-beta.1
What's Changed
- Fix config path resolution duplication issue by @butschster in #222
- Fix JSON parsing bug in latest version detection by @butschster in #223
Full Changelog: 1.27.1...1.28.0-beta.1
v1.27.2
What's Changed
- Fix config path resolution duplication issue by @butschster in #222
- Fix JSON parsing bug in latest version detection by @butschster in #223
- Fix Binary Path Detection and Improve Self-Update Functionality by @butschster in #224
Full Changelog: 1.27.1...1.27.2
1.27.1
What's Changed
- Enhance global state directory determination for Windows by @roxblnfk in #214
- feat: Integrate FSPath for path handling in MCP projects by @butschster in #215
Full Changelog: 1.27.0...1.27.1
1.27.0
CTX 1.27.0 Release Notes
We're excited to announce the release of CTX 1.27.0! This version introduces several powerful new features that make it easier to manage multiple projects, deploy CTX in containerized environments, access specialized documentation, and protect sensitive information.
Dynamic Project Switching for MCP Server
CTX now allows you to manage multiple projects and seamlessly switch between them without restarting the MCP server. This is especially valuable for developers who:
- Work on multiple projects simultaneously
- Need to provide context from different codebases to AI assistants
- Want to maintain separate configurations for different projects
New Commands:
ctx project:add
: Register a new project with optional alias and configurationctx project
: Switch between registered projectsctx project:list
: View all registered projects
MCP Server Configuration:
You can now start the MCP server without specifying a project path:
ctx server
When the -c
option is omitted, CTX will use the globally registered projects configuration, allowing you to switch projects on the fly.
Docker-Based CTX Deployment
We've added Docker container support to provide a standardized, reproducible environment for running CTX that works consistently across different systems.
Benefits:
- Cross-platform consistency regardless of host OS
- Simplified deployment with no need to install dependencies on host systems
- Multi-architecture support for both amd64 and arm64
- Easy CI/CD integration
- Isolated environments to run different CTX versions side-by-side
- Container orchestration compatibility
MCP Integration Example:
{
"mcpServers": {
"ctx": {
"command": "docker",
"args": [
"run",
"--rm",
"-i",
"-v", "C:/path/to/project:/workspace",
"contexthub/ctx:latest",
"server",
"-c",
"/workspace"
]
}
}
}
Context7 Documentation Integration
This release introduces two powerful new features for accessing documentation:
1. New docs
Source Type
Access Context7 documentation service directly in your context configurations:
sources:
- type: docs
library: "laravel/docs"
topic: controller
tokens: 600
description: "Laravel controller documentation"
tags: ["laravel", "docs"]
2. New docs-search
Tool
Discover available documentation libraries using the new MCP tool:
- Configurable via
MCP_DOCS_TOOLS_ENABLED
environment variable - Query Context7's search API to find relevant documentation
- Retrieve targeted content with customizable token limits
This integration enables AI assistants to find and access specialized documentation on demand without storing it locally.
Global Exclusion Pattern System
Protect sensitive information with our new global exclusion configuration:
# Global exclusion patterns
exclude:
# File patterns to exclude globally
patterns:
- ".env*"
- "config/secrets.yaml"
- "*.pem"
- "*.key"
# Paths to exclude globally
paths:
- ".secrets/"
- "config/credentials/"
- "node_modules"
- "vendor"
This system prevents sensitive files from being included in any context document through:
- Pattern-based exclusions: Using glob patterns like
**/*.key
,**/.env*
- Path-based exclusions: Exact path or directory exclusions like
node_modules
,.secrets/
Installation
Using bash (Recommended)
curl -sSL https://raw.githubusercontent.com/context-hub/generator/main/download-latest.sh | sh
What's Changed
- feat: Add VariablesConfigMerger to handle variable merging in configuration by @butschster in #198
- fix: Update prompt retrieval method to use only prompts with type prompt by @butschster in #199
- Dynamic Project Switching for MCP Server by @butschster in #203
- Docker-Based CTX Deployment by @butschster in #206
- fix: handle case when no documents are found in configuration by @butschster in #207
- Add Context7 Documentation Source by @butschster in #208
- feat: Enhance import handling and add comprehensive local import tests by @butschster in #209
- feat: Enhance installation script with existing installation check and OS-specific default directories by @butschster in #210
- fix: Load config once before all MCP actions loaded. by @butschster in #213
- Global Exclusion Pattern System by @butschster in #212
Full Changelog: 1.26.0...1.27.0
1.27.0-beta.2
What's Changed
- feat: Add VariablesConfigMerger to handle variable merging in configuration by @butschster in #198
- fix: Update prompt retrieval method to use only prompts with type prompt by @butschster in #199
- Dynamic Project Switching for MCP Server by @butschster in #203
- Docker-Based CTX Deployment by @butschster in #206
- fix: handle case when no documents are found in configuration by @butschster in #207
- Add Context7 Documentation Source by @butschster in #208
- feat: Enhance import handling and add comprehensive local import tests by @butschster in #209
- feat: Enhance installation script with existing installation check and OS-specific default directories by @butschster in #210
- fix: Load config once before all MCP actions loaded. by @butschster in #213
- Global Exclusion Pattern System by @butschster in #212
Full Changelog: 1.26.0...1.27.0-beta.2
1.26.0
CTX 1.26.0 Release Notes 🎉
We're excited to announce version 1.26.0, packed with new features, enhancements, and documentation updates. This release focuses on improved GitLab integration, prompt tagging and filtering, and streamlined CLI interactions for MCP tools.
🚀 New Features
🌟 GitLab Source Integration
The new GitLab source component mirrors the existing GitHub functionality, providing robust integration to fetch code and documentation directly from GitLab repositories.
Read more in a documentation section GitLab Source
Example Configuration:
documents:
- description: Self-hosted GitLab Documentation
outputPath: docs/self-hosted-gitlab.md
sources:
- type: gitlab
description: Self-hosted GitLab Project
repository: group/project
branch: main
server:
url: https://gitlab.test.com
token: ${TEST_GITLAB_TOKEN}
sourcePaths:
- src
filePattern: "*.php"
🔖 Advanced Prompt Tagging and Filtering
Organize and selectively import prompts more efficiently with advanced tagging and filtering capabilities, streamlining your workflow and reducing clutter in your prompt registries.
Read more in a documentation section Prompts Import
Example Configuration:
prompts:
- id: creative-writing
description: "Helps generate creative writing pieces"
tags: ["writing", "creative", "content-generation"]
messages:
- role: user
content: "You are a creative writing assistant..."
-
Prompt Tagging: Ability to assign tags to prompts in the YAML configuration
prompts: - id: creative-writing description: "Helps generate creative writing pieces" tags: ["writing", "creative", "content-generation"]
-
ID-Based Import Filtering: Ability to import specific prompts by their IDs
import: - url: "https://prompts-repository.example.com/prompts.yaml" filter: ids: ["python-helper", "php-debug", "js-refactor"]
-
Tag-Based Import Filtering: Support for filtering by tags with include/exclude logic
import: - path: "./local-prompts.yaml" filter: tags: include: ["coding", "debugging"] exclude: ["advanced"] match: "any" # can be "all" for AND logic
📋 CLI Command for Listing Prompts
Discover and explore available prompts directly from the command line, simplifying prompt management and selection.
Read more in a documentation section Command Reference
CLI Usage Examples:
# List all prompts in table format
ctx prompts:list
# Show detailed information with arguments
ctx prompts:list --detailed
# or
ctx prompts -d
# Filter prompts by tags
ctx prompts:list --tag api --tag documentation
# or
ctx prompts -t api -t documentation
# Exclude prompts with specific tags
ctx prompts:list --exclude-tag experimental
# or
ctx prompts -x experimental
# Filter prompts by ID
ctx prompts:list --id system-prompt --id user-query
# or
ctx prompts -p system-prompt -p user-query
🖥️ CLI Tool Execution
Enhance your development and testing workflow by directly executing MCP tools from the command line, offering interactive prompts and simplified argument validation.
Read more in a documentation section Command Reference
CLI Usage Example:
# List available tools
ctx tool:list
# Run a specific tool interactively
ctx tool:run lint-code
# Run with arguments provided via command line
ctx tool:run lint-code --arg path=src/MyClass.php --arg fix=true
Thank you for using CTX! Your feedback and contributions help us make this tool even better. 🎈
What's Changed
- GitLab Source Component by @butschster in #190
- Modular Configuration Merger System by @butschster in #192
- Add prompt tagging and import filtering system by @butschster in #195
- MCP Tool CLI Commands by @butschster in #196
New Contributors
- @eltociear made their first contribution in #188
Full Changelog: 1.25.0...1.26.0
1.25.0
🧩 1. Import Tools with workingDir
Support
You can now import tools from other YAML files, and CTX will automatically fix the working directory depending on how it's written.
✅ Example: Main config
# main-context.yaml
import:
- path: ./services/service-a/context.yaml
tools:
- id: local-tool
description: "My local tool"
commands:
- cmd: echo
args: ["hello"]
✅ Example: Imported file
# services/service-a/context.yaml
tools:
- id: reset
description: Reset RoadRunner
commands:
- cmd: rr
workingDir: .
args: ["reset"]
After importing, CTX will update workingDir
to:
/your/path/services/service-a
✅ If you use an absolute path, it stays unchanged.
workingDir: /opt/tools
🧠 2. MCP Source Support
You can now get data from MCP servers and use it in your documents. It supports two types of operations:
tool.call
– Run remote toolsresource.read
– Read files or info
✅ Settings config
settings:
mcp:
servers:
github:
command: docker
args:
- run
- "-i"
- "--rm"
- "-e"
- "GITHUB_PAT"
- "ghcr.io/github/github-mcp-server"
env:
GITHUB_PAT: "{{GITHUB_PAT}}"
✅ Document using MCP
documents:
- description: Get GitHub issue
outputPath: github/issue.md
sources:
- type: mcp
server: github
operation:
type: tool.call
name: get_issue
arguments:
owner: context-hub
repo: generator
issue_number: 158
🌐 3. HTTP Tools (Perfect for RAG)
You can now add tools that call HTTP APIs. This helps you build things like search or document storage using external services.
✅ Example tool: Store document
tools:
- id: knowledge-storage
type: http
description: "Save docs externally"
schema:
properties:
document:
type: string
description: "Document to store"
required: [ document ]
requests:
- url: https://my-api.com/store
method: POST
✅ Example tool: Search
tools:
- id: knowledge-search
type: http
description: "Search stored docs"
schema:
properties:
query:
type: string
description: "Your search"
required: [ query ]
requests:
- url: https://my-api.com/search
method: GET
🧱 4. Project Isolation (Multi-Project Setup)
If you work on multiple projects, this helps avoid conflicts. CTX will auto-rename tools, prompts, and resources using project names.
✅ MCP Server Config
{
"mcpServers": {
"common": {
"command": "ctx",
"args": [
"server",
"-c",
"projects/common"
],
"env": {
"MCP_PROJECT_NAME": "common",
"MCP_PROJECT_COMMON": "true"
}
},
"project-1": {
"command": "ctx",
"args": [
"server",
"-c",
"projects/project-1"
],
"env": {
"MCP_PROJECT_NAME": "Project 1"
}
}
}
}
With this, CTX will:
- Add suffixes like
tool_name_Project1
- Prefix descriptions:
[Project 1]
- Change URIs:
ctx://
→project1://
⚠️ WSL ENV Warning
If you’re using WSL, don’t use env:
in config. It doesn’t pass properly from wsl.exe
→ bash. Instead, set variables inside your bash profile or directly in command string.
Bad:
"env": { "X": "123" }
Good (use inline):
"args": [
"bash",
"-c",
"X=123 ctx server -c /path/to/project"
]
📁 5. File Source maxFiles
Now you can limit how many files CTX loads from a folder – great for big directories.
✅ Example: Load only 5 PHP files
documents:
- description: "Limited PHP files"
outputPath: "docs/first-5.md"
sources:
- type: file
sourcePaths: src
filePattern: "*.php"
maxFiles: 5
What's Changed
- feat: added an ability to import tools with workingDir support by @butschster in #163
- Add MCP Source Type by @butschster in #167
- Return Complete ConfigRegistry by @butschster in #169
- feat: enhance logging support by injecting logger into ServerRunner by @butschster in #170
- MCP Project Environment by @MihailDev in #166
- HTTP Tools for MCP Server by @butschster in #171
- Add maxFiles parameter to FileSource by @markinigor in #173
- feat: refactor file handling to use FSPath for temporary file creation by @butschster in #176
- Template-based Prompt Extension System by @butschster in #181
New Contributors
- @MihailDev made their first contribution in #166
Full Changelog: 1.24.1...1.25.0
1.24.1
What's Changed
- Fixed problem with current working dir detection inside custom tool by @butschster in #161
- fix: Fixed current dir with binary detection for self update by @butschster in #162
Full Changelog: 1.24.0...1.24.1
1.24.0
This PR introduces a powerful new way to define and execute tools using JSON Schema. It enables dynamic tool arguments with support for default values, template injection, and conditional inclusion of arguments.
✨ Features
-
JSON Schema Support
Tools can define expected input using JSON Schema, including type definitions, descriptions, and required fields. -
Default Values
Schema properties can include default values, allowing tools to run even when some arguments aren't explicitly provided. -
Template Processing
Use{{argument}}
syntax to inject values intocmd
,args
,env
, orcwd
fields dynamically. -
Validation
Tool arguments are automatically validated against the defined schema before execution. -
Conditional Arguments
Command-line arguments can be conditionally included using thewhen
directive, based on input values. -
Backward Compatible
Existing configurations remain unchanged and functional.
🛠️ Example: Generate Component
tools:
- id: generate-component
description: "Generate a new component"
schema:
type: object
properties:
name:
type: string
description: "Component name"
type:
type: string
description: "Component type"
default: "functional"
required: [name]
commands:
- cmd: node
args: [scripts/generate.js, --name={{name}}, --type={{type}}]
🧪 Example: Database Migration
- id: db-migrate
description: "Run database migrations"
schema:
type: object
properties:
env:
type: string
description: "Environment (local, dev, staging, prod)"
default: "local"
fresh:
type: boolean
description: "Reset the database before migration"
default: false
seed:
type: boolean
description: "Run seeders after migration"
default: false
required: []
⚙️ Example: Conditional Argument
- id: code-quality
description: Run code quality checks
env:
COMPOSER_ALLOW_SUPERUSER: 'true'
commands:
- cmd: composer
args:
- cs-fix
- name: --dry-run
when: "{{dry-run}}"
If dry-run=true
, the --dry-run
flag is added; otherwise, it's skipped.
What's Changed
- Add JSON schema-based tool arguments with defaults and conditional support by @butschster in #159
Full Changelog: 1.23.0...1.24.0
1.23.0
🔄 Platform-Specific Binary Downloads
What's New:
- Automatic platform and architecture detection for the
self-update
command - Downloads the appropriate binary based on user's system (linux/darwin/windows and amd64/arm64)
🔧 Custom Variables in Configuration Files
What's New:
- Define variables once and reference them throughout your configuration
- Support for environment-specific configurations without duplication
Why It's Cool:
- Maintain DRY (Don't Repeat Yourself) configurations
- Easily switch between environments (development, staging, production)
- Create more maintainable and readable configuration files
Example:
variables:
version: 1.0.0
environment: development
project_name: Context Generator
base_path: docs/{{environment}}
documents:
- description: 'API Documentation'
outputPath: {{base_path}}/api/{{project_name}}-{{version}}.md
sources:
- type: file
path: src/api/*.php
- description: 'User Guide'
outputPath: {{base_path}}/guide/{{project_name}}-{{version}}.md
sources:
- type: text
content: |
# {{project_name}} v{{version}}
Environment: {{environment}}
## Getting Started
This guide will help you get started with the {{project_name}}.
🛠️ Custom Tools Framework
What's New:
- Define and execute project-specific tools directly from configuration files
- Support for command chains with arguments and environment variables
- Integrated with the Context Generator CLI
Why It's Cool:
- Standardize project tooling across teams
- Execute complex operations with simple commands
- Automate repetitive tasks specific to your project
Example:
tools:
- id: lint
description: 'Lint and fix code style issues'
type: run
commands:
- cmd: composer
args: ['cs:fix']
- id: test-and-build
description: 'Run tests and build documentation'
type: run
commands:
- cmd: vendor/bin/phpunit
args: ['--testsuite', 'unit']
- cmd: ctx
args: ['generate', '--config=docs.yaml']
env:
CTX_ENV: production
- id: deploy
description: 'Deploy documentation to server'
type: run
commands:
- cmd: rsync
args: ['-avz', 'docs/', 'user@server:/var/www/docs/']
Improvements
🔧 Self-Update Command Fixes
What's New:
- Fixed the "Text file busy" error that occurred when updating the currently running binary
- Implemented robust binary updating system with platform-specific strategies
- Added background scripts that update binaries after the process exits
📊 Generate Command Output Readability
Before:
[INFO] Compiling Project structure overview...
[OK] Document compiled into project-structure.md
[INFO] Compiling Core Interfaces...
[OK] Document compiled into core/interfaces.md
[INFO] Compiling Modifiers System...
[WARNING] Document compiled into modifiers/modifiers-core.md with errors
* Error in FileSource: Some directories or files contain invalid paths
After:
✓ Source Token counter [sources/token-counter.md].......................................................................
✓ Document source renderer [sources/source-renderer.md].................................................................
! Modifiers System [modifiers/modifiers-core.md]........................................................................
✗ Error in FileSource: Some directories or files contain invalid paths:
✓ PHP Content Modifiers [modifiers/php-modifiers.md]....................................................................
! Sanitizer Modifier [modifiers/sanitizer.md]...........................................................................
✗ Error in FileSource: Some directories or files contain invalid paths:
✓ Path Filtering Utilities [utilities/path-filters.md]..................................................................
✓ Tree Building Utilities [utilities/tree-builder.md]...................................................................
🪟 Windows Path Normalization
What's New:
- Enhanced path handling capabilities to better support Windows-style paths
- Improved TreeBuilder components for cross-platform compatibility
What's Changed
- Platform-Specific Binary Downloads by @butschster in #141
- Add support for custom variables in configuration files by @butschster in #144
- Windows path normalization improvements in tree builder by @butschster in #147
- Enhanced Logger Injection with PHP Attributes by @butschster in #148
- Improved Generate Command Output Readability by @butschster in #149
- Git Components Refactoring by @butschster in #151
- Added feature tests for document compiler by @butschster in #155
- Add custom tools configuration and execution support by @butschster in #156
Full Changelog: 1.22.0...1.23.0