skystream-cli 1.2.2 → 1.2.5
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 +68 -10
- package/dist/index.js +34 -31
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# SkyStream CLI
|
|
2
2
|
|
|
3
|
-
The official command-line toolkit for
|
|
3
|
+
The official command-line toolkit for deploying, testing, and managing SkyStream (Gen 2) plugin repositories.
|
|
4
4
|
|
|
5
5
|
## 🚀 Quick Start
|
|
6
6
|
|
|
@@ -23,21 +23,79 @@ cd my-universe
|
|
|
23
23
|
skystream add "New Provider"
|
|
24
24
|
```
|
|
25
25
|
|
|
26
|
-
###
|
|
26
|
+
### Deploy for Distribution
|
|
27
27
|
|
|
28
28
|
```bash
|
|
29
|
-
skystream
|
|
29
|
+
skystream deploy -u https://my-cdn.com/repo
|
|
30
30
|
```
|
|
31
31
|
|
|
32
32
|
## 🛠 Commands
|
|
33
33
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
### `init`
|
|
35
|
+
Initialize a new Sky Gen 2 Repository project.
|
|
36
|
+
|
|
37
|
+
**Usage:**
|
|
38
|
+
```bash
|
|
39
|
+
skystream init <project-name> --package-name <id> --plugin-name <name> [options]
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
**Options:**
|
|
43
|
+
- `-p, --package-name <id>`: **(Required)** Unique Repository ID (e.g., `com.dev.stars`).
|
|
44
|
+
- `-n, --plugin-name <name>`: **(Required)** First plugin name (e.g., `YTS`).
|
|
45
|
+
- `-d, --description <desc>`: Repository description (Default: `SkyStream plugins repository`).
|
|
46
|
+
- `-a, --author <author>`: Author name (Default: `Developer`).
|
|
47
|
+
|
|
48
|
+
---
|
|
49
|
+
|
|
50
|
+
### `add`
|
|
51
|
+
Add a new Sky Gen 2 plugin to an existing repository.
|
|
52
|
+
|
|
53
|
+
**Usage:**
|
|
54
|
+
```bash
|
|
55
|
+
skystream add <plugin-name> [options]
|
|
56
|
+
```
|
|
57
|
+
|
|
58
|
+
**Options:**
|
|
59
|
+
- `-d, --description <desc>`: Plugin description.
|
|
60
|
+
- `-a, --author <author>`: Author name.
|
|
61
|
+
|
|
62
|
+
---
|
|
63
|
+
|
|
64
|
+
### `validate`
|
|
65
|
+
Validate all plugins in the repository (manifests and logic exports).
|
|
66
|
+
|
|
67
|
+
**Usage:**
|
|
68
|
+
```bash
|
|
69
|
+
skystream validate
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
---
|
|
73
|
+
|
|
74
|
+
### `test`
|
|
75
|
+
Test a specific plugin in a mock runtime.
|
|
76
|
+
|
|
77
|
+
**Usage:**
|
|
78
|
+
```bash
|
|
79
|
+
skystream test [options]
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
**Options:**
|
|
83
|
+
- `-p, --path <path>`: Path to plugin folder (Default: `.`).
|
|
84
|
+
- `-f, --function <name>`: Function to test (Default: `getHome`).
|
|
85
|
+
- `-q, --query <query>`: Query string for functions like `search`.
|
|
86
|
+
|
|
87
|
+
---
|
|
88
|
+
|
|
89
|
+
### `deploy`
|
|
90
|
+
Bundle all plugins and generate the `repo.json` index.
|
|
91
|
+
|
|
92
|
+
**Usage:**
|
|
93
|
+
```bash
|
|
94
|
+
skystream deploy --url <url>
|
|
95
|
+
```
|
|
96
|
+
|
|
97
|
+
**Options:**
|
|
98
|
+
- `-u, --url <url>`: **(Required)** Base hosting URL where the `.sky` files will be served (e.g., `https://raw.githubusercontent.com/USER/REPO/main`).
|
|
41
99
|
|
|
42
100
|
## 📖 Learn More
|
|
43
101
|
Visit the [SkyStream Repository Specification](https://github.com/akashdh11/skystream) for more details.
|
package/dist/index.js
CHANGED
|
@@ -9,13 +9,14 @@ const program = new Command();
|
|
|
9
9
|
program
|
|
10
10
|
.name('skystream')
|
|
11
11
|
.description('SkyStream Plugin Development Kit CLI (Sky Gen 2)')
|
|
12
|
-
.version('1.2.
|
|
12
|
+
.version('1.2.5');
|
|
13
13
|
// Schemas
|
|
14
14
|
const pluginSchema = z.object({
|
|
15
15
|
packageName: z.string().min(5).regex(/^[a-z0-9._-]+$/),
|
|
16
16
|
name: z.string().min(1),
|
|
17
17
|
version: z.number().int().positive(),
|
|
18
18
|
description: z.string().min(1),
|
|
19
|
+
baseUrl: z.string().url(),
|
|
19
20
|
authors: z.array(z.string()).min(1),
|
|
20
21
|
languages: z.array(z.string()).min(1),
|
|
21
22
|
categories: z.array(z.string()).min(1),
|
|
@@ -39,7 +40,8 @@ const JS_TEMPLATE = `(function() {
|
|
|
39
40
|
/**
|
|
40
41
|
* @type {import('@skystream/sdk').Manifest}
|
|
41
42
|
*/
|
|
42
|
-
|
|
43
|
+
// var manifest is injected at runtime
|
|
44
|
+
|
|
43
45
|
|
|
44
46
|
/**
|
|
45
47
|
* Loads the home screen categories.
|
|
@@ -54,12 +56,12 @@ const JS_TEMPLATE = `(function() {
|
|
|
54
56
|
"Trending": [
|
|
55
57
|
new MultimediaItem({
|
|
56
58
|
title: "Example Movie",
|
|
57
|
-
url:
|
|
58
|
-
posterUrl:
|
|
59
|
+
url: \`\${manifest.baseUrl}/movie\`,
|
|
60
|
+
posterUrl: \`\${manifest.baseUrl}/poster.jpg\`,
|
|
59
61
|
type: "movie", // Valid types: movie, series, anime, livestream
|
|
60
|
-
bannerUrl:
|
|
62
|
+
bannerUrl: \`\${manifest.baseUrl}/banner.jpg\`, // (optional)
|
|
61
63
|
description: "Plot summary here...", // (optional)
|
|
62
|
-
headers: { "Referer":
|
|
64
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` } // (optional)
|
|
63
65
|
})
|
|
64
66
|
]
|
|
65
67
|
}
|
|
@@ -80,15 +82,15 @@ const JS_TEMPLATE = `(function() {
|
|
|
80
82
|
cb({
|
|
81
83
|
success: true,
|
|
82
84
|
data: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
85
|
+
new MultimediaItem({
|
|
86
|
+
title: "Example Movie",
|
|
87
|
+
url: \`\${manifest.baseUrl}/movie\`,
|
|
88
|
+
posterUrl: \`\${manifest.baseUrl}/poster.jpg\`,
|
|
89
|
+
type: "movie", // Valid types: movie, series, anime, livestream
|
|
90
|
+
bannerUrl: \`\${manifest.baseUrl}/banner.jpg\`, // (optional)
|
|
91
|
+
description: "Plot summary here...", // (optional)
|
|
92
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` } // (optional)
|
|
93
|
+
})
|
|
92
94
|
]
|
|
93
95
|
});
|
|
94
96
|
} catch (e) {
|
|
@@ -109,20 +111,20 @@ const JS_TEMPLATE = `(function() {
|
|
|
109
111
|
data: new MultimediaItem({
|
|
110
112
|
title: "Example Movie Full Details",
|
|
111
113
|
url: url,
|
|
112
|
-
posterUrl:
|
|
114
|
+
posterUrl: \`\${manifest.baseUrl}/poster.jpg\`,
|
|
113
115
|
type: "movie", // Valid types: movie, series, anime, livestream
|
|
114
|
-
bannerUrl:
|
|
116
|
+
bannerUrl: \`\${manifest.baseUrl}/banner.jpg\`, // (optional)
|
|
115
117
|
description: "This is a detailed description of the movie.", // (optional)
|
|
116
|
-
headers: { "Referer":
|
|
118
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }, // (optional)
|
|
117
119
|
episodes: [
|
|
118
120
|
new Episode({
|
|
119
121
|
name: "Episode 1",
|
|
120
|
-
url:
|
|
122
|
+
url: \`\${manifest.baseUrl}/watch/1\`,
|
|
121
123
|
season: 1, // (optional)
|
|
122
124
|
episode: 1, // (optional)
|
|
123
125
|
description: "Episode summary...", // (optional)
|
|
124
|
-
posterUrl:
|
|
125
|
-
headers: { "Referer":
|
|
126
|
+
posterUrl: \`\${manifest.baseUrl}/ep-poster.jpg\`, // (optional)
|
|
127
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` } // (optional)
|
|
126
128
|
})
|
|
127
129
|
]
|
|
128
130
|
})
|
|
@@ -146,9 +148,9 @@ const JS_TEMPLATE = `(function() {
|
|
|
146
148
|
new StreamResult({
|
|
147
149
|
url: "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
|
|
148
150
|
quality: "1080p", // (optional)
|
|
149
|
-
headers: { "Referer":
|
|
151
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }, // (optional)
|
|
150
152
|
subtitles: [
|
|
151
|
-
{ url:
|
|
153
|
+
{ url: \`\${manifest.baseUrl}/sub.vtt\`, label: "English", lang: "en" } // (optional)
|
|
152
154
|
],
|
|
153
155
|
drmKid: "kid_value", // (optional)
|
|
154
156
|
drmKey: "key_value", // (optional)
|
|
@@ -227,21 +229,21 @@ jobs:
|
|
|
227
229
|
with:
|
|
228
230
|
node-version: '20'
|
|
229
231
|
|
|
230
|
-
- name:
|
|
232
|
+
- name: Deploy Repository
|
|
231
233
|
run: |
|
|
232
234
|
npm install -g skystream-cli
|
|
233
|
-
skystream
|
|
235
|
+
skystream deploy -u https://raw.githubusercontent.com/\${{ github.repository }}/main
|
|
234
236
|
|
|
235
237
|
- name: Commit and Push changes
|
|
236
238
|
run: |
|
|
237
239
|
git config --global user.name "github-actions[bot]"
|
|
238
240
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
239
241
|
git add .
|
|
240
|
-
git commit -m "chore: automated
|
|
242
|
+
git commit -m "chore: automated deploy [skip ci]" || echo "No changes to commit"
|
|
241
243
|
git push
|
|
242
244
|
`;
|
|
243
245
|
async function updatePluginsJson(rootDir) {
|
|
244
|
-
// Logic removed:
|
|
246
|
+
// Logic removed: deploy command now handles dynamic generation in dist/
|
|
245
247
|
}
|
|
246
248
|
program.command('init')
|
|
247
249
|
.description('Initialize a Sky Gen 2 Repository project')
|
|
@@ -284,6 +286,7 @@ program.command('init')
|
|
|
284
286
|
packageName: `${packageName}.${pluginSlug}`,
|
|
285
287
|
name: pluginName,
|
|
286
288
|
version: 1,
|
|
289
|
+
baseUrl: "https://example.com",
|
|
287
290
|
description: `${pluginName} plugin (Sky Gen 2)`,
|
|
288
291
|
authors: [options.author],
|
|
289
292
|
languages: ["en"],
|
|
@@ -320,6 +323,7 @@ program.command('add')
|
|
|
320
323
|
packageName: `${packageName}.${pluginSlug}`,
|
|
321
324
|
name: pluginName,
|
|
322
325
|
version: 1,
|
|
326
|
+
baseUrl: "https://example.com",
|
|
323
327
|
description: options.description || `${pluginName} plugin for ${repo.name}`,
|
|
324
328
|
authors: [options.author || repo.author || "Developer"],
|
|
325
329
|
languages: ["en"],
|
|
@@ -413,8 +417,8 @@ program.command('test')
|
|
|
413
417
|
else
|
|
414
418
|
await fn(options.query, callback);
|
|
415
419
|
});
|
|
416
|
-
program.command('
|
|
417
|
-
.description('
|
|
420
|
+
program.command('deploy')
|
|
421
|
+
.description('Deploy all plugins and repository index')
|
|
418
422
|
.requiredOption('-u, --url <url>', 'Base hosting URL for .sky files')
|
|
419
423
|
.action(async (options) => {
|
|
420
424
|
const rootDir = process.cwd();
|
|
@@ -449,7 +453,6 @@ program.command('build')
|
|
|
449
453
|
}
|
|
450
454
|
const finalRepo = {
|
|
451
455
|
...repo,
|
|
452
|
-
updatedAt: new Date().toISOString(),
|
|
453
456
|
pluginLists: [`${distUrl}/plugins.json`]
|
|
454
457
|
};
|
|
455
458
|
await fs.writeJson(repoPath, finalRepo, { spaces: 2 });
|
|
@@ -466,7 +469,7 @@ program.command('build')
|
|
|
466
469
|
console.log(`✓ Updated README.md with live URL`);
|
|
467
470
|
}
|
|
468
471
|
}
|
|
469
|
-
console.log(`\
|
|
472
|
+
console.log(`\nDeployment Complete. Assets generated in dist/`);
|
|
470
473
|
console.log(`\nYour Repo Link for the app:`);
|
|
471
474
|
console.log(`> ${baseRaw}/repo.json`);
|
|
472
475
|
});
|