feat: Add GitHub template support for stack deployments#1544
Merged
martin-helmich merged 5 commits intomasterfrom Jan 29, 2026
Merged
feat: Add GitHub template support for stack deployments#1544martin-helmich merged 5 commits intomasterfrom
martin-helmich merged 5 commits intomasterfrom
Conversation
9bfb21b to
50b25f0
Compare
Add support for deploying stacks from GitHub template repositories. Template names like "mittwald/n8n" are automatically converted to "mittwald/stack-template-n8n" repositories. Fetches both docker-compose.yml and .env files from the main branch. Features: - New --from-template flag (mutually exclusive with --compose-file) - Custom error types for better error handling (TemplateFileNotFoundError, GitHubRateLimitError, TemplateNetworkError) - Environment variable precedence: template .env < process.env < --env-file - Comprehensive unit tests with axios mocking 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <[email protected]>
50b25f0 to
6fb6e39
Compare
…e stack ID Add support for filling missing environment variables from templates using __PROMPT__ and __GENERATE__ placeholders, retrieve existing stack state before deploying, and auto-resolve stack ID from project context. Co-Authored-By: Claude Opus 4.5 <[email protected]>
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adds support for deploying container stacks directly from GitHub template repositories using a new --from-template flag. Users can now quickly deploy pre-configured applications without managing local docker-compose files.
Changes:
- Introduces template loading functionality with GitHub repository fetching and environment variable handling
- Adds a custom retrieve function to automatically detect single stacks in a project context
- Updates the deploy command to support both local file and template-based deployments
Reviewed changes
Copilot reviewed 7 out of 7 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| src/lib/resources/stack/template-loader.ts | Core template loading logic with GitHub API integration and error handling |
| src/lib/resources/stack/template-loader.test.ts | Comprehensive test suite for template loading functionality |
| src/lib/resources/stack/flags.ts | Adds automatic stack ID retrieval for single-stack projects |
| src/lib/resources/stack/env.ts | Extends environment handling with prompt and generate placeholders |
| src/lib/context/FlagSetBuilder.ts | Adds retrieveFunction option to flag set builder |
| src/commands/stack/deploy.tsx | Integrates template loading into deploy command with new flag |
| docs/stack.md | Documents the new --from-template flag and its behavior |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds support for deploying stacks directly from GitHub template repositories using the new
--from-templateflag.This enables users to quickly deploy pre-configured application stacks without manually managing docker-compose files locally. Template names like
mittwald/n8nautomatically resolve to the correspondingmittwald/stack-template-n8nrepository.What This Enables
Quick Stack Deployment
Deploy popular applications instantly from curated templates:
Template Repository Naming
Template names follow a simple convention:
mittwald/n8ngithub.com/mittwald/stack-template-n8nEnvironment Configuration
Templates can include default environment variables via
.envfiles, which can be overridden:Environment Variable Priority (from lowest to highest):
.envfile (if present)--env-fileflagBehavior
docker-compose.ymland optional.envfrom the template repository'smainbranch--compose-fileflag (prevents accidental mixing of local and remote sources)Use Cases
🤖 Generated with Claude Code