@m14i/sith 1.7.6 → 1.8.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/README.md CHANGED
@@ -10,42 +10,54 @@ Standardize and share your OpenCode setup with a fully dockerized environment, d
10
10
 
11
11
  ## Usage
12
12
 
13
+ ### Installation
14
+
15
+ **Install globally (recommended):**
16
+ ```bash
17
+ npm install -g @m14i/sith
18
+ ```
19
+
20
+ **Or use npx (slower, pulls image every time):**
21
+ ```bash
22
+ npx @m14i/sith@latest
23
+ ```
24
+
13
25
  ### Quick Start
14
26
 
15
27
  ```bash
16
28
  # Interactive menu (recommended)
17
- npx @m14i/sith
18
-
19
- # Pull prebuilt image directly
20
- npx @m14i/sith --pull
29
+ sith
30
+ # Options: Enter Shell | Configuration (Pull/Build)
21
31
 
22
- # Run shell
23
- npx @m14i/sith shell
32
+ # Direct commands (skip menu)
33
+ sith --it # Launch shell immediately
34
+ sith --pull # Pull prebuilt image
35
+ sith --build # Build from scratch
24
36
  ```
25
37
 
26
38
  ### Distribution Options
27
39
 
28
40
  | Method | Command | Speed | Trust Model | Use Case |
29
41
  |--------|---------|-------|-------------|----------|
30
- | **Prebuilt (Recommended)** | `npx @m14i/sith --pull` | ⚡ Fast | GitHub Actions + Cosign | Production, CI/CD |
31
- | **Local Build** | `npx @m14i/sith --build` | 🐌 Slow | Your machine | Air-gapped, custom builds |
42
+ | **Prebuilt (Recommended)** | `sith --pull` | ⚡ Fast | GitHub Actions + Cosign | Production, CI/CD |
43
+ | **Local Build** | `sith --build` | 🐌 Slow | Your machine | Air-gapped, custom builds |
32
44
 
33
45
  ### Commands
34
46
 
35
47
  | Command | Description |
36
48
  |---------|-------------|
37
- | `npx @m14i/sith` | Interactive menu with options |
38
- | `npx @m14i/sith --pull` | Pull prebuilt image from GHCR |
39
- | `npx @m14i/sith --build` | Build Docker image from scratch |
40
- | `npx @m14i/sith shell` | Launch interactive shell in container |
41
- | `npx @m14i/sith --help` | Show all available commands |
49
+ | `sith` | Interactive menu with options |
50
+ | `sith --it` | Launch interactive shell in container |
51
+ | `sith --pull` | Pull prebuilt image from GHCR |
52
+ | `sith --build` | Build Docker image from scratch |
53
+ | `sith --help` | Show all available commands |
42
54
 
43
55
  ### Prebuilt Image Details
44
56
 
45
57
  **Pull and verify:**
46
58
  ```bash
47
59
  # Pull (supports linux/amd64 and linux/arm64)
48
- npx @m14i/sith --pull
60
+ sith --pull
49
61
 
50
62
  # Or use Docker directly
51
63
  docker pull ghcr.io/merzoukemanouri/sith:latest
@@ -71,12 +83,12 @@ To use GitHub Copilot models, set the `GITHUB_TOKEN` environment variable:
71
83
  **Quick start (using GitHub CLI):**
72
84
  ```bash
73
85
  export GITHUB_TOKEN=$(gh auth token)
74
- npx @m14i/sith shell
86
+ sith --it
75
87
  ```
76
88
 
77
89
  **Or inline:**
78
90
  ```bash
79
- GITHUB_TOKEN=$(gh auth token) npx @m14i/sith shell
91
+ GITHUB_TOKEN=$(gh auth token) sith --it
80
92
  ```
81
93
 
82
94
  **Manual token:**
@@ -85,7 +97,7 @@ GITHUB_TOKEN=$(gh auth token) npx @m14i/sith shell
85
97
  3. Export it:
86
98
  ```bash
87
99
  export GITHUB_TOKEN=gho_your_token_here
