Skip to content

Dynamic template fetching from GitHub repos#279

Merged
ejacquier merged 112 commits intomainfrom
feature/dynamic-templates
Feb 26, 2026
Merged

Dynamic template fetching from GitHub repos#279
ejacquier merged 112 commits intomainfrom
feature/dynamic-templates

Conversation

@ejacquier
Copy link
Contributor

Dynamic template fetching from GitHub repos

Summary

  • Templates are no longer embedded in the CLI. They are standalone CRE projects hosted in GitHub repos, discovered via template.yaml metadata, downloaded as tarballs, and extracted into the user's workspace. No CLI release needed to add or update templates.
  • Two built-in Hello World templates (Go + TypeScript) remain embedded as offline fallbacks.
  • New cre templates list|add|remove commands to manage template repository sources, stored in ~/.cre/template.yaml.
  • template.yaml standard defines template metadata (kind, id, title, language, category, tags, capabilities, networks, workflows, projectDir, postInit, exclude).
  • Templates with projectDir set are treated as complete CRE projects — extracted as-is, skipping config generation and workflow renaming. Go templates with projectDir run go mod tidy post-scaffold.
  • Template list (1hr TTL) and tarballs (24hr TTL) are cached at ~/.cre/template-cache/. cre init --refresh bypasses cache.
  • Interactive Bubble Tea wizard for template selection with search, language filtering, and network RPC URL prompts.
  • CLI prompt helpers (ui.Confirm, ui.Input, ui.Select, ui.InputForm) consolidated from raw huh calls across all commands.

  - Create internal/ui/ package with centralized Lipgloss styles (styles.go)
  - Add output helpers for consistent styling: Title, Box, Success, Dim, etc.
  - Implement Bubble Tea spinner with reference counting for async operations
  - Add GlobalSpinner singleton for seamless spinner across CLI lifecycle
  - Update PersistentPreRunE to show spinner during initialization
  - Migrate cre init and cre whoami to use shared UI package
  - Add spinner during file generation (copying, generating templates, contracts)
  - Show spinner during Go dependencies installation
  - Display dependencies in styled box after spinner completes
  - Fix Next steps box spacing and formatting
  - Refactor initializeGoModule to return deps instead of printing
  - Add styled template functions (styleTitle, styleSection, styleCommand, styleDim, styleSuccess, styleCode)
  - Update help template to use Lipgloss styling
  - Style section headers, command names, tips, and URLs
  - Improve visual hierarchy and readability
  - Add complete Blocks palette constants (Gray, Blue, Green, Red, Orange, Yellow, Teal, Purple)
  - Use high-contrast colors for dark terminal readability
  - Style titles/commands with Blue 400-500 for visibility
  - Style secondary info with Gray 500 (dimmed)
  - Create custom Huh theme with Blocks colors for forms
  - Update spinner to use Blue 500
  - Add styled title and welcome message using Chainlink theme
  - Add Bubble Tea spinner with progress states throughout auth flow:
    - Preparing authentication
    - Opening browser
    - Waiting for authentication
    - Exchanging authorization code
    - Saving credentials
  - Show styled URL fallback when browser cannot open automatically
  - Display success message with next steps in branded box
  - Update spinner message during org membership retry flow
  - Update tests to include spinner in handler instantiations
  - Add SilenceErrors: true to root command to disable Cobra's default error output
  - Display all user-facing errors with styled ui.Error() in Execute()
  - Errors now show with red color and ✗ prefix consistent with Chainlink theme
  - Internal debug logging via zerolog remains unchanged
  - Add SilenceErrors: true to disable Cobra's default error output
  - Display errors with styled ui.Error() (red with ✗ prefix)
  - Set SilenceUsage in PersistentPreRunE to hide usage for runtime errors
  - Keep usage/suggestions visible for command typos and flag errors
    - Replaced prompt.YesNoPrompt with huh.NewConfirm forms
    - Removed stdin io.Reader parameter
  2. Updated cmd/creinit/creinit.go:
    - Updated call sites to match new function signatures
  3. Updated cmd/secrets/common/handler.go:
    - Replaced ~25 fmt.Print* calls with ui.* functions
  4. Updated cmd/workflow/simulate/telemetry_writer.go:
    - Replaced fmt.Printf with ui.Printf
    - Removed unused fmt import
  5. Deleted internal/prompt/ directory:
    - Removed entire old promptui-based package
  6. Cleaned cmd/common/utils.go:
    - Removed unused MustGetUserInputWithPrompt function
    - Removed unused bufio and errors imports
  7. Dependencies cleaned (go mod tidy):
    - Removed github.com/manifoldco/promptui
    - Removed github.com/chzyer/readline
@github-actions
Copy link

⚠️ Abigen Fork Check - Update Available

The forked abigen package is outdated and may be missing important updates.

Version Value
Current Fork v1.16.0
Latest Upstream v1.17.0

Action Required

  1. Review abigen changes in upstream (only the accounts/abi/bind directory matters)
  2. Compare with our fork in cmd/generate-bindings/bindings/abigen/
  3. If relevant changes exist, sync them and update FORK_METADATA.md
  4. If no abigen changes, just update the version in FORK_METADATA.md to v1.17.0

Files to Review

  • cmd/generate-bindings/bindings/abigen/bind.go
  • cmd/generate-bindings/bindings/abigen/bindv2.go
  • cmd/generate-bindings/bindings/abigen/template.go

⚠️ Note to PR author: This is not something you need to fix. The Platform Expansion team is responsible for maintaining the abigen fork.

cc @smartcontractkit/bix-framework

@github-actions
Copy link

🚀 Preview Build Artifacts

You can download the preview builds for this PR from the following URL:

