@runloop/rl-cli 0.0.3 → 0.1.1

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.
Files changed (73) hide show
  1. package/README.md +64 -29
  2. package/dist/cli.js +401 -92
  3. package/dist/commands/auth.js +12 -11
  4. package/dist/commands/blueprint/create.js +108 -0
  5. package/dist/commands/blueprint/get.js +37 -0
  6. package/dist/commands/blueprint/list.js +293 -225
  7. package/dist/commands/blueprint/logs.js +40 -0
  8. package/dist/commands/blueprint/preview.js +45 -0
  9. package/dist/commands/devbox/create.js +10 -9
  10. package/dist/commands/devbox/delete.js +8 -8
  11. package/dist/commands/devbox/download.js +49 -0
  12. package/dist/commands/devbox/exec.js +23 -13
  13. package/dist/commands/devbox/execAsync.js +43 -0
  14. package/dist/commands/devbox/get.js +37 -0
  15. package/dist/commands/devbox/getAsync.js +37 -0
  16. package/dist/commands/devbox/list.js +328 -190
  17. package/dist/commands/devbox/logs.js +40 -0
  18. package/dist/commands/devbox/read.js +49 -0
  19. package/dist/commands/devbox/resume.js +37 -0
  20. package/dist/commands/devbox/rsync.js +118 -0
  21. package/dist/commands/devbox/scp.js +122 -0
  22. package/dist/commands/devbox/shutdown.js +37 -0
  23. package/dist/commands/devbox/ssh.js +104 -0
  24. package/dist/commands/devbox/suspend.js +37 -0
  25. package/dist/commands/devbox/tunnel.js +120 -0
  26. package/dist/commands/devbox/upload.js +10 -10
  27. package/dist/commands/devbox/write.js +51 -0
  28. package/dist/commands/mcp-http.js +37 -0
  29. package/dist/commands/mcp-install.js +120 -0
  30. package/dist/commands/mcp.js +30 -0
  31. package/dist/commands/menu.js +20 -20
  32. package/dist/commands/object/delete.js +37 -0
  33. package/dist/commands/object/download.js +88 -0
  34. package/dist/commands/object/get.js +37 -0
  35. package/dist/commands/object/list.js +112 -0
  36. package/dist/commands/object/upload.js +130 -0
  37. package/dist/commands/snapshot/create.js +12 -11
  38. package/dist/commands/snapshot/delete.js +8 -8
  39. package/dist/commands/snapshot/list.js +56 -97
  40. package/dist/commands/snapshot/status.js +37 -0
  41. package/dist/components/ActionsPopup.js +16 -13
  42. package/dist/components/Banner.js +4 -4
  43. package/dist/components/Breadcrumb.js +55 -5
  44. package/dist/components/DetailView.js +7 -4
  45. package/dist/components/DevboxActionsMenu.js +315 -178
  46. package/dist/components/DevboxCard.js +15 -14
  47. package/dist/components/DevboxCreatePage.js +147 -113
  48. package/dist/components/DevboxDetailPage.js +180 -102
  49. package/dist/components/ErrorMessage.js +5 -4
  50. package/dist/components/Header.js +4 -3
  51. package/dist/components/MainMenu.js +34 -33
  52. package/dist/components/MetadataDisplay.js +17 -9
  53. package/dist/components/OperationsMenu.js +6 -5
  54. package/dist/components/ResourceActionsMenu.js +117 -0
  55. package/dist/components/ResourceListView.js +213 -0
  56. package/dist/components/Spinner.js +5 -4
  57. package/dist/components/StatusBadge.js +81 -31
  58. package/dist/components/SuccessMessage.js +4 -3
  59. package/dist/components/Table.example.js +53 -23
  60. package/dist/components/Table.js +19 -11
  61. package/dist/hooks/useCursorPagination.js +125 -0
  62. package/dist/mcp/server-http.js +416 -0
  63. package/dist/mcp/server.js +397 -0
  64. package/dist/utils/CommandExecutor.js +16 -12
  65. package/dist/utils/client.js +7 -7
  66. package/dist/utils/config.js +130 -4
  67. package/dist/utils/interactiveCommand.js +2 -2
  68. package/dist/utils/output.js +17 -17
  69. package/dist/utils/ssh.js +160 -0
  70. package/dist/utils/sshSession.js +16 -12
  71. package/dist/utils/theme.js +22 -0
  72. package/dist/utils/url.js +4 -4
  73. package/package.json +29 -4
