@runloop/rl-cli 0.1.2 → 0.3.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.
Files changed (105) hide show
  1. package/README.md +54 -10
  2. package/dist/cli.js +79 -72
  3. package/dist/commands/auth.js +2 -2
  4. package/dist/commands/blueprint/create.js +31 -83
  5. package/dist/commands/blueprint/get.js +29 -34
  6. package/dist/commands/blueprint/list.js +278 -230
  7. package/dist/commands/blueprint/logs.js +133 -37
  8. package/dist/commands/config.js +118 -0
  9. package/dist/commands/devbox/create.js +120 -40
  10. package/dist/commands/devbox/delete.js +17 -33
  11. package/dist/commands/devbox/download.js +29 -43
  12. package/dist/commands/devbox/exec.js +22 -39
  13. package/dist/commands/devbox/execAsync.js +20 -37
  14. package/dist/commands/devbox/get.js +13 -35
  15. package/dist/commands/devbox/getAsync.js +12 -34
  16. package/dist/commands/devbox/list.js +241 -402
  17. package/dist/commands/devbox/logs.js +20 -38
  18. package/dist/commands/devbox/read.js +29 -43
  19. package/dist/commands/devbox/resume.js +13 -35
  20. package/dist/commands/devbox/rsync.js +26 -78
  21. package/dist/commands/devbox/scp.js +25 -79
  22. package/dist/commands/devbox/sendStdin.js +41 -0
  23. package/dist/commands/devbox/shutdown.js +13 -35
  24. package/dist/commands/devbox/ssh.js +46 -78
  25. package/dist/commands/devbox/suspend.js +13 -35
  26. package/dist/commands/devbox/tunnel.js +37 -88
  27. package/dist/commands/devbox/upload.js +28 -36
  28. package/dist/commands/devbox/write.js +29 -44
  29. package/dist/commands/mcp-http.js +6 -5
  30. package/dist/commands/mcp-install.js +12 -10
  31. package/dist/commands/mcp.js +5 -4
  32. package/dist/commands/menu.js +26 -67
  33. package/dist/commands/object/delete.js +12 -34
  34. package/dist/commands/object/download.js +26 -74
  35. package/dist/commands/object/get.js +12 -34
  36. package/dist/commands/object/list.js +15 -93
  37. package/dist/commands/object/upload.js +35 -96
  38. package/dist/commands/snapshot/create.js +23 -39
  39. package/dist/commands/snapshot/delete.js +17 -33
  40. package/dist/commands/snapshot/get.js +16 -0
  41. package/dist/commands/snapshot/list.js +309 -80
  42. package/dist/commands/snapshot/status.js +12 -34
  43. package/dist/components/ActionsPopup.js +64 -39
  44. package/dist/components/Banner.js +7 -1
  45. package/dist/components/Breadcrumb.js +11 -48
  46. package/dist/components/DevboxActionsMenu.js +117 -207
  47. package/dist/components/DevboxCreatePage.js +12 -7
  48. package/dist/components/DevboxDetailPage.js +76 -28
  49. package/dist/components/ErrorBoundary.js +29 -0
  50. package/dist/components/ErrorMessage.js +10 -2
  51. package/dist/components/Header.js +12 -4
  52. package/dist/components/InteractiveSpawn.js +104 -0
  53. package/dist/components/LogsViewer.js +169 -0
  54. package/dist/components/MainMenu.js +37 -33
  55. package/dist/components/MetadataDisplay.js +4 -4
  56. package/dist/components/OperationsMenu.js +1 -1
  57. package/dist/components/ResourceActionsMenu.js +4 -4
  58. package/dist/components/ResourceListView.js +46 -34
  59. package/dist/components/Spinner.js +7 -2
  60. package/dist/components/StatusBadge.js +1 -1
  61. package/dist/components/SuccessMessage.js +12 -2
  62. package/dist/components/Table.js +16 -6
  63. package/dist/components/UpdateNotification.js +56 -0
  64. package/dist/hooks/useCursorPagination.js +125 -85
  65. package/dist/hooks/useExitOnCtrlC.js +15 -0
  66. package/dist/hooks/useViewportHeight.js +47 -0
  67. package/dist/mcp/server-http.js +2 -1
  68. package/dist/mcp/server.js +71 -7
  69. package/dist/router/Router.js +70 -0
  70. package/dist/router/types.js +1 -0
  71. package/dist/screens/BlueprintListScreen.js +7 -0
  72. package/dist/screens/BlueprintLogsScreen.js +74 -0
  73. package/dist/screens/DevboxActionsScreen.js +25 -0
  74. package/dist/screens/DevboxCreateScreen.js +11 -0
  75. package/dist/screens/DevboxDetailScreen.js +60 -0
  76. package/dist/screens/DevboxListScreen.js +23 -0
  77. package/dist/screens/LogsSessionScreen.js +49 -0
  78. package/dist/screens/MenuScreen.js +23 -0
  79. package/dist/screens/SSHSessionScreen.js +55 -0
  80. package/dist/screens/SnapshotListScreen.js +7 -0
  81. package/dist/services/blueprintService.js +101 -0
  82. package/dist/services/devboxService.js +215 -0
  83. package/dist/services/snapshotService.js +81 -0
  84. package/dist/store/blueprintStore.js +89 -0
  85. package/dist/store/devboxStore.js +105 -0
  86. package/dist/store/index.js +7 -0
  87. package/dist/store/navigationStore.js +101 -0
  88. package/dist/store/snapshotStore.js +87 -0
  89. package/dist/utils/client.js +4 -2
  90. package/dist/utils/config.js +22 -111
  91. package/dist/utils/interactiveCommand.js +3 -2
  92. package/dist/utils/logFormatter.js +208 -0
  93. package/dist/utils/memoryMonitor.js +85 -0
  94. package/dist/utils/output.js +153 -61
  95. package/dist/utils/process.js +106 -0
  96. package/dist/utils/processUtils.js +135 -0
  97. package/dist/utils/screen.js +61 -0
  98. package/dist/utils/ssh.js +6 -3
  99. package/dist/utils/sshSession.js +5 -29
  100. package/dist/utils/terminalDetection.js +185 -0
  101. package/dist/utils/terminalSync.js +39 -0
  102. package/dist/utils/theme.js +162 -13
  103. package/dist/utils/versionCheck.js +53 -0
  104. package/dist/version.js +12 -0
  105. package/package.json +19 -17
