@flydocs/cli 0.5.0-beta.4 → 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.4";
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"() {
@@ -1614,10 +1614,7 @@ var init_install = __esm({
1614
1614
  console.log();
1615
1615
  }
1616
1616
  if (!await pathExists(join11(targetDir, ".git"))) {
1617
- printError(
1618
- "Not in a git repository. Please run from the root of your project."
1619
- );
1620
- process.exit(1);
1617
+ printWarning("No git repository detected. Run git init when ready.");
1621
1618
  }
1622
1619
  await ensureDirectories(targetDir, tier);
1623
1620
  console.log("Installing framework files...");
@@ -1889,41 +1886,85 @@ var init_install = __esm({
1889
1886
  return false;
1890
1887
  }
1891
1888
  };
1892
- const hasClaude = isInstalled("claude");
1893
- const hasCursor = isInstalled("cursor");
1894
- const hasCode = isInstalled("code");
1895
- if (hasClaude) {
1896
- const launchClaude = await confirm2({
1897
- 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
1898
1896
  });
1899
- if (!isCancel3(launchClaude) && launchClaude) {
1900
- spawn("claude", ["/flydocs-setup"], {
1901
- cwd: targetDir,
1902
- stdio: "inherit"
1903
- });
1904
- return;
1905
- }
1906
- } else if (hasCursor) {
1907
- const launchCursor = await confirm2({
1908
- 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
1909
1904
  });
1910
- if (!isCancel3(launchCursor) && launchCursor) {
1911
- spawn("cursor", [targetDir], {
1912
- stdio: "ignore",
1913
- detached: true
1914
- }).unref();
1915
- printInfo("Cursor opening \u2014 paste /flydocs-setup in the chat panel");
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
1912
+ });
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
+ }
1916
1935
  }
1917
- } else if (hasCode) {
1918
- const launchCode = await confirm2({
1919
- 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
1920
1948
  });
1921
- if (!isCancel3(launchCode) && launchCode) {
1922
- spawn("code", [targetDir], {
1923
- stdio: "ignore",
1924
- detached: true
1925
- }).unref();
1926
- 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
+ }
1927
1968
  }
1928
1969
  }
1929
1970
  } catch {
@@ -1948,7 +1989,7 @@ __export(update_exports, {
1948
1989
  import { defineCommand as defineCommand2 } from "citty";
1949
1990
  import { resolve as resolve3, join as join12 } from "path";
1950
1991
  import { mkdir as mkdir5, cp as cp2, readFile as readFile8, readdir as readdir3, rm as rm4 } from "fs/promises";
1951
- 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";
1952
1993
  import pc6 from "picocolors";
1953
1994
  var update_default;
1954
1995
  var init_update = __esm({
@@ -2014,7 +2055,7 @@ var init_update = __esm({
2014
2055
  } else if (args.here) {
2015
2056
  targetDir = process.cwd();
2016
2057
  } else {
2017
- const choice = await select({
2058
+ const choice = await select2({
2018
2059
  message: "Which project would you like to update?",
2019
2060
  options: [
2020
2061
  {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@flydocs/cli",
3
- "version": "0.5.0-beta.4",
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.4",
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.4
1
+ 0.5.0-beta.6
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "0.5.0-beta.4",
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