@@ -1,8 +1,58 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import React from 'react';
3
- import { Box, Text } from 'ink';
4
- export const Breadcrumb = React.memo(({ items }) => {
2
+ import React from "react";
3
+ import { Box, Text } from "ink";
4
+ import { colors } from "../utils/theme.js";
5
+ import { VERSION } from "../cli.js";
6
+ // Version check component
7
+ const VersionCheck = () => {
8
+ const [updateAvailable, setUpdateAvailable] = React.useState(null);
9
+ const [isChecking, setIsChecking] = React.useState(true);
10
+ React.useEffect(() => {
11
+ const checkForUpdates = async () => {
12
+ try {
13
+ const currentVersion = process.env.npm_package_version || "0.0.1";
14
+ const response = await fetch("https://registry.npmjs.org/@runloop/rl-cli/latest");
15
+ if (response.ok) {
16
+ const data = await response.json();
17
+ const latestVersion = data.version;
18
+ if (latestVersion && latestVersion !== currentVersion) {
19
+ // Check if current version is older than latest
20
+ const compareVersions = (version1, version2) => {
21
+ const v1parts = version1.split('.').map(Number);
22
+ const v2parts = version2.split('.').map(Number);
23
+ for (let i = 0; i < Math.max(v1parts.length, v2parts.length); i++) {
24
+ const v1part = v1parts[i] || 0;
25
+ const v2part = v2parts[i] || 0;
26
+ if (v1part > v2part)
27
+ return 1;
28
+ if (v1part < v2part)
29
+ return -1;
30
+ }
31
+ return 0;
32
+ };
33
+ const isUpdateAvailable = compareVersions(latestVersion, currentVersion) > 0;
34
+ if (isUpdateAvailable) {
35
+ setUpdateAvailable(latestVersion);
36
+ }
37
+ }
38
+ }
39
+ }
40
+ catch (error) {
41
+ // Silently fail
42
+ }
43
+ finally {
44
+ setIsChecking(false);
45
+ }
46
+ };
47
+ checkForUpdates();
48
+ }, []);
49
+ if (isChecking || !updateAvailable) {
50
+ return null;
51
+ }
52
+ return (_jsxs(Box, { children: [_jsx(Text, { color: colors.primary, bold: true, children: "\u2728" }), _jsxs(Text, { color: colors.text, bold: true, children: [" ", "Update available:", " "] }), _jsx(Text, { color: colors.textDim, dimColor: true, children: VERSION }), _jsxs(Text, { color: colors.primary, bold: true, children: [" ", "\u2192", " "] }), _jsx(Text, { color: colors.success, bold: true, children: updateAvailable }), _jsxs(Text, { color: colors.textDim, dimColor: true, children: [" ", "\u2022 Run:", " "] }), _jsx(Text, { color: colors.primary, bold: true, children: "npm install -g @runloop/rl-cli@latest" })] }));
53
+ };
54
+ export const Breadcrumb = React.memo(({ items, showVersionCheck = false }) => {
5
55
  const env = process.env.RUNLOOP_ENV?.toLowerCase();
6
- const isDevEnvironment = env === 'dev';
7
- return (_jsx(Box, { marginBottom: 1, paddingX: 2, paddingY: 0, children: _jsxs(Box, { borderStyle: "round", borderColor: "cyan", paddingX: 2, paddingY: 0, children: [_jsx(Text, { color: "cyan", bold: true, children: "rl" }), isDevEnvironment && _jsx(Text, { color: "redBright", bold: true, children: " (dev)" }), _jsx(Text, { color: "gray", dimColor: true, children: " \u203A " }), items.map((item, index) => (_jsxs(React.Fragment, { children: [_jsx(Text, { color: item.active ? 'white' : 'gray', bold: item.active, dimColor: !item.active, children: item.label }), index < items.length - 1 && (_jsx(Text, { color: "gray", dimColor: true, children: " \u203A " }))] }, index)))] }) }));
56
+ const isDevEnvironment = env === "dev";
57
+ return (_jsxs(Box, { marginBottom: 1, paddingX: 1, paddingY: 0, flexDirection: "column", children: [_jsxs(Box, { borderStyle: "round", borderColor: colors.primary, paddingX: 2, paddingY: 0, children: [_jsx(Text, { color: colors.primary, bold: true, children: "rl" }), isDevEnvironment && (_jsxs(Text, { color: "redBright", bold: true, children: [" ", "(dev)"] })), _jsxs(Text, { color: colors.textDim, dimColor: true, children: [" ", "\u203A", " "] }), items.map((item, index) => (_jsxs(React.Fragment, { children: [_jsx(Text, { color: item.active ? colors.text : colors.textDim, bold: item.active, dimColor: !item.active, children: item.label }), index < items.length - 1 && (_jsxs(Text, { color: colors.textDim, dimColor: true, children: [" ", "\u203A", " "] }))] }, index)))] }), showVersionCheck && (_jsx(Box, { paddingX: 2, marginTop: 0, children: _jsx(VersionCheck, {}) }))] }));
8
58
  });
@@ -1,17 +1,19 @@
1
1
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { Box, Text } from 'ink';
2
+ import { Box, Text } from "ink";
3
+ import { colors } from "../utils/theme.js";
3
4
  /**
4
5
  * Reusable detail view component for displaying entity information
5
6
  * Organizes data into sections with labeled items
6
7
  */
7
8
  export const DetailView = ({ sections }) => {
8
- return (_jsx(Box, { flexDirection: "column", gap: 1, children: sections.map((section, sectionIndex) => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: "yellow", bold: true, children: section.title }), section.items.map((item, itemIndex) => (_jsx(Box, { children: _jsxs(Text, { color: item.color || 'gray', dimColor: true, children: [item.label, ": ", item.value] }) }, itemIndex))), sectionIndex < sections.length - 1 && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { children: " " }) }))] }, sectionIndex))) }));
9
+ return (_jsx(Box, { flexDirection: "column", gap: 1, children: sections.map((section, sectionIndex) => (_jsxs(Box, { flexDirection: "column", children: [_jsx(Text, { color: colors.warning, bold: true, children: section.title }), section.items.map((item, itemIndex) => (_jsx(Box, { children: _jsxs(Text, { color: item.color || colors.textDim, dimColor: true, children: [item.label, ": ", item.value] }) }, itemIndex))), sectionIndex < sections.length - 1 && (_jsx(Box, { marginTop: 1, children: _jsx(Text, { children: " " }) }))] }, sectionIndex))) }));
9
10
  };
10
11
  /**
11
12
  * Helper to build detail sections from an object
12
13
  */
13
14
  export function buildDetailSections(data, config) {
14
- return Object.entries(config).map(([sectionName, sectionConfig]) => ({
15
+ return Object.entries(config)
16
+ .map(([sectionName, sectionConfig]) => ({
15
17
  title: sectionName,
16
18
  items: sectionConfig.fields
17
19
  .map((field) => {
@@ -25,5 +27,6 @@ export function buildDetailSections(data, config) {
25
27
  };
26
28
  })
27
29
  .filter(Boolean),
28
- })).filter((section) => section.items.length > 0);
30
+ }))
31
+ .filter((section) => section.items.length > 0);
29
32
  }