@schuttdev/gigai 0.1.0-beta.6 → 0.1.0-beta.7

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.
@@ -43,6 +43,8 @@ import { resolve as resolve3 } from "path";
43
43
  import { input, select, checkbox, confirm } from "@inquirer/prompts";
44
44
  import { writeFile as writeFile2, mkdir as mkdir2 } from "fs/promises";
45
45
  import { resolve as resolve4, join as join3 } from "path";
46
+ import { execFile } from "child_process";
47
+ import { promisify } from "util";
46
48
  import { input as input2 } from "@inquirer/prompts";
47
49
  import { readFile as readFile4, writeFile as writeFile3 } from "fs/promises";
48
50
  import { resolve as resolve5 } from "path";
@@ -826,6 +828,18 @@ async function loadConfig(path) {
826
828
  const json = JSON.parse(raw);
827
829
  return GigaiConfigSchema.parse(json);
828
830
  }
831
+ var execFileAsync = promisify(execFile);
832
+ async function getTailscaleDnsName() {
833
+ try {
834
+ const { stdout } = await execFileAsync("tailscale", ["status", "--json"]);
835
+ const data = JSON.parse(stdout);
836
+ const dnsName = data?.Self?.DNSName;
837
+ if (dnsName) return dnsName.replace(/\.$/, "");
838
+ return null;
839
+ } catch {
840
+ return null;
841
+ }
842
+ }
829
843
  async function runInit() {
830
844
  console.log("\n gigai server setup\n");
831
845
  const httpsProvider = await select({
@@ -965,33 +979,71 @@ async function runInit() {
965
979
  Config written to: ${configPath}`);
966
980
  const skillDir = resolve4("gigai-skill");
967
981
  await mkdir2(skillDir, { recursive: true });
968
- const skillMd = `# gigai Skill
982
+ let serverUrl = "<YOUR_SERVER_URL>";
983
+ if (httpsProvider === "tailscale") {
984
+ const dnsName = await getTailscaleDnsName();
985
+ if (dnsName) {
986
+ serverUrl = `https://${dnsName}:${port}`;
987
+ console.log(` Detected Tailscale URL: ${serverUrl}`);
988
+ }
989
+ }
990
+ const skillMd = `---
991
+ name: gigai
992
+ description: Access tools on the user's machine via the gigai CLI
993
+ ---
994
+
995
+ # gigai Skill
969
996
 
970
997
  This skill gives you access to tools running on the user's machine via the gigai CLI.
971
998
 
972
- ## Setup
999
+ ## Quick Start
1000
+
1001
+ 1. Connect to the server:
1002
+ \`\`\`
1003
+ gigai connect
1004
+ \`\`\`
1005
+
1006
+ 2. List available tools:
1007
+ \`\`\`
1008
+ gigai list
1009
+ \`\`\`
1010
+
1011
+ 3. Get help on a specific tool:
1012
+ \`\`\`
1013
+ gigai help <tool-name>
1014
+ \`\`\`
1015
+
1016
+ 4. Use a tool directly:
1017
+ \`\`\`
1018
+ gigai <tool-name> [args...]
1019
+ \`\`\`
973
1020
 
974
- The gigai CLI is pre-installed. To use it:
1021
+ ## Commands
975
1022
 
976
- 1. Connect to the server: \`gigai connect\`
977
- 2. List available tools: \`gigai list\`
978
- 3. Get help on a tool: \`gigai help <tool-name>\`
979
- 4. Use a tool: \`gigai <tool-name> [args...]\`
1023
+ ### Connection
1024
+ - \`gigai connect\` \u2014 Establish/renew a session with the server
1025
+ - \`gigai status\` \u2014 Check connection status
1026
+ - \`gigai pair <code> <server-url>\` \u2014 Pair with a new server
980
1027
 
981
- ## File Transfer
1028
+ ### Tool Usage
1029
+ - \`gigai list\` \u2014 List all available tools
1030
+ - \`gigai help <name>\` \u2014 Show detailed help for a tool
1031
+ - \`gigai <name> [args...]\` \u2014 Execute a tool by name
982
1032
 
983
- - Upload: \`gigai upload <file>\`
984
- - Download: \`gigai download <id> <dest>\`
1033
+ ### File Transfer
1034
+ - \`gigai upload <file>\` \u2014 Upload a file to the server
1035
+ - \`gigai download <id> <dest>\` \u2014 Download a file from the server
985
1036
 
986
1037
  ## Notes
987
1038
 
988
- - The connection is authenticated and encrypted
989
- - Tools are scoped to what the user has configured
990
- - If a command fails, check \`gigai status\` for connection info
1039
+ - The connection is authenticated and encrypted end-to-end
1040
+ - Tools are scoped to what the user has explicitly configured
1041
+ - Sessions auto-renew; if you get auth errors, run \`gigai connect\`
1042
+ - All tool execution happens on the user's machine, not in this container
991
1043
  `;
992
1044
  await writeFile2(join3(skillDir, "SKILL.md"), skillMd);
993
1045
  const skillConfig = {
994
- server: "<YOUR_SERVER_URL>",
1046
+ server: serverUrl,
995
1047
  token: "<PASTE_ENCRYPTED_TOKEN_HERE>"
996
1048
  };
997
1049
  await writeFile2(join3(skillDir, "config.json"), JSON.stringify(skillConfig, null, 2) + "\n");
package/dist/index.js CHANGED
@@ -438,7 +438,7 @@ function runCitty() {
438
438
  dev: { type: "boolean", description: "Development mode (no HTTPS)" }
439
439
  },
440
440
  async run({ args }) {
441
- const { startServer } = await import("./dist-DX6G464T.js");
441
+ const { startServer } = await import("./dist-X77HZGDE.js");
442
442
  const extraArgs = [];
443
443
  if (args.config) extraArgs.push("--config", args.config);
444
444
  if (args.dev) extraArgs.push("--dev");
@@ -449,7 +449,7 @@ function runCitty() {
449
449
  init: defineCommand({
450
450
  meta: { name: "init", description: "Interactive setup wizard" },
451
451
  async run() {
452
- const { runInit } = await import("./dist-DX6G464T.js");
452
+ const { runInit } = await import("./dist-X77HZGDE.js");
453
453
  await runInit();
454
454
  }
455
455
  }),
@@ -459,7 +459,7 @@ function runCitty() {
459
459
  config: { type: "string", alias: "c", description: "Config file path" }
460
460
  },
461
461
  async run({ args }) {
462
- const { generateServerPairingCode } = await import("./dist-DX6G464T.js");
462
+ const { generateServerPairingCode } = await import("./dist-X77HZGDE.js");
463
463
  await generateServerPairingCode(args.config);
464
464
  }
465
465
  }),
@@ -486,21 +486,21 @@ function runCitty() {
486
486
  cli: defineCommand({
487
487
  meta: { name: "cli", description: "Wrap a CLI command" },
488
488
  async run() {
489
- const { wrapCli } = await import("./dist-DX6G464T.js");
489
+ const { wrapCli } = await import("./dist-X77HZGDE.js");
490
490
  await wrapCli();
491
491
  }
492
492
  }),
493
493
  mcp: defineCommand({
494
494
  meta: { name: "mcp", description: "Wrap an MCP server" },
495
495
  async run() {
496
- const { wrapMcp } = await import("./dist-DX6G464T.js");
496
+ const { wrapMcp } = await import("./dist-X77HZGDE.js");
497
497
  await wrapMcp();
498
498
  }
499
499
  }),
500
500
  script: defineCommand({
501
501
  meta: { name: "script", description: "Wrap a script" },
502
502
  async run() {
503
- const { wrapScript } = await import("./dist-DX6G464T.js");
503
+ const { wrapScript } = await import("./dist-X77HZGDE.js");
504
504
  await wrapScript();
505
505
  }
506
506
  }),
@@ -510,7 +510,7 @@ function runCitty() {
510
510
  path: { type: "positional", description: "Path to config file", required: true }
511
511
  },
512
512
  async run({ args }) {
513
- const { wrapImport } = await import("./dist-DX6G464T.js");
513
+ const { wrapImport } = await import("./dist-X77HZGDE.js");
514
514
  await wrapImport(args.path);
515
515
  }
516
516
  })
@@ -522,7 +522,7 @@ function runCitty() {
522
522
  name: { type: "positional", description: "Tool name", required: true }
523
523
  },
524
524
  async run({ args }) {
525
- const { unwrapTool } = await import("./dist-DX6G464T.js");
525
+ const { unwrapTool } = await import("./dist-X77HZGDE.js");
526
526
  await unwrapTool(args.name);
527
527
  }
528
528
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@schuttdev/gigai",
3
- "version": "0.1.0-beta.6",
3
+ "version": "0.1.0-beta.7",
4
4
  "type": "module",
5
5
  "bin": {
6
6
  "gigai": "dist/index.js"