Skip to content

spin new -E and spin plugins -E#3509

Merged
itowlson merged 2 commits into
spinframework:mainfrom
itowlson:templates-env-scoped
May 14, 2026
Merged

spin new -E and spin plugins -E#3509
itowlson merged 2 commits into
spinframework:mainfrom
itowlson:templates-env-scoped

Conversation

@itowlson
Copy link
Copy Markdown
Collaborator

@itowlson itowlson commented May 14, 2026

Fixes #3494

This adds:

  • spin new -E - looks for the template in the repo pointed to by the given environment
  • spin plugins install -E - install the plugins suggested in the given environment, or the environment for the current app if -E with no env name
  • spin plugins list -E - list the plugins suggested in the given environment (again default to current app)

Testing things I have to remove:

  • The fake local env file Done
  • Interpreting the -E as a file ref instead of a catalogue ref Now defaults to catalogue ref. Use https: prefix to interpret as URL, file: prefix for file path

Need:

  • A way for env authors to test against a local file or a GH fork -E file:foo.toml / -E https://example.com/foo.toml
  • A way to view and install the env plugins if you don't want to do so at spin new time Done, at least I think it's done, my brain is fried
  • Define --accept-defaults behaviour when plugins are in play --accept-defaults will NOT suppress the plugin install prompt
  • @kate-goldenring has reported seeing it offering to install already-installed plugins but I cannot reproduce this (and cannot see a code path that could open it up)

Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson
Copy link
Copy Markdown
Collaborator Author

Sorry I thought I had clippied this. I have stuff going on which mean I have uncommitted stuff in my working copy, so I will fix the lints in the morning along with those.

@itowlson itowlson force-pushed the templates-env-scoped branch 2 times, most recently from 292ad58 to a389625 Compare May 14, 2026 20:42
@itowlson itowlson force-pushed the templates-env-scoped branch from a389625 to f2b1b72 Compare May 14, 2026 21:09
@itowlson itowlson marked this pull request as ready for review May 14, 2026 21:09
@itowlson
Copy link
Copy Markdown
Collaborator Author

For my testing I have used https://raw.githubusercontent.com/itowlson/spin/4f12a8b60dd5d66ed79df89e50fddf00f18519c3/target-envs/env-mc-envface.toml (note this is removed from the PR so you will need to address it at that specific commit).

@itowlson itowlson changed the title spin new -E spin new -E and spin plugins -E May 14, 2026
Comment thread src/commands/plugins.rs Outdated
Comment thread src/commands/plugins.rs Outdated
Comment thread src/commands/plugins.rs
Comment thread crates/environments/src/environment/env_loader.rs Outdated
Comment thread crates/plugins/src/manager.rs Outdated
Signed-off-by: itowlson <ivan.towlson@fermyon.com>
@itowlson itowlson force-pushed the templates-env-scoped branch from f2b1b72 to f36d746 Compare May 14, 2026 22:32
@itowlson itowlson requested a review from fibonacci1729 May 14, 2026 22:33
Copy link
Copy Markdown
Collaborator

@fibonacci1729 fibonacci1729 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this! Works great for me.

@itowlson itowlson merged commit 96cd7e7 into spinframework:main May 14, 2026
17 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Target environments: suggest templates and plugins

2 participants