@atlashub/smartstack-cli 4.61.0 → 4.62.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -129971,46 +129971,57 @@ tmuxCommand.command("status").description("Show WSL development environment stat
129971
129971
  var import_child_process12 = require("child_process");
129972
129972
  var import_path18 = require("path");
129973
129973
  var import_fs_extra16 = __toESM(require_lib());
129974
- function checkDocker() {
129974
+ function checkEngine(name) {
129975
129975
  try {
129976
- const version2 = (0, import_child_process12.spawnSync)("docker", ["--version"], {
129976
+ const version2 = (0, import_child_process12.spawnSync)(name, ["--version"], {
129977
129977
  encoding: "utf-8",
129978
129978
  shell: true,
129979
129979
  timeout: 5e3,
129980
129980
  stdio: "pipe"
129981
129981
  });
129982
129982
  if (version2.status !== 0) {
129983
- return { installed: false, running: false };
129983
+ return { name, installed: false, running: false };
129984
129984
  }
129985
- const info = (0, import_child_process12.spawnSync)("docker", ["info"], {
129985
+ if (name === "podman") {
129986
+ return { name, installed: true, running: true };
129987
+ }
129988
+ const info = (0, import_child_process12.spawnSync)(name, ["info"], {
129986
129989
  encoding: "utf-8",
129987
129990
  shell: true,
129988
129991
  timeout: 1e4,
129989
129992
  stdio: "pipe"
129990
129993
  });
129991
- return { installed: true, running: info.status === 0 };
129994
+ return { name, installed: true, running: info.status === 0 };
129992
129995
  } catch {
129993
- return { installed: false, running: false };
129996
+ return { name, installed: false, running: false };
129994
129997
  }
129995
129998
  }
129996
- function requireDocker() {
129997
- const status = checkDocker();
129998
- if (!status.installed) {
129999
- logger.error("Docker is not installed.");
130000
- console.log();
130001
- console.log(` Install Docker Desktop: ${source_default.cyan("https://docs.docker.com/get-docker/")}`);
130002
- console.log(` Then restart your terminal and try again.`);
130003
- console.log();
130004
- return false;
130005
- }
130006
- if (!status.running) {
130007
- logger.error("Docker is installed but the daemon is not running.");
129999
+ function detectEngine() {
130000
+ const docker = checkEngine("docker");
130001
+ if (docker.installed && docker.running) return docker;
130002
+ const podman = checkEngine("podman");
130003
+ if (podman.installed && podman.running) {
130004
+ logger.info(`Using ${source_default.cyan("Podman")} (Docker not found or not running)`);
130005
+ return podman;
130006
+ }
130007
+ if (docker.installed && !docker.running) {
130008
+ logger.error("Docker is installed but the daemon is not running, and Podman is not available.");
130008
130009
  console.log();
130009
- console.log(` Start Docker Desktop and wait for it to be ready, then try again.`);
130010
+ console.log(` Option 1: Start Docker Desktop and wait for it to be ready`);
130011
+ console.log(` Option 2: Install Podman (daemonless): ${source_default.cyan("https://podman.io/docs/installation")}`);
130010
130012
  console.log();
130011
- return false;
130013
+ return null;
130012
130014
  }
130013
- return true;
130015
+ logger.error("No container engine found (Docker or Podman).");
130016
+ console.log();
130017
+ console.log(` Install one of the following:`);
130018
+ console.log(` Docker Desktop: ${source_default.cyan("https://docs.docker.com/get-docker/")}`);
130019
+ console.log(` Podman: ${source_default.cyan("https://podman.io/docs/installation")}`);
130020
+ console.log();
130021
+ return null;
130022
+ }
130023
+ function requireEngine() {
130024
+ return detectEngine();
130014
130025
  }
130015
130026
  function findComposeFile() {
130016
130027
  const cwd = process.cwd();
@@ -130032,8 +130043,8 @@ function requireComposeFile() {
130032
130043
  }
130033
130044
  return composePath;
130034
130045
  }
130035
- function runCompose(composePath, args) {
130036
- const result = (0, import_child_process12.spawnSync)("docker", ["compose", "-f", composePath, ...args], {
130046
+ function runCompose(engine, composePath, args) {
130047
+ const result = (0, import_child_process12.spawnSync)(engine.name, ["compose", "-f", composePath, ...args], {
130037
130048
  encoding: "utf-8",
130038
130049
  shell: true,
130039
130050
  stdio: "inherit",
@@ -130041,68 +130052,73 @@ function runCompose(composePath, args) {
130041
130052
  });
130042
130053
  return result.status ?? 1;
130043
130054
  }
130044
- var dockerCommand = new Command("docker").description("Build and run SmartStack Docker images").addCommand(
130055
+ var dockerCommand = new Command("docker").description("Build and run SmartStack Docker images (Docker or Podman)").addCommand(
130045
130056
  new Command("up").description("Build images and start containers").option("-d, --detach", "Run containers in the background").option("--no-build", "Skip image build, use existing images").action(async (options) => {
130046
- if (!requireDocker()) return;
130057
+ const engine = requireEngine();
130058
+ if (!engine) return;
130047
130059
  const composePath = requireComposeFile();
130048
130060
  if (!composePath) return;
130049
130061
  logger.header("SmartStack Docker Up");
130050
130062
  const args = ["up"];
130051
130063
  if (options.build !== false) args.push("--build");
130052
130064
  if (options.detach) args.push("-d");
130053
- const code = runCompose(composePath, args);
130065
+ const code = runCompose(engine, composePath, args);
130054
130066
  if (code !== 0) {
130055
- logger.error(`docker compose up exited with code ${code}`);
130067
+ logger.error(`${engine.name} compose up exited with code ${code}`);
130056
130068
  process.exitCode = code;
130057
130069
  }
130058
130070
  })
130059
130071
  ).addCommand(
130060
130072
  new Command("down").description("Stop and remove containers").option("-v, --volumes", "Also remove volumes").action(async (options) => {
130061
- if (!requireDocker()) return;
130073
+ const engine = requireEngine();
130074
+ if (!engine) return;
130062
130075
  const composePath = requireComposeFile();
130063
130076
  if (!composePath) return;
130064
130077
  logger.header("SmartStack Docker Down");
130065
130078
  const args = ["down"];
130066
130079
  if (options.volumes) args.push("-v");
130067
- const code = runCompose(composePath, args);
130080
+ const code = runCompose(engine, composePath, args);
130068
130081
  if (code !== 0) {
130069
- logger.error(`docker compose down exited with code ${code}`);
130082
+ logger.error(`${engine.name} compose down exited with code ${code}`);
130070
130083
  process.exitCode = code;
130071
130084
  }
130072
130085
  })
130073
130086
  ).addCommand(
130074
130087
  new Command("build").description("Build images without starting containers").option("--no-cache", "Build without using cache").action(async (options) => {
130075
- if (!requireDocker()) return;
130088
+ const engine = requireEngine();
130089
+ if (!engine) return;
130076
130090
  const composePath = requireComposeFile();
130077
130091
  if (!composePath) return;
130078
130092
  logger.header("SmartStack Docker Build");
130079
130093
  const args = ["build"];
130080
130094
  if (options.cache === false) args.push("--no-cache");
130081
- const code = runCompose(composePath, args);
130095
+ const code = runCompose(engine, composePath, args);
130082
130096
  if (code !== 0) {
130083
- logger.error(`docker compose build exited with code ${code}`);
130097
+ logger.error(`${engine.name} compose build exited with code ${code}`);
130084
130098
  process.exitCode = code;
130085
130099
  }
130086
130100
  })
130087
130101
  ).addCommand(
130088
130102
  new Command("status").description("Show container status").action(async () => {
130089
- if (!requireDocker()) return;
130103
+ const engine = requireEngine();
130104
+ if (!engine) return;
130090
130105
  const composePath = requireComposeFile();
130091
130106
  if (!composePath) return;
130092
- const code = runCompose(composePath, ["ps", "-a"]);
130107
+ const code = runCompose(engine, composePath, ["ps", "-a"]);
130093
130108
  if (code !== 0) {
130094
130109
  process.exitCode = code;
130095
130110
  }
130096
130111
  })
130097
130112
  ).addCommand(
130098
130113
  new Command("logs").description("Show container logs").option("-f, --follow", "Follow log output").option("--tail <lines>", "Number of lines to show from the end", "100").argument("[service]", "Service name (backend or frontend)").action(async (service, options) => {
130099
- if (!requireDocker()) return;
130114
+ const engine = requireEngine();
130115
+ if (!engine) return;
130100
130116
  const composePath = requireComposeFile();
130101
130117
  if (!composePath) return;
130102
130118
  const args = ["logs", "--tail", options.tail];
130103
130119
  if (options.follow) args.push("-f");
130104
130120
  if (service) args.push(service);
130105
- const code = runCompose(composePath, args);
130121
+ const code = runCompose(engine, composePath, args);
130106
130122
  if (code !== 0) {
130107
130123
  process.exitCode = code;
130108
130124
  }
@@ -130120,21 +130136,21 @@ async function main2() {
130120
130136
  const program2 = new Command();
130121
130137
  program2.name("smartstack").description(source_default.cyan("SmartStack Claude Code automation toolkit")).version(pkg.version, "-v, --version");
130122
130138
  program2.addCommand(createLicenseCommand());
130123
- program2.addCommand(installCommand);
130124
- program2.addCommand(uninstallCommand);
130125
- program2.addCommand(statusCommand);
130126
- program2.addCommand(updateCommand);
130127
- program2.addCommand(docsCommand);
130128
- program2.addCommand(initCommand);
130129
- program2.addCommand(upgradeCommand);
130139
+ program2.addCommand(adminCommand);
130140
+ program2.addCommand(businessAnalyseHandoffCommand);
130130
130141
  program2.addCommand(checkMcpCommand);
130131
- program2.addCommand(ralphCommand);
130142
+ program2.addCommand(dockerCommand);
130132
130143
  program2.addCommand(doctorCommand);
130133
- program2.addCommand(adminCommand);
130144
+ program2.addCommand(docsCommand);
130145
+ program2.addCommand(initCommand);
130146
+ program2.addCommand(installCommand);
130134
130147
  program2.addCommand(mcpCommand);
130135
- program2.addCommand(businessAnalyseHandoffCommand);
130148
+ program2.addCommand(ralphCommand);
130149
+ program2.addCommand(statusCommand);
130136
130150
  program2.addCommand(tmuxCommand);
130137
- program2.addCommand(dockerCommand);
130151
+ program2.addCommand(uninstallCommand);
130152
+ program2.addCommand(updateCommand);
130153
+ program2.addCommand(upgradeCommand);
130138
130154
  const args = process.argv.slice(2);
130139
130155
  const commandName = args[0] || "";
130140
130156
  const requiresLicense = !LICENSE_FREE_COMMANDS.some(