@flydocs/cli 0.5.0-beta.5 → 0.5.0-beta.6

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/cli.js CHANGED
@@ -15,7 +15,7 @@ var CLI_VERSION, CLI_NAME, PACKAGE_NAME;
15
15
  var init_constants = __esm({
16
16
  "src/lib/constants.ts"() {
17
17
  "use strict";
18
- CLI_VERSION = "0.5.0-beta.5";
18
+ CLI_VERSION = "0.5.0-beta.6";
19
19
  CLI_NAME = "flydocs";
20
20
  PACKAGE_NAME = "@flydocs/cli";
21
21
  }
@@ -1514,7 +1514,7 @@ __export(install_exports, {
1514
1514
  import { defineCommand } from "citty";
1515
1515
  import { resolve as resolve2 } from "path";
1516
1516
  import { join as join11 } from "path";
1517
- import { confirm as confirm2, isCancel as isCancel3, cancel as cancel2 } from "@clack/prompts";
1517
+ import { confirm as confirm2, select, isCancel as isCancel3, cancel as cancel2 } from "@clack/prompts";
1518
1518
  var install_default;
1519
1519
  var init_install = __esm({
1520
1520
  "src/commands/install.ts"() {
@@ -1886,41 +1886,85 @@ var init_install = __esm({
1886
1886
  return false;
1887
1887
  }
1888
1888
  };
1889
- const hasClaude = isInstalled("claude");
1890
- const hasCursor = isInstalled("cursor");
1891
- const hasCode = isInstalled("code");
1892
- if (hasClaude) {
1893
- const launchClaude = await confirm2({
1894
- message: "Open Claude Code and run /flydocs-setup now?"
1889
+ const ideOptions = [];
1890
+ if (isInstalled("claude")) {
1891
+ ideOptions.push({
1892
+ cmd: "claude",
1893
+ label: "Claude Code",
1894
+ hint: "Opens and runs /flydocs-setup automatically",
1895
+ passCommand: true
1895
1896
  });
1896
- if (!isCancel3(launchClaude) && launchClaude) {
1897
- spawn("claude", ["/flydocs-setup"], {
1898
- cwd: targetDir,
1899
- stdio: "inherit"
1900
- });
1901
- return;
1902
- }
1903
- } else if (hasCursor) {
1904
- const launchCursor = await confirm2({
1905
- message: copiedToClipboard ? "Open Cursor? (paste /flydocs-setup from clipboard)" : "Open Cursor?"
1897
+ }
1898
+ if (isInstalled("cursor")) {
1899
+ ideOptions.push({
1900
+ cmd: "cursor",
1901
+ label: "Cursor",
1902
+ hint: copiedToClipboard ? "Opens project \u2014 paste /flydocs-setup from clipboard" : "Opens project \u2014 run /flydocs-setup in chat",
1903
+ passCommand: false
1904
+ });
1905
+ }
1906
+ if (isInstalled("code")) {
1907
+ ideOptions.push({
1908
+ cmd: "code",
1909
+ label: "VS Code",
1910
+ hint: copiedToClipboard ? "Opens project \u2014 paste /flydocs-setup from clipboard" : "Opens project \u2014 run /flydocs-setup in chat",
1911
+ passCommand: false
1906
1912
  });
1907
- if (!isCancel3(launchCursor) && launchCursor) {
1908
- spawn("cursor", [targetDir], {
1909
- stdio: "ignore",
1910
- detached: true
1911
- }).unref();
1912
- printInfo("Cursor opening \u2014 paste /flydocs-setup in the chat panel");
1913
+ }
1914
+ if (ideOptions.length === 1) {
1915
+ const ide = ideOptions[0];
1916
+ const launchConfirm = await confirm2({
1917
+ message: ide.passCommand ? `Open ${ide.label} and run /flydocs-setup now?` : `Open ${ide.label}?`
1918
+ });
1919
+ if (!isCancel3(launchConfirm) && launchConfirm) {
1920
+ if (ide.passCommand) {
1921
+ spawn(ide.cmd, ["/flydocs-setup"], {
1922
+ cwd: targetDir,
1923
+ stdio: "inherit"
1924
+ });
1925
+ return;
1926
+ } else {
1927
+ spawn(ide.cmd, [targetDir], {
1928
+ stdio: "ignore",
1929
+ detached: true
1930
+ }).unref();
1931
+ printInfo(
1932
+ `${ide.label} opening \u2014 paste /flydocs-setup in the chat panel`
1933
+ );
1934
+ }
1913
1935
  }
1914
- } else if (hasCode) {
1915
- const launchCode = await confirm2({
1916
- message: copiedToClipboard ? "Open VS Code? (paste /flydocs-setup from clipboard)" : "Open VS Code?"
1936
+ } else if (ideOptions.length > 1) {
1937
+ const options = [
1938
+ ...ideOptions.map((ide) => ({
1939
+ value: ide.cmd,
1940
+ label: ide.label,
1941
+ hint: ide.hint
1942
+ })),
1943
+ { value: "skip", label: "Skip", hint: "I'll open my IDE manually" }
1944
+ ];
1945
+ const choice = await select({
1946
+ message: "Open an IDE to run /flydocs-setup?",
1947
+ options
1917
1948
  });
1918
- if (!isCancel3(launchCode) && launchCode) {
1919
- spawn("code", [targetDir], {
1920
- stdio: "ignore",
1921
- detached: true
1922
- }).unref();
1923
- printInfo("VS Code opening \u2014 paste /flydocs-setup in the chat panel");
1949
+ if (!isCancel3(choice) && choice !== "skip") {
1950
+ const ide = ideOptions.find((o) => o.cmd === choice);
1951
+ if (ide) {
1952
+ if (ide.passCommand) {
1953
+ spawn(ide.cmd, ["/flydocs-setup"], {
1954
+ cwd: targetDir,
1955
+ stdio: "inherit"
1956
+ });
1957
+ return;
1958
+ } else {
1959
+ spawn(ide.cmd, [targetDir], {
1960
+ stdio: "ignore",
1961
+ detached: true
1962
+ }).unref();
1963
+ printInfo(
1964
+ `${ide.label} opening \u2014 paste /flydocs-setup in the chat panel`
1965
+ );
1966
+ }
1967
+ }
1924
1968
  }
1925
1969
  }
1926
1970
  } catch {
@@ -1945,7 +1989,7 @@ __export(update_exports, {
1945
1989
  import { defineCommand as defineCommand2 } from "citty";
1946
1990
  import { resolve as resolve3, join as join12 } from "path";
1947
1991
  import { mkdir as mkdir5, cp as cp2, readFile as readFile8, readdir as readdir3, rm as rm4 } from "fs/promises";
1948
- import { select, text, confirm as confirm3, isCancel as isCancel4, cancel as cancel3 } from "@clack/prompts";
1992
+ import { select as select2, text, confirm as confirm3, isCancel as isCancel4, cancel as cancel3 } from "@clack/prompts";
1949
1993
  import pc6 from "picocolors";
1950
1994
  var update_default;
1951
1995
  var init_update = __esm({
@@ -2011,7 +2055,7 @@ var init_update = __esm({
2011
2055
  } else if (args.here) {
2012
2056
  targetDir = process.cwd();
2013
2057
  } else {
2014
- const choice = await select({
2058
+ const choice = await select2({
2015
2059
  message: "Which project would you like to update?",
2016
2060
  options: [
2017
2061
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flydocs/cli",
3
- "version": "0.5.0-beta.5",
3
+ "version": "0.5.0-beta.6",
4
4
  "type": "module",
5
5
  "description": "FlyDocs AI CLI — install, setup, and manage FlyDocs projects",
6
6
  "bin": {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.0-beta.5",
2
+ "version": "0.5.0-beta.6",
3
3
  "sourceRepo": "github.com/plastrlab/flydocs-core",
4
4
  "tier": "cloud",
5
5
  "setupComplete": false,
@@ -1 +1 @@
1
- 0.5.0-beta.5
1
+ 0.5.0-beta.6
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.0-beta.5",
2
+ "version": "0.5.0-beta.6",
3
3
  "description": "FlyDocs Core - Manifest of all managed files",
4
4
  "repository": "github.com/plastrlab/flydocs-core",
5
5