88
- npx @m14i/sith shell
100
+ sith --it
89
101
  ```
90
102
 
91
103
  **Make it persistent (add to ~/.zshrc or ~/.bashrc):**
@@ -1 +1 @@
1
- {"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/commands/docker.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAkC,oBAAoB,EAAE,MAAM,aAAa,CAAC;AA6PxF,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhF;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpD"}
1
+ {"version":3,"file":"docker.d.ts","sourceRoot":"","sources":["file:///home/runner/work/sith/sith/src/commands/docker.tsx"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAkC,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAmRxF,wBAAsB,aAAa,CAAC,OAAO,EAAE,oBAAoB,GAAG,OAAO,CAAC,IAAI,CAAC,CAoBhF;AAED,wBAAsB,cAAc,IAAI,OAAO,CAAC,IAAI,CAAC,CAEpD"}
package/dist/index.js CHANGED
@@ -35471,9 +35471,13 @@ function findProjectRoot(startDir) {
35471
35471
  }
35472
35472
  const rootDir = findProjectRoot(__dirname);
35473
35473
  const menuItems = [
35474
+ { label: "Enter Shell", value: "shell", icon: "🚀" },
35475
+ { label: "Configuration", value: "config", icon: "⚙️" },
35476
+ ];
35477
+ const configMenuItems = [
35474
35478
  { label: "Pull prebuilt image (recommended)", value: "pull", icon: "📦" },
35475
35479
  { label: "Build Docker image from scratch", value: "build", icon: "🔨" },
35476
- { label: "Exit", value: "exit", icon: "" },
35480
+ { label: "Back", value: "back", icon: "◀️" },
35477
35481
  ];
35478
35482
  function Logo() {
35479
35483
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { flexDirection: "column", marginBottom: 1 },
@@ -35502,6 +35506,7 @@ function Menu() {
35502
35506
  const [processStep, setProcessStep] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("");
35503
35507
  const [processComplete, setProcessComplete] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(false);
35504
35508
  const [processError, setProcessError] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)(null);
35509
+ const [currentMenu, setCurrentMenu] = (0,react__WEBPACK_IMPORTED_MODULE_0__.useState)("main");
35505
35510
  (0,ink__WEBPACK_IMPORTED_MODULE_1__/* .useInput */ .Ge)((_input, key) => {
35506
35511
  if (isProcessing) {
35507
35512
  return;
@@ -35511,20 +35516,30 @@ function Menu() {
35511
35516
  exit();
35512
35517
  return;
35513
35518
  }
35519
+ const items = currentMenu === "main" ? menuItems : configMenuItems;
35514
35520
  if (key.upArrow) {
35515
- setSelectedIndex((prev) => (prev > 0 ? prev - 1 : menuItems.length - 1));
35521
+ setSelectedIndex((prev) => (prev > 0 ? prev - 1 : items.length - 1));
35516
35522
  }
35517
35523
  else if (key.downArrow) {
35518
- setSelectedIndex((prev) => (prev < menuItems.length - 1 ? prev + 1 : 0));
35524
+ setSelectedIndex((prev) => (prev < items.length - 1 ? prev + 1 : 0));
35519
35525
  }
35520
35526
  else if (key.return) {
35521
- handleSelection(menuItems[selectedIndex].value);
35527
+ handleSelection(items[selectedIndex].value);
35522
35528
  }
35523
35529
  });
35524
35530
  async function handleSelection(value) {
35525
35531
  switch (value) {
35526
- case "exit":
35532
+ case "shell":
35527
35533
  exit();
35534
+ await runShell();
35535
+ return;
35536
+ case "config":
35537
+ setCurrentMenu("config");
35538
+ setSelectedIndex(0);
35539
+ return;
35540
+ case "back":
35541
+ setCurrentMenu("main");
35542
+ setSelectedIndex(0);
35528
35543
  return;
35529
35544
  case "pull":
35530
35545
  await handlePullCommand();
@@ -35598,7 +35613,7 @@ function Menu() {
35598
35613
  "Image: ",
35599
35614
  _config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.imageName)),
35600
35615
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { marginTop: 1 },
35601
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { dimColor: true }, "Run: npx @m14i/sith shell")),
35616
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { dimColor: true }, "Run: sith --it")),
35602
35617
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { marginTop: 1 },
35603
35618
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { dimColor: true }, "Press any key to exit..."))));
35604
35619
  }
@@ -35613,11 +35628,13 @@ function Menu() {
35613
35628
  rootDir))));
35614
35629
  }
35615
35630
  // Render menu state
35631
+ const items = currentMenu === "main" ? menuItems : configMenuItems;
35632
+ const menuTitle = currentMenu === "main" ? "What would you like to do?" : "Configuration";
35616
35633
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { flexDirection: "column" },
35617
35634
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement(Logo, null),
35618
35635
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { flexDirection: "column", marginTop: 1 },
35619
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { bold: true }, "What would you like to do?"),
35620
- react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { flexDirection: "column", marginTop: 1 }, menuItems.map((item, index) => {
35636
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { bold: true }, menuTitle),
35637
+ react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { flexDirection: "column", marginTop: 1 }, items.map((item, index) => {
35621
35638
  const isSelected = index === selectedIndex;
35622
35639
  return (react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Box */ .az, { key: item.value, marginY: 0 },
35623
35640
  react__WEBPACK_IMPORTED_MODULE_0___default().createElement(ink__WEBPACK_IMPORTED_MODULE_1__/* .Text */ .EY, { color: isSelected ? "cyan" : undefined },
@@ -35669,7 +35686,7 @@ async function pullDocker() {
35669
35686
  console.log("✅ Docker image ready!");
35670
35687
  console.log(`Image: ${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.imageName}`);
35671
35688
  console.log();
35672
- console.log("Run: npx @m14i/sith shell");
35689
+ console.log("Run: sith --it");
35673
35690
  }
35674
35691
  catch (error) {
35675
35692
  console.error("❌ Pull failed");
@@ -35697,7 +35714,7 @@ async function buildDocker() {
35697
35714
  console.log("✅ Docker image built successfully!");
35698
35715
  console.log(`Image: ${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.imageName}`);
35699
35716
  console.log();
35700
- console.log("Run: npx @m14i/sith shell");
35717
+ console.log("Run: sith --it");
35701
35718
  }
35702
35719
  catch (error) {
35703
35720
  console.error("❌ Build failed");
@@ -35799,11 +35816,17 @@ function createProgram() {
35799
35816
  .description(PROGRAM_DESCRIPTION)
35800
35817
  .version(PROGRAM_VERSION)
35801
35818
  .option('--pull', 'Pull prebuilt Docker image (recommended)')
35802
- .option('--build', 'Build the Docker image from scratch');
35803
- // Default action - show interactive menu
35819
+ .option('--build', 'Build the Docker image from scratch')
35820
+ .option('--it', 'Launch interactive shell in Docker container');
35821
+ // Default action - show interactive menu or run shell with --it
35804
35822
  program
35805
35823
  .action(async (options) => {
35806
- await (0,_commands_docker_js__WEBPACK_IMPORTED_MODULE_1__/* .dockerCommand */ .Q)(options);
35824
+ if (options.it) {
35825
+ await (0,_commands_docker_js__WEBPACK_IMPORTED_MODULE_1__/* .runShellDirect */ .l)();
35826
+ }
35827
+ else {
35828
+ await (0,_commands_docker_js__WEBPACK_IMPORTED_MODULE_1__/* .dockerCommand */ .Q)(options);
35829
+ }
35807
35830
  });
35808
35831
  // Docker command - explicit Docker management
35809
35832
  program
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m14i/sith",
3
- "version": "1.7.6",
3
+ "version": "1.8.0",
4
4
  "description": "Turn your context to the dark side. Standardize and share your OpenCode setup with a fully dockerized environment, designed for seamless collaboration and CI integration.",
5
5
  "type": "module",
6
6
  "repository": {