@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.
- package/README.md +54 -10
- package/dist/cli.js +79 -72
- package/dist/commands/auth.js +2 -2
- package/dist/commands/blueprint/create.js +31 -83
- package/dist/commands/blueprint/get.js +29 -34
- package/dist/commands/blueprint/list.js +278 -230
- package/dist/commands/blueprint/logs.js +133 -37
- package/dist/commands/config.js +118 -0
- package/dist/commands/devbox/create.js +120 -40
- package/dist/commands/devbox/delete.js +17 -33
- package/dist/commands/devbox/download.js +29 -43
- package/dist/commands/devbox/exec.js +22 -39
- package/dist/commands/devbox/execAsync.js +20 -37
- package/dist/commands/devbox/get.js +13 -35
- package/dist/commands/devbox/getAsync.js +12 -34
- package/dist/commands/devbox/list.js +241 -402
- package/dist/commands/devbox/logs.js +20 -38
- package/dist/commands/devbox/read.js +29 -43
- package/dist/commands/devbox/resume.js +13 -35
- package/dist/commands/devbox/rsync.js +26 -78
- package/dist/commands/devbox/scp.js +25 -79
- package/dist/commands/devbox/sendStdin.js +41 -0
- package/dist/commands/devbox/shutdown.js +13 -35
- package/dist/commands/devbox/ssh.js +46 -78
- package/dist/commands/devbox/suspend.js +13 -35
- package/dist/commands/devbox/tunnel.js +37 -88
- package/dist/commands/devbox/upload.js +28 -36
- package/dist/commands/devbox/write.js +29 -44
- package/dist/commands/mcp-http.js +6 -5
- package/dist/commands/mcp-install.js +12 -10
- package/dist/commands/mcp.js +5 -4
- package/dist/commands/menu.js +26 -67
- package/dist/commands/object/delete.js +12 -34
- package/dist/commands/object/download.js +26 -74
- package/dist/commands/object/get.js +12 -34
- package/dist/commands/object/list.js +15 -93
- package/dist/commands/object/upload.js +35 -96
- package/dist/commands/snapshot/create.js +23 -39
- package/dist/commands/snapshot/delete.js +17 -33
- package/dist/commands/snapshot/get.js +16 -0
- package/dist/commands/snapshot/list.js +309 -80
- package/dist/commands/snapshot/status.js +12 -34
- package/dist/components/ActionsPopup.js +64 -39
- package/dist/components/Banner.js +7 -1
- package/dist/components/Breadcrumb.js +11 -48
- package/dist/components/DevboxActionsMenu.js +117 -207
- package/dist/components/DevboxCreatePage.js +12 -7
- package/dist/components/DevboxDetailPage.js +76 -28
- package/dist/components/ErrorBoundary.js +29 -0
- package/dist/components/ErrorMessage.js +10 -2
- package/dist/components/Header.js +12 -4
- package/dist/components/InteractiveSpawn.js +104 -0
- package/dist/components/LogsViewer.js +169 -0
- package/dist/components/MainMenu.js +37 -33
- package/dist/components/MetadataDisplay.js +4 -4
- package/dist/components/OperationsMenu.js +1 -1
- package/dist/components/ResourceActionsMenu.js +4 -4
- package/dist/components/ResourceListView.js +46 -34
- package/dist/components/Spinner.js +7 -2
- package/dist/components/StatusBadge.js +1 -1
- package/dist/components/SuccessMessage.js +12 -2
- package/dist/components/Table.js +16 -6
- package/dist/components/UpdateNotification.js +56 -0
- package/dist/hooks/useCursorPagination.js +125 -85
- package/dist/hooks/useExitOnCtrlC.js +15 -0
- package/dist/hooks/useViewportHeight.js +47 -0
- package/dist/mcp/server-http.js +2 -1
- package/dist/mcp/server.js +71 -7
- package/dist/router/Router.js +70 -0
- package/dist/router/types.js +1 -0
- package/dist/screens/BlueprintListScreen.js +7 -0
- package/dist/screens/BlueprintLogsScreen.js +74 -0
- package/dist/screens/DevboxActionsScreen.js +25 -0
- package/dist/screens/DevboxCreateScreen.js +11 -0
- package/dist/screens/DevboxDetailScreen.js +60 -0
- package/dist/screens/DevboxListScreen.js +23 -0
- package/dist/screens/LogsSessionScreen.js +49 -0
- package/dist/screens/MenuScreen.js +23 -0
- package/dist/screens/SSHSessionScreen.js +55 -0
- package/dist/screens/SnapshotListScreen.js +7 -0
- package/dist/services/blueprintService.js +101 -0
- package/dist/services/devboxService.js +215 -0
- package/dist/services/snapshotService.js +81 -0
- package/dist/store/blueprintStore.js +89 -0
- package/dist/store/devboxStore.js +105 -0
- package/dist/store/index.js +7 -0
- package/dist/store/navigationStore.js +101 -0
- package/dist/store/snapshotStore.js +87 -0
- package/dist/utils/client.js +4 -2
- package/dist/utils/config.js +22 -111
- package/dist/utils/interactiveCommand.js +3 -2
- package/dist/utils/logFormatter.js +208 -0
- package/dist/utils/memoryMonitor.js +85 -0
- package/dist/utils/output.js +153 -61
- package/dist/utils/process.js +106 -0
- package/dist/utils/processUtils.js +135 -0
- package/dist/utils/screen.js +61 -0
- package/dist/utils/ssh.js +6 -3
- package/dist/utils/sshSession.js +5 -29
- package/dist/utils/terminalDetection.js +185 -0
- package/dist/utils/terminalSync.js +39 -0
- package/dist/utils/theme.js +162 -13
- package/dist/utils/versionCheck.js +53 -0
- package/dist/version.js +12 -0
- 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
|
+
}
|
package/dist/version.js
ADDED
|
@@ -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.
|
|
4
|
-
"description": "Beautiful CLI for Runloop
|
|
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:
|
|
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.
|
|
61
|
-
"@runloop/rl-cli": "^0.
|
|
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": "^
|
|
65
|
-
"conf": "^
|
|
66
|
-
"dotenv": "^
|
|
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": "^
|
|
70
|
-
"ink": "^
|
|
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": "^
|
|
71
|
+
"ink-link": "^5.0.0",
|
|
74
72
|
"ink-spinner": "^5.0.0",
|
|
75
73
|
"ink-text-input": "^6.0.0",
|
|
76
|
-
"react": "
|
|
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": "^
|
|
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",
|