https://github.com/smartcontractkit/cre-cli/actions/runs/22357105959

Note: These are preview builds and are not signed.

@github-actions
Copy link

⚠️ Abigen Fork Check - Update Available

The forked abigen package is outdated and may be missing important updates.

Version Value
Current Fork v1.16.0
Latest Upstream v1.17.0

Action Required

  1. Review abigen changes in upstream (only the accounts/abi/bind directory matters)
  2. Compare with our fork in cmd/generate-bindings/bindings/abigen/
  3. If relevant changes exist, sync them and update FORK_METADATA.md
  4. If no abigen changes, just update the version in FORK_METADATA.md to v1.17.0

Files to Review

  • cmd/generate-bindings/bindings/abigen/bind.go
  • cmd/generate-bindings/bindings/abigen/bindv2.go
  • cmd/generate-bindings/bindings/abigen/template.go

⚠️ Note to PR author: This is not something you need to fix. The Platform Expansion team is responsible for maintaining the abigen fork.

cc @smartcontractkit/bix-framework

tarcisiozf
tarcisiozf previously approved these changes Feb 24, 2026
* Always track flag --template even when not provided

* linter fixes
@github-actions
Copy link

⚠️ Abigen Fork Check - Update Available

The forked abigen package is outdated and may be missing important updates.

Version Value
Current Fork v1.16.0
Latest Upstream v1.17.0

Action Required

  1. Review abigen changes in upstream (only the accounts/abi/bind directory matters)
  2. Compare with our fork in cmd/generate-bindings/bindings/abigen/
  3. If relevant changes exist, sync them and update FORK_METADATA.md
  4. If no abigen changes, just update the version in FORK_METADATA.md to v1.17.0

Files to Review

  • cmd/generate-bindings/bindings/abigen/bind.go
  • cmd/generate-bindings/bindings/abigen/bindv2.go
  • cmd/generate-bindings/bindings/abigen/template.go

⚠️ Note to PR author: This is not something you need to fix. The Platform Expansion team is responsible for maintaining the abigen fork.

cc @smartcontractkit/bix-framework

@ejacquier ejacquier enabled auto-merge February 24, 2026 17:08
tarcisiozf
tarcisiozf previously approved these changes Feb 24, 2026
@github-actions
Copy link

🚀 Preview Build Artifacts

You can download the preview builds for this PR from the following URL:

https://github.com/smartcontractkit/cre-cli/actions/runs/22361350676

Note: These are preview builds and are not signed.

@github-actions
Copy link

🚀 Preview Build Artifacts

You can download the preview builds for this PR from the following URL:

https://github.com/smartcontractkit/cre-cli/actions/runs/22361580113

Note: These are preview builds and are not signed.

@ejacquier ejacquier disabled auto-merge February 24, 2026 17:19
@github-actions
Copy link

⚠️ Abigen Fork Check - Update Available

The forked abigen package is outdated and may be missing important updates.

Version Value
Current Fork v1.16.0
Latest Upstream v1.17.0

Action Required

  1. Review abigen changes in upstream (only the accounts/abi/bind directory matters)
  2. Compare with our fork in cmd/generate-bindings/bindings/abigen/
  3. If relevant changes exist, sync them and update FORK_METADATA.md
  4. If no abigen changes, just update the version in FORK_METADATA.md to v1.17.0

Files to Review

  • cmd/generate-bindings/bindings/abigen/bind.go
  • cmd/generate-bindings/bindings/abigen/bindv2.go
  • cmd/generate-bindings/bindings/abigen/template.go

⚠️ Note to PR author: This is not something you need to fix. The Platform Expansion team is responsible for maintaining the abigen fork.

cc @smartcontractkit/bix-framework

@github-actions
Copy link

🚀 Preview Build Artifacts

You can download the preview builds for this PR from the following URL:

https://github.com/smartcontractkit/cre-cli/actions/runs/22362420855

Note: These are preview builds and are not signed.

@ejacquier ejacquier enabled auto-merge February 24, 2026 18:15
@github-actions
Copy link

⚠️ Abigen Fork Check - Update Available

The forked abigen package is outdated and may be missing important updates.

Version Value
Current Fork v1.16.0
Latest Upstream v1.17.0

Action Required

  1. Review abigen changes in upstream (only the accounts/abi/bind directory matters)
  2. Compare with our fork in cmd/generate-bindings/bindings/abigen/
  3. If relevant changes exist, sync them and update FORK_METADATA.md
  4. If no abigen changes, just update the version in FORK_METADATA.md to v1.17.0

Files to Review

  • cmd/generate-bindings/bindings/abigen/bind.go
  • cmd/generate-bindings/bindings/abigen/bindv2.go
  • cmd/generate-bindings/bindings/abigen/template.go

⚠️ Note to PR author: This is not something you need to fix. The Platform Expansion team is responsible for maintaining the abigen fork.

cc @smartcontractkit/bix-framework

@github-actions
Copy link

🚀 Preview Build Artifacts

You can download the preview builds for this PR from the following URL:

https://github.com/smartcontractkit/cre-cli/actions/runs/22397868363

Note: These are preview builds and are not signed.

@tarcisiozf tarcisiozf disabled auto-merge February 26, 2026 11:28
@github-actions
Copy link

🚀 Preview Build Artifacts

You can download the preview builds for this PR from the following URL:

https://github.com/smartcontractkit/cre-cli/actions/runs/22440089666

Note: These are preview builds and are not signed.

@ejacquier ejacquier added this pull request to the merge queue Feb 26, 2026
Merged via the queue into main with commit 6b12cba Feb 26, 2026
22 checks passed
@ejacquier ejacquier deleted the feature/dynamic-templates branch February 26, 2026 13:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants