Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
21 commits
Select commit Hold shift + click to select a range
070320f
feat: start abstracting executors
shyim Mar 3, 2026
52ab012
feat: enhance executor initialization and add compatibility date checks
shyim Mar 3, 2026
86fd8b9
fix: remove duplicate import of os/exec in project.go
shyim Mar 3, 2026
c9e3af4
feat: devui
shyim Mar 6, 2026
00ba517
refactor
shyim Mar 6, 2026
2c7a5f7
feat: enhance devtui with improved layout and styling, remove obsolet…
shyim Mar 6, 2026
1731368
feat: set default username and improve style rendering in devtui
shyim Mar 6, 2026
1e23377
feat: implement WithEnv method for executors to manage environment va…
shyim Mar 6, 2026
efc7106
Merge remote-tracking branch 'origin/main' into feat/dev-mode
shyim Mar 9, 2026
c9ac071
feat: Add compatibility check for development mode based on compatibi…
shyim Mar 10, 2026
e82d397
feat: Adjust overlay rendering and footer positioning for improved UI…
shyim Mar 10, 2026
8a312be
feat: Enhance rendering functions for improved layout and padding in …
shyim Mar 10, 2026
82344d1
Merge remote-tracking branch 'origin/main' into feat/dev-mode
shyim Mar 10, 2026
fb245bc
feat: let the cli manage compose file
shyim Mar 10, 2026
858ae7d
feat: update compose file header to include documentation link
shyim Mar 10, 2026
a834d59
feat: refactor package fetching methods for improved clarity and cons…
shyim Mar 10, 2026
8eb8ab7
feat: simplify comments in executor and config files for clarity
shyim Mar 10, 2026
18ce915
feat: remove redundant comments for improved code clarity
shyim Mar 10, 2026
d7f336f
feat: remove unnecessary whitespace in project_create.go
shyim Mar 10, 2026
e4f605a
feat: add shopware PaaS application template and update command flags
shyim Mar 11, 2026
20525ea
feat: make overlay buffer dynamic based on terminal height
shyim Mar 12, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 8 additions & 4 deletions cmd/project/ci.go
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@ import (
"github.com/shopware/shopware-cli/internal/extension"
"github.com/shopware/shopware-cli/internal/mjml"
"github.com/shopware/shopware-cli/internal/packagist"
"github.com/shopware/shopware-cli/internal/phpexec"
"github.com/shopware/shopware-cli/internal/shop"
"github.com/shopware/shopware-cli/logging"
)
Expand Down Expand Up @@ -62,6 +61,11 @@ var projectCI = &cobra.Command{
// Remove annoying cache invalidation errors while asset install
_ = os.Setenv("SHOPWARE_SKIP_ASSET_INSTALL_CACHE_INVALIDATION", "1")

cmdExecutor, err := resolveExecutor(cmd)
if err != nil {
return err
}

shopCfg, err := shop.ReadConfig(cmd.Context(), projectConfigPath, true)
if err != nil {
return err
Expand Down Expand Up @@ -99,7 +103,7 @@ var projectCI = &cobra.Command{

composerInstallSection := ci.Default.Section(cmd.Context(), "Composer Installation")

composer := phpexec.ComposerCommand(cmd.Context(), composerFlags...)
composer := cmdExecutor.ComposerCommand(cmd.Context(), composerFlags...)
composer.Dir = args[0]
composer.Stdin = os.Stdin
composer.Stdout = os.Stdout
Expand Down Expand Up @@ -214,7 +218,7 @@ var projectCI = &cobra.Command{

warumupSection := ci.Default.Section(cmd.Context(), "Warming up container cache")

if err := runTransparentCommand(phpexec.PHPCommand(cmd.Context(), path.Join(args[0], "bin", "ci"), "--version")); err != nil { //nolint: gosec
if err := runTransparentCommand(cmdExecutor.PHPCommand(cmd.Context(), path.Join(args[0], "bin", "ci"), "--version")); err != nil { //nolint: gosec
return fmt.Errorf("failed to warmup container cache (php bin/ci --version): %w", err)
}

Expand All @@ -229,7 +233,7 @@ var projectCI = &cobra.Command{
}
}

if err := runTransparentCommand(phpexec.PHPCommand(cmd.Context(), path.Join(args[0], "bin", "ci"), "asset:install")); err != nil { //nolint: gosec
if err := runTransparentCommand(cmdExecutor.PHPCommand(cmd.Context(), path.Join(args[0], "bin", "ci"), "asset:install")); err != nil { //nolint: gosec
return fmt.Errorf("failed to install assets (php bin/ci asset:install): %w", err)
}
}
Expand Down
23 changes: 23 additions & 0 deletions cmd/project/executor.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package project

import (
"github.com/spf13/cobra"

"github.com/shopware/shopware-cli/internal/executor"
"github.com/shopware/shopware-cli/internal/shop"
)

// resolveExecutor returns the Executor for the current environment.
func resolveExecutor(cmd *cobra.Command) (executor.Executor, error) {
cfg, err := shop.ReadConfig(cmd.Context(), projectConfigPath, true)
if err != nil {
return nil, err
}

envCfg, err := cfg.ResolveEnvironment(environmentName)
if err != nil {
return nil, err
}

return executor.New(envCfg, cfg)
}
9 changes: 7 additions & 2 deletions cmd/project/platform.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ import (
"github.com/spf13/cobra"

"github.com/shopware/shopware-cli/internal/asset"
"github.com/shopware/shopware-cli/internal/executor"
"github.com/shopware/shopware-cli/internal/extension"
"github.com/shopware/shopware-cli/internal/phpexec"
"github.com/shopware/shopware-cli/internal/shop"
"github.com/shopware/shopware-cli/logging"
)
Expand Down Expand Up @@ -89,7 +89,12 @@ func filterAndWritePluginJson(cmd *cobra.Command, projectRoot string, shopCfg *s
}

func filterAndGetSources(cmd *cobra.Command, projectRoot string, shopCfg *shop.Config) ([]asset.Source, error) {
sources, err := extension.DumpAndLoadAssetSourcesOfProject(phpexec.AllowBinCI(cmd.Context()), projectRoot, shopCfg)
cmdExecutor, err := resolveExecutor(cmd)
if err != nil {
return nil, err
}

sources, err := extension.DumpAndLoadAssetSourcesOfProject(executor.AllowBinCI(cmd.Context()), projectRoot, shopCfg, cmdExecutor.ConsoleCommand)
if err != nil {
return nil, err
}
Expand Down
6 changes: 5 additions & 1 deletion cmd/project/project.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,10 @@ import (
"github.com/shopware/shopware-cli/internal/shop"
)

var projectConfigPath string
var (
projectConfigPath string
environmentName string
)

var projectRootCmd = &cobra.Command{
Use: "project",
Expand All @@ -16,4 +19,5 @@ var projectRootCmd = &cobra.Command{
func Register(rootCmd *cobra.Command) {
rootCmd.AddCommand(projectRootCmd)
projectRootCmd.PersistentFlags().StringVar(&projectConfigPath, "project-config", shop.DefaultConfigFileName(), "Path to config")
projectRootCmd.PersistentFlags().StringVarP(&environmentName, "env", "e", "", "Target environment name")
}
11 changes: 8 additions & 3 deletions cmd/project/project_admin_build.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import (

"github.com/spf13/cobra"

"github.com/shopware/shopware-cli/internal/executor"
"github.com/shopware/shopware-cli/internal/extension"
"github.com/shopware/shopware-cli/internal/phpexec"
"github.com/shopware/shopware-cli/internal/shop"
"github.com/shopware/shopware-cli/logging"
)
Expand Down Expand Up @@ -34,9 +34,14 @@ var projectAdminBuildCmd = &cobra.Command{
return err
}

cmdExecutor, err := resolveExecutor(cmd)
if err != nil {
return err
}

logging.FromContext(cmd.Context()).Infof("Looking for extensions to build assets in project")

if err := runTransparentCommand(commandWithRoot(phpexec.ConsoleCommand(phpexec.AllowBinCI(cmd.Context()), "feature:dump"), projectRoot)); err != nil {
if err := runTransparentCommand(commandWithRoot(cmdExecutor.ConsoleCommand(executor.AllowBinCI(cmd.Context()), "feature:dump"), projectRoot)); err != nil {
return err
}

Expand Down Expand Up @@ -69,7 +74,7 @@ var projectAdminBuildCmd = &cobra.Command{
return nil
}

return runTransparentCommand(commandWithRoot(phpexec.ConsoleCommand(cmd.Context(), "assets:install"), projectRoot))
return runTransparentCommand(commandWithRoot(cmdExecutor.ConsoleCommand(cmd.Context(), "assets:install"), projectRoot))
},
}

Expand Down
10 changes: 7 additions & 3 deletions cmd/project/project_admin_watch.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (

"github.com/shopware/shopware-cli/internal/extension"
"github.com/shopware/shopware-cli/internal/npm"
"github.com/shopware/shopware-cli/internal/phpexec"
"github.com/shopware/shopware-cli/internal/shop"
)

Expand All @@ -36,11 +35,16 @@ var projectAdminWatchCmd = &cobra.Command{
return err
}

cmdExecutor, err := resolveExecutor(cmd)
if err != nil {
return err
}

if err := filterAndWritePluginJson(cmd, projectRoot, shopCfg); err != nil {
return err
}

if err := runTransparentCommand(commandWithRoot(phpexec.ConsoleCommand(cmd.Context(), "feature:dump"), projectRoot)); err != nil {
if err := runTransparentCommand(commandWithRoot(cmdExecutor.ConsoleCommand(cmd.Context(), "feature:dump"), projectRoot)); err != nil {
return err
}

Expand Down Expand Up @@ -68,7 +72,7 @@ var projectAdminWatchCmd = &cobra.Command{
}
}

if err := runTransparentCommand(commandWithRoot(phpexec.ConsoleCommand(cmd.Context(), "framework:schema", "-s", "entity-schema", path.Join(mockDirectory, "entity-schema.json")), projectRoot)); err != nil {
if err := runTransparentCommand(commandWithRoot(cmdExecutor.ConsoleCommand(cmd.Context(), "framework:schema", "-s", "entity-schema", path.Join(mockDirectory, "entity-schema.json")), projectRoot)); err != nil {
return err
}

Expand Down
2 changes: 1 addition & 1 deletion cmd/project/project_autofix_composer.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ var projectAutofixComposerCmd = &cobra.Command{
_ = spinner.New().Context(ctx).Title("Fetching packages").Run()
}()

packagistResponse, err := packagist.GetPackages(cmd.Context(), token)
packagistResponse, err := packagist.GetAvailablePackagesFromShopwareStore(cmd.Context(), token)

cancel()

Expand Down
9 changes: 1 addition & 8 deletions cmd/project/project_config_init.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,9 @@ package project

import (
"fmt"
"os"

"charm.land/huh/v2"
"github.com/spf13/cobra"
"gopkg.in/yaml.v3"

"github.com/shopware/shopware-cli/internal/compatibility"
"github.com/shopware/shopware-cli/internal/shop"
Expand All @@ -30,12 +28,7 @@ var projectConfigInitCmd = &cobra.Command{
return err
}

content, err := yaml.Marshal(config)
if err != nil {
return err
}

if err := os.WriteFile(".shopware-project.yml", content, os.ModePerm); err != nil {
if err := shop.WriteConfig(config, "."); err != nil {
return err
}

Expand Down
15 changes: 12 additions & 3 deletions cmd/project/project_console.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"github.com/spf13/cobra"

"github.com/shopware/shopware-cli/internal/extension"
"github.com/shopware/shopware-cli/internal/phpexec"
"github.com/shopware/shopware-cli/internal/shop"
)

Expand All @@ -26,7 +25,12 @@ var projectConsoleCmd = &cobra.Command{
return nil, cobra.ShellCompDirectiveDefault
}

parsedCommands, err := shop.GetConsoleCompletion(cmd.Context(), projectRoot)
exec, err := resolveExecutor(cmd)
if err != nil {
return nil, cobra.ShellCompDirectiveDefault
}

parsedCommands, err := shop.GetConsoleCompletion(cmd.Context(), projectRoot, exec.ConsoleCommand)
if err != nil {
return nil, cobra.ShellCompDirectiveDefault
}
Expand Down Expand Up @@ -79,7 +83,12 @@ var projectConsoleCmd = &cobra.Command{
return err
}

consoleCmd := phpexec.ConsoleCommand(cmd.Context(), args...)
exec, err := resolveExecutor(cmd)
if err != nil {
return err
}

consoleCmd := exec.ConsoleCommand(cmd.Context(), args...)
consoleCmd.Dir = projectRoot
consoleCmd.Stdin = cmd.InOrStdin()
consoleCmd.Stdout = cmd.OutOrStdout()
Expand Down
Loading