@m14i/sith 1.9.1 → 1.11.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
@@ -78,20 +78,17 @@ cosign verify \
78
78
 
79
79
  ## Authentication
80
80
 
81
- To use GitHub Copilot models, set the `GITHUB_TOKEN` environment variable:
81
+ Sith uses **GitHub Copilot models by default**. Authentication requires a GitHub token.
82
82
 
83
- **Quick start (using GitHub CLI):**
83
+ **Automatic (recommended):**
84
+ If you have GitHub CLI (`gh`) installed and authenticated, Sith automatically fetches your token:
84
85
  ```bash
85
- export GITHUB_TOKEN=$(gh auth token)
86
- sith --it
87
- ```
88
-
89
- **Or inline:**
90
- ```bash
91
- GITHUB_TOKEN=$(gh auth token) sith --it
86
+ sith --it # Auto-detects token via gh auth token
92
87
  ```
93
88
 
94
89
  **Manual token:**
90
+ If you don't have `gh` CLI or prefer manual setup:
91
+
95
92
  1. Create a token at https://github.com/settings/tokens
96
93
  2. Required scopes: `copilot`, `repo`, `read:org`
97
94
  3. Export it:
package/dist/index.js CHANGED
@@ -43263,6 +43263,17 @@ async function runShell() {
43263
43263
  console.log(`Mounting current directory to ${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.workspaceMount}`);
43264
43264
  console.log('Press Ctrl+D or type "exit" to leave');
43265
43265
  console.log();
43266
+ // Try to get GitHub token from gh CLI if not in env
43267
+ let githubToken = process.env.GITHUB_TOKEN || "";
43268
+ if (!githubToken) {
43269
+ try {
43270
+ const { stdout } = await (0,execa__WEBPACK_IMPORTED_MODULE_6__/* .execa */ .Ho)("gh", ["auth", "token"]);
43271
+ githubToken = stdout.trim();
43272
+ }
43273
+ catch {
43274
+ // Ignore if gh CLI not available or not authenticated
43275
+ }
43276
+ }
43266
43277
  const dockerArgs = [
43267
43278
  "run",
43268
43279
  "--rm",
@@ -43270,7 +43281,7 @@ async function runShell() {
43270
43281
  "-v",
43271
43282
  `${process.cwd()}:${_config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.workspaceMount}`,
43272
43283
  "-e",
43273
- `GITHUB_TOKEN=${process.env.GITHUB_TOKEN || ""}`,
43284
+ `GITHUB_TOKEN=${githubToken}`,
43274
43285
  "--entrypoint",
43275
43286
  "nix-shell",
43276
43287
  _config_js__WEBPACK_IMPORTED_MODULE_5__/* .DOCKER_CONFIG */ .e6.imageName,
@@ -43342,6 +43353,7 @@ __nccwpck_require__.a(module, async (__webpack_handle_async_dependencies__, __we
43342
43353
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3__ = __nccwpck_require__(6928);
43343
43354
  /* harmony import */ var path__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__nccwpck_require__.n(path__WEBPACK_IMPORTED_MODULE_3__);
43344
43355
  /* harmony import */ var update_notifier__WEBPACK_IMPORTED_MODULE_5__ = __nccwpck_require__(6213);
43356
+ /* harmony import */ var chalk__WEBPACK_IMPORTED_MODULE_6__ = __nccwpck_require__(9611);
43345
43357
  /* harmony import */ var _commands_docker_js__WEBPACK_IMPORTED_MODULE_4__ = __nccwpck_require__(5515);
43346
43358
  var __webpack_async_dependencies__ = __webpack_handle_async_dependencies__([_commands_docker_js__WEBPACK_IMPORTED_MODULE_4__]);
43347
43359
  _commands_docker_js__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies__.then ? (await __webpack_async_dependencies__)() : __webpack_async_dependencies__)[0];
@@ -43351,6 +43363,7 @@ _commands_docker_js__WEBPACK_IMPORTED_MODULE_4__ = (__webpack_async_dependencies
43351
43363
 
43352
43364
 
43353
43365
 
43366
+
43354
43367
  // Import package.json for version and update checks
43355
43368
  const __filename = (0,url__WEBPACK_IMPORTED_MODULE_2__.fileURLToPath)(import.meta.url);
43356
43369
  const __dirname = (0,path__WEBPACK_IMPORTED_MODULE_3__.dirname)(__filename);
@@ -43358,8 +43371,29 @@ const pkg = JSON.parse((0,fs__WEBPACK_IMPORTED_MODULE_1__.readFileSync)(__nccwpc
43358
43371
  const PROGRAM_NAME = 'sith';
43359
43372
  const PROGRAM_VERSION = pkg.version;
43360
43373
  const PROGRAM_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.';
43361
- // Check for updates
43362
- (0,update_notifier__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({ pkg }).notify();
43374
+ // Check for updates (automatic background check)
43375
+ const notifier = (0,update_notifier__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({ pkg });
43376
+ notifier.notify();
43377
+ async function checkForUpdates() {
43378
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.cyan('Checking for updates...'));
43379
+ // Force update check by setting updateCheckInterval to 0
43380
+ const notifier = (0,update_notifier__WEBPACK_IMPORTED_MODULE_5__/* ["default"] */ .A)({
43381
+ pkg,
43382
+ updateCheckInterval: 0
43383
+ });
43384
+ // Fetch the latest version
43385
+ await notifier.fetchInfo();
43386
+ const update = notifier.update;
43387
+ if (update && update.latest !== pkg.version) {
43388
+ console.log();
43389
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.green(`Update available: ${chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.dim(pkg.version)} → ${chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.bold(update.latest)}`));
43390
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.cyan(`Run ${chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.bold(`npm install -g ${pkg.name}`)} to update`));
43391
+ console.log();
43392
+ }
43393
+ else {
43394
+ console.log(chalk__WEBPACK_IMPORTED_MODULE_6__/* ["default"] */ .Ay.green(`✓ You're on the latest version (${pkg.version})`));
43395
+ }
43396
+ }
43363
43397
  function createProgram() {
43364
43398
  const program = new commander__WEBPACK_IMPORTED_MODULE_0__/* .Command */ .uB();
43365
43399
  program
@@ -43368,11 +43402,15 @@ function createProgram() {
43368
43402
  .version(PROGRAM_VERSION)
43369
43403
  .option('--pull', 'Pull prebuilt Docker image (recommended)')
43370
43404
  .option('--build', 'Build the Docker image from scratch')
43371
- .option('--it', 'Launch interactive shell in Docker container');
43405
+ .option('--it', 'Launch interactive shell in Docker container')
43406
+ .option('--update', 'Check for updates');
43372
43407
  // Default action - show interactive menu or run shell with --it
43373
43408
  program
43374
43409
  .action(async (options) => {
43375
- if (options.it) {
43410
+ if (options.update) {
43411
+ await checkForUpdates();
43412
+ }
43413
+ else if (options.it) {
43376
43414
  await (0,_commands_docker_js__WEBPACK_IMPORTED_MODULE_4__/* .runShellDirect */ .l)();
43377
43415
  }
43378
43416
  else {
package/dist/package.json CHANGED
@@ -1 +1 @@
1
- {"name":"@m14i/sith","version":"1.9.1","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.","type":"module","repository":{"type":"git","url":"https://github.com/MerzoukeMansouri/sith.git"},"bin":{"sith":"./dist/index.js"},"scripts":{"build":"ncc build src/index.ts -o dist && rm -rf dist/assets && cp -r assets dist/","dev":"tsx src/index.ts","dev:build":"pnpm build && node dist/index.js","dev:shell":"pnpm build && node dist/index.js shell","typecheck":"tsc --noEmit","clean":"rm -rf dist","prepublishOnly":"pnpm build"},"files":["dist","assets","docker"],"keywords":["opencode","docker","ci","automation","cli","nix"],"author":"","license":"MIT","dependencies":{"@inquirer/prompts":"^5.0.0","chalk":"^5.3.0","commander":"^12.1.0","execa":"^9.0.0","ink":"^7.0.3","react":"^19.2.6","update-notifier":"^7.3.1"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@types/node":"^20.12.7","@types/react":"^19.2.14","@types/update-notifier":"^6.0.8","@vercel/ncc":"^0.38.1","semantic-release":"^24.2.0","tsx":"^4.7.2","typescript":"^5.4.5"},"engines":{"node":">=18"}}
1
+ {"name":"@m14i/sith","version":"1.11.0","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.","type":"module","repository":{"type":"git","url":"https://github.com/MerzoukeMansouri/sith.git"},"bin":{"sith":"./dist/index.js"},"scripts":{"build":"ncc build src/index.ts -o dist && rm -rf dist/assets && cp -r assets dist/","dev":"tsx src/index.ts","dev:build":"pnpm build && node dist/index.js","dev:shell":"pnpm build && node dist/index.js shell","typecheck":"tsc --noEmit","clean":"rm -rf dist","prepublishOnly":"pnpm build"},"files":["dist","assets","docker"],"keywords":["opencode","docker","ci","automation","cli","nix"],"author":"","license":"MIT","dependencies":{"@inquirer/prompts":"^5.0.0","chalk":"^5.3.0","commander":"^12.1.0","execa":"^9.0.0","ink":"^7.0.3","react":"^19.2.6","update-notifier":"^7.3.1"},"devDependencies":{"@semantic-release/changelog":"^6.0.3","@semantic-release/git":"^10.0.1","@semantic-release/github":"^11.0.1","@semantic-release/npm":"^12.0.1","@types/node":"^20.12.7","@types/react":"^19.2.14","@types/update-notifier":"^6.0.8","@vercel/ncc":"^0.38.1","semantic-release":"^24.2.0","tsx":"^4.7.2","typescript":"^5.4.5"},"engines":{"node":">=18"}}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@m14i/sith",
3
- "version": "1.9.1",
3
+ "version": "1.11.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": {