Open Source Platform for DTC, B2B Commerce, Marketplaces & Omnichannel. REST APIs, TypeScript SDKs, and production-ready Next.js storefront. Self-host it. Own your data. No vendor lock-in. Zero platform fees.
Ruby b2b-commercee-commerceecommerceecommerce-apiecommerce-frameworkecommerce-platformheadlessheadless-commerceheadless-ecommercemarketplacemulti-tenantmulti-vendormulti-vendor-ecommerceopen-sourcespree-commerce
import type { Command } from 'commander'
import { detectProject } from '../context.js'
import { dockerComposeExecOrRun } from '../docker.js'
// Universal escape hatch: run an arbitrary command inside the web container.
// Anything not pre-wrapped by another `spree` command can be reached via this.
// spree exec ls -la
// spree exec bash
// spree exec env | sort
export function registerExecCommand(program: Command): void {
program
.command('exec')
.description('Run an arbitrary command inside the web container')
.argument('<command...>', 'command and arguments to run')
.allowUnknownOption(true)
.passThroughOptions(true)
.action(async (command: string[]) => {
const ctx = detectProject()
await dockerComposeExecOrRun(command, ctx.projectDir)
})
}