-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Open
Description
Summary
Allow users to configure the CLI to use custom GitHub forks of claude-code-templates by setting environment variables, enabling organizations and individuals to maintain their own component repositories.
Use Case
- Enterprise/Organization Use: Companies can maintain private forks with custom agents, commands, and MCPs tailored to their workflows
- Community Extensions: Contributors can test their components before submitting PRs
- Regional Customization: Enable localized or specialized component collections
- Development/Testing: Easier testing of new components during development
Proposed Solution
Add support for the following environment variables:
| Variable | Description | Default |
|---|---|---|
CCT_REPO_OWNER |
GitHub owner/organization | davila7 |
CCT_REPO_NAME |
Repository name | claude-code-templates |
CCT_REPO_BRANCH |
Branch name | main |
CCT_COMPONENTS_PATH |
Path to components directory | cli-tool/components |
Example Usage
# Install agent from custom fork
CCT_REPO_OWNER=myorg CCT_REPO_BRANCH=develop npx claude-code-templates --agent my-custom-agent
# Use organization's private components
export CCT_REPO_OWNER=my-company
export CCT_REPO_NAME=claude-code-templates-enterprise
npx claude-code-templates --agent security-auditorScope and Limitations
This implementation is GitHub-specific. The CLI uses:
raw.githubusercontent.com- For downloading component filesapi.github.com- For listing directory contents (discovering available components)
Support for other Git platforms (GitLab, Bitbucket, self-hosted) would require additional work due to different API endpoints.
Implementation
I have a working implementation ready in my fork:
- Branch: https://github.com/dobachi/claude-code-templates/tree/feature/custom-repository-support
- Commit: dobachi@f12be2a
Files Modified
| File | Changes |
|---|---|
src/file-operations.js |
Add GITHUB_CONFIG with env var support |
src/index.js |
Add buildGitHubUrl and buildGitHubApiUrl helpers, update all installIndividual* functions |
src/sdk/global-agent-manager.js |
Same configuration pattern |
Key Points
- Replaced all hardcoded GitHub URLs with configurable values
- Added helper functions for consistent URL generation
- Full backward compatibility (defaults to current behavior)
- No breaking changes to existing API
- Simple implementation using only environment variables
Next Steps
I will submit a PR referencing this issue once it's created. Thank you for considering this feature!
Metadata
Metadata
Assignees
Labels
No labels