@@ -0,0 +1,53 @@
1
+ import { shouldCheckForUpdates, updateCheckCache } from "./config.js";
2
+ import { VERSION } from "../cli.js";
3
+ /**
4
+ * Check if a new version is available on npm
5
+ * Uses caching to avoid checking too frequently
6
+ */
7
+ export async function checkForUpdates() {
8
+ const currentVersion = VERSION;
9
+ // Check if we should check for updates (respects cache)
10
+ if (!shouldCheckForUpdates()) {
11
+ return {
12
+ isUpdateAvailable: false,
13
+ latestVersion: null,
14
+ currentVersion,
15
+ };
16
+ }
17
+ try {
18
+ // Fetch latest version from npm registry
19
+ const response = await fetch("https://registry.npmjs.org/@runloop/rl-cli/latest", {
20
+ headers: {
21
+ Accept: "application/json",
22
+ },
23
+ });
24
+ if (!response.ok) {
25
+ // If fetch fails, don't show update message
26
+ return {
27
+ isUpdateAvailable: false,
28
+ latestVersion: null,
29
+ currentVersion,
30
+ };
31
+ }
32
+ const data = (await response.json());
33
+ const latestVersion = data.version;
34
+ // Update the cache
35
+ updateCheckCache();
36
+ // Compare versions (simple string comparison works for semver)
37
+ const isUpdateAvailable = latestVersion !== currentVersion;
38
+ return {
39
+ isUpdateAvailable,
40
+ latestVersion,
41
+ currentVersion,
42
+ };
43
+ }
44
+ catch (error) {
45
+ // Silently fail - don't show update message if check fails
46
+ // This prevents network errors from disrupting the user experience
47
+ return {
48
+ isUpdateAvailable: false,
49
+ latestVersion: null,
50
+ currentVersion,
51
+ };
52
+ }
53
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * Version information for the CLI.
3
+ * Separated from cli.ts to allow importing without side effects.
4
+ */
5
+ import { readFileSync } from "fs";
6
+ import { fileURLToPath } from "url";
7
+ import { dirname, join } from "path";
8
+ // Get version from package.json
9
+ const __filename = fileURLToPath(import.meta.url);
10
+ const __dirname = dirname(__filename);
11
+ const packageJson = JSON.parse(readFileSync(join(__dirname, "../package.json"), "utf8"));
12
+ export const VERSION = packageJson.version;
package/package.json CHANGED
@@ -1,13 +1,14 @@
1
1
  {
2
2
  "name": "@runloop/rl-cli",
3
- "version": "0.1.2",
4
- "description": "Beautiful CLI for Runloop devbox management",
3
+ "version": "0.3.0",
4
+ "description": "Beautiful CLI for the Runloop platform",
5
5
  "type": "module",
6
6
  "bin": {
7
7
  "rli": "./dist/cli.js"
8
8
  },
9
9
  "scripts": {
10
10
  "build": "tsc",
11
+ "build:mcp": "npm run build && node scripts/build-mcp.js",
11
12
  "dev": "tsc --watch",
12
13
  "start": "node dist/cli.js",
13
14
  "prepublishOnly": "npm run build",
@@ -20,11 +21,9 @@
20
21
  "lint": "eslint src --ext .ts,.tsx",
21
22
  "lint:fix": "eslint src --ext .ts,.tsx --fix",
22
23
  "test": "jest",
23
- "test:unit": "jest tests/__tests__/unit",
24
- "test:integration": "jest tests/__tests__/integration",
25
24
  "test:watch": "jest --watch",
26
25
  "test:coverage": "jest --coverage",
27
- "test:e2e": "RUN_E2E=1 jest tests/__tests__/integration"
26
+ "test:components": "NODE_OPTIONS='--experimental-vm-modules' jest --config jest.components.config.js --coverage --forceExit"
28
27
  },
29
28
  "keywords": [
30
29
  "runloop",
@@ -55,37 +54,40 @@
55
54
  "access": "public"
56
55
  },
57
56
  "dependencies": {
58
- "@inkjs/ui": "^2.0.0",
59
57
  "@modelcontextprotocol/sdk": "^1.19.1",
60
- "@runloop/api-client": "^0.58.0",
61
- "@runloop/rl-cli": "^0.0.1",
58
+ "@runloop/api-client": "^1.0.0",
59
+ "@runloop/rl-cli": "^0.1.2",
62
60
  "@types/express": "^5.0.3",
63
61
  "chalk": "^5.3.0",
64
- "commander": "^12.1.0",
65
- "conf": "^13.0.1",
66
- "dotenv": "^16.4.5",
62
+ "commander": "^14.0.1",
63
+ "conf": "^15.0.2",
64
+ "dotenv": "^17.2.3",
67
65
  "express": "^5.1.0",
68
66
  "figures": "^6.1.0",
69
- "gradient-string": "^2.0.2",
70
- "ink": "^5.0.1",
67
+ "gradient-string": "^3.0.0",
68
+ "ink": "^6.3.1",
71
69
  "ink-big-text": "^2.0.0",
72
70
  "ink-gradient": "^3.0.0",
73
- "ink-link": "^4.1.0",
71
+ "ink-link": "^5.0.0",
74
72
  "ink-spinner": "^5.0.0",
75
73
  "ink-text-input": "^6.0.0",
76
- "react": "^18.3.1",
77
- "yaml": "^2.8.1"
74
+ "react": "19.2.0",
75
+ "yaml": "^2.8.1",
76
+ "zustand": "^5.0.2"
78
77
  },
79
78
  "devDependencies": {
79
+ "@anthropic-ai/mcpb": "^1.1.1",
80
80
  "@types/jest": "^29.5.0",
81
81
  "@types/node": "^22.7.9",
82
- "@types/react": "^18.3.11",
82
+ "@types/react": "^19.2.2",
83
83
  "@typescript-eslint/eslint-plugin": "^8.46.0",
84
84
  "@typescript-eslint/parser": "^8.46.0",
85
+ "esbuild": "^0.25.11",
85
86
  "eslint": "^9.37.0",
86
87
  "eslint-plugin-react": "^7.37.5",
87
88
  "eslint-plugin-react-hooks": "^6.1.1",
88
89
  "globals": "^16.4.0",
90
+ "ink-testing-library": "^4.0.0",
89
91
  "jest": "^29.7.0",
90
92
  "prettier": "^3.6.2",
91
93
  "ts-jest": "^29.1.0",