@limrun/cli 0.2.5 → 0.2.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/README.md
CHANGED
|
@@ -204,7 +204,9 @@ lim ios log com.example.myapp -f
|
|
|
204
204
|
```bash
|
|
205
205
|
lim ios record start
|
|
206
206
|
lim ios record start --quality 8
|
|
207
|
+
lim ios record stop
|
|
207
208
|
lim ios record stop -o recording.mp4
|
|
209
|
+
lim ios record stop --presigned-url https://example.com/upload
|
|
208
210
|
```
|
|
209
211
|
|
|
210
212
|
#### Xcode Integration
|
|
@@ -281,7 +283,9 @@ lim android open-url https://example.com
|
|
|
281
283
|
|
|
282
284
|
# Video recording
|
|
283
285
|
lim android record start
|
|
286
|
+
lim android record stop
|
|
284
287
|
lim android record stop -o recording.mp4
|
|
288
|
+
lim android record stop --presigned-url https://example.com/upload
|
|
285
289
|
```
|
|
286
290
|
|
|
287
291
|
#### ADB Tunnel
|
|
@@ -10,9 +10,11 @@ export default class ExecRecord extends BaseCommand {
|
|
|
10
10
|
static flags: {
|
|
11
11
|
quality: import("@oclif/core/lib/interfaces").OptionFlag<number, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
12
12
|
output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
|
+
'presigned-url': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
13
14
|
'api-key': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
|
|
14
15
|
json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
15
16
|
};
|
|
16
17
|
run(): Promise<void>;
|
|
18
|
+
private defaultRecordingPath;
|
|
17
19
|
}
|
|
18
20
|
//# sourceMappingURL=record.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/exec/record.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,MAAM,CAAC,OAAO,SAAyD;IACvE,MAAM,CAAC,OAAO,WAAoC;IAClD,MAAM,CAAC,QAAQ,
|
|
1
|
+
{"version":3,"file":"record.d.ts","sourceRoot":"","sources":["../../../src/commands/exec/record.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAGjD,MAAM,CAAC,OAAO,OAAO,UAAW,SAAQ,WAAW;IACjD,MAAM,CAAC,OAAO,SAAyD;IACvE,MAAM,CAAC,OAAO,WAAoC;IAClD,MAAM,CAAC,QAAQ,WAQb;IAEF,MAAM,CAAC,IAAI;;;MAGT;IAEF,MAAM,CAAC,KAAK;;;;;;MAKV;IAEI,GAAG,IAAI,OAAO,CAAC,IAAI,CAAC;IA+C1B,OAAO,CAAC,oBAAoB;CAI7B"}
|
|
@@ -29,27 +29,25 @@ class ExecRecord extends base_command_1.BaseCommand {
|
|
|
29
29
|
this.log('Recording started');
|
|
30
30
|
}
|
|
31
31
|
else {
|
|
32
|
-
const
|
|
33
|
-
|
|
34
|
-
|
|
32
|
+
const outputPath = flags.output ? path_1.default.resolve(flags.output) : this.defaultRecordingPath();
|
|
33
|
+
const saveTo = {
|
|
34
|
+
localPath: outputPath,
|
|
35
|
+
presignedUrl: flags['presigned-url'],
|
|
36
|
+
};
|
|
35
37
|
if ((0, instance_client_factory_1.hasActiveSession)(id)) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
else {
|
|
41
|
-
this.log(`Recording download URL: ${url}`);
|
|
38
|
+
await (0, instance_client_factory_1.sendSessionCommand)(id, 'stop-recording', [saveTo]);
|
|
39
|
+
this.log(`Recording saved to ${outputPath}`);
|
|
40
|
+
if (flags['presigned-url']) {
|
|
41
|
+
this.log('Recording uploaded using the provided presigned URL');
|
|
42
42
|
}
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
const { client, disconnect } = await (0, instance_client_factory_1.getInstanceClient)(this.client, id);
|
|
46
46
|
try {
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
else {
|
|
52
|
-
this.log(`Recording download URL: ${url}`);
|
|
47
|
+
await client.stopRecording(saveTo);
|
|
48
|
+
this.log(`Recording saved to ${outputPath}`);
|
|
49
|
+
if (flags['presigned-url']) {
|
|
50
|
+
this.log('Recording uploaded using the provided presigned URL');
|
|
53
51
|
}
|
|
54
52
|
}
|
|
55
53
|
finally {
|
|
@@ -59,13 +57,21 @@ class ExecRecord extends base_command_1.BaseCommand {
|
|
|
59
57
|
}
|
|
60
58
|
});
|
|
61
59
|
}
|
|
60
|
+
defaultRecordingPath() {
|
|
61
|
+
const timestamp = new Date().toISOString().replace(/[:.]/g, '-');
|
|
62
|
+
return path_1.default.join(process.cwd(), `video_${timestamp}.mp4`);
|
|
63
|
+
}
|
|
62
64
|
}
|
|
63
65
|
ExecRecord.summary = 'Start or stop video recording on a running instance';
|
|
64
66
|
ExecRecord.aliases = ['ios record', 'android record'];
|
|
65
67
|
ExecRecord.examples = [
|
|
66
68
|
'<%= config.bin %> ios record <instance-ID> start',
|
|
69
|
+
'<%= config.bin %> ios record <instance-ID> stop',
|
|
67
70
|
'<%= config.bin %> ios record <instance-ID> stop -o recording.mp4',
|
|
71
|
+
'<%= config.bin %> ios record <instance-ID> stop --presigned-url https://example.com/upload',
|
|
68
72
|
'<%= config.bin %> ios record <instance-ID> start --quality 8',
|
|
73
|
+
'<%= config.bin %> android record <instance-ID> stop',
|
|
74
|
+
'<%= config.bin %> android record <instance-ID> stop --presigned-url https://example.com/upload',
|
|
69
75
|
];
|
|
70
76
|
ExecRecord.args = {
|
|
71
77
|
action: core_1.Args.string({ description: 'start or stop', required: true, options: ['start', 'stop'] }),
|
|
@@ -75,6 +81,7 @@ ExecRecord.flags = {
|
|
|
75
81
|
...base_command_1.BaseCommand.baseFlags,
|
|
76
82
|
quality: core_1.Flags.integer({ description: 'Recording quality (5-10)', default: 5 }),
|
|
77
83
|
output: core_1.Flags.string({ char: 'o', description: 'Save recording to file (for stop action)' }),
|
|
84
|
+
'presigned-url': core_1.Flags.string({ description: 'Upload the recording directly using this presigned URL' }),
|
|
78
85
|
};
|
|
79
86
|
exports.default = ExecRecord;
|
|
80
87
|
//# sourceMappingURL=record.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/commands/exec/record.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,sCAA0C;AAC1C,qDAAiD;AACjD,+EAA4G;AAE5G,MAAqB,UAAW,SAAQ,0BAAW;
|
|
1
|
+
{"version":3,"file":"record.js","sourceRoot":"","sources":["../../../src/commands/exec/record.ts"],"names":[],"mappings":";;;;;AAAA,gDAAwB;AACxB,sCAA0C;AAC1C,qDAAiD;AACjD,+EAA4G;AAE5G,MAAqB,UAAW,SAAQ,0BAAW;IAyBjD,KAAK,CAAC,GAAG;QACP,MAAM,EAAE,IAAI,EAAE,KAAK,EAAE,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACrD,IAAI,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QAE3B,MAAM,IAAI,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE;YAC7B,MAAM,EAAE,GAAG,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;YACnC,IAAI,IAAI,CAAC,MAAM,KAAK,OAAO,EAAE,CAAC;gBAC5B,IAAI,IAAA,0CAAgB,EAAC,EAAE,CAAC,EAAE,CAAC;oBACzB,MAAM,IAAA,4CAAkB,EAAC,EAAE,EAAE,iBAAiB,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC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