@kntic/kntic 0.4.1 → 0.4.2

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kntic/kntic",
3
- "version": "0.4.1",
3
+ "version": "0.4.2",
4
4
  "author": "Thomas Robak <contact@kntic.ai> (https://kntic.ai)",
5
5
  "description": "KNTIC CLI — bootstrap and manage KNTIC projects",
6
6
  "main": "src/index.js",
package/src/cli.js CHANGED
@@ -16,7 +16,8 @@ if (!subcommand || subcommand === "usage") {
16
16
  });
17
17
  } else if (subcommand === "start") {
18
18
  try {
19
- commands.start();
19
+ const startOpts = { screen: args.includes("--screen") };
20
+ commands.start(startOpts);
20
21
  } catch (err) {
21
22
  console.error(`Error: ${err.message}`);
22
23
  process.exit(1);
@@ -30,16 +30,19 @@ function getScreenName() {
30
30
  return basename(process.cwd());
31
31
  }
32
32
 
33
- function start() {
33
+ function start(options = {}) {
34
34
  const composeCmd = "docker compose -f kntic.yml --env-file .kntic.env up --build";
35
+ const useScreen = !!options.screen;
35
36
 
36
- if (isScreenAvailable() && !isInsideScreen()) {
37
+ if (useScreen && isScreenAvailable() && !isInsideScreen()) {
37
38
  const screenName = getScreenName();
38
39
  console.log(`Starting KNTIC services in screen session "${screenName}"…`);
39
40
  execSync(`screen -S ${screenName} ${composeCmd}`, { stdio: "inherit" });
40
41
  } else {
41
- if (isInsideScreen()) {
42
+ if (useScreen && isInsideScreen()) {
42
43
  console.log("Already inside a screen session, skipping screen wrapper.");
44
+ } else if (useScreen && !isScreenAvailable()) {
45
+ console.log("screen is not available, starting without screen wrapper.");
43
46
  }
44
47
  console.log("Starting KNTIC services…");
45
48
  execSync(composeCmd, { stdio: "inherit" });
@@ -7,6 +7,7 @@ function usage() {
7
7
  console.log(" usage List all available sub-commands");
8
8
  console.log(" init Download and extract the KNTIC bootstrap template into the current directory");
9
9
  console.log(" start Build and start KNTIC services via docker compose (uses kntic.yml + .kntic.env)");
10
+ console.log(" --screen Run inside a GNU screen session");
10
11
  console.log(" stop Stop KNTIC services via docker compose");
11
12
  console.log(" update Download the latest KNTIC bootstrap and update .kntic/lib only");
12
13
  console.log("");