skystream-cli 1.2.2 → 1.2.4
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 +32 -30
- 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.4');
|
|
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),
|
|
@@ -54,12 +55,12 @@ const JS_TEMPLATE = `(function() {
|
|
|
54
55
|
"Trending": [
|
|
55
56
|
new MultimediaItem({
|
|
56
57
|
title: "Example Movie",
|
|
57
|
-
url:
|
|
58
|
-
posterUrl:
|
|
58
|
+
url: \`\${manifest.baseUrl}/movie\`,
|
|
59
|
+
posterUrl: \`\${manifest.baseUrl}/poster.jpg\`,
|
|
59
60
|
type: "movie", // Valid types: movie, series, anime, livestream
|
|
60
|
-
bannerUrl:
|
|
61
|
+
bannerUrl: \`\${manifest.baseUrl}/banner.jpg\`, // (optional)
|
|
61
62
|
description: "Plot summary here...", // (optional)
|
|
62
|
-
headers: { "Referer":
|
|
63
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` } // (optional)
|
|
63
64
|
})
|
|
64
65
|
]
|
|
65
66
|
}
|
|
@@ -80,15 +81,15 @@ const JS_TEMPLATE = `(function() {
|
|
|
80
81
|
cb({
|
|
81
82
|
success: true,
|
|
82
83
|
data: [
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
84
|
+
new MultimediaItem({
|
|
85
|
+
title: "Example Movie",
|
|
86
|
+
url: \`\${manifest.baseUrl}/movie\`,
|
|
87
|
+
posterUrl: \`\${manifest.baseUrl}/poster.jpg\`,
|
|
88
|
+
type: "movie", // Valid types: movie, series, anime, livestream
|
|
89
|
+
bannerUrl: \`\${manifest.baseUrl}/banner.jpg\`, // (optional)
|
|
90
|
+
description: "Plot summary here...", // (optional)
|
|
91
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` } // (optional)
|
|
92
|
+
})
|
|
92
93
|
]
|
|
93
94
|
});
|
|
94
95
|
} catch (e) {
|
|
@@ -109,20 +110,20 @@ const JS_TEMPLATE = `(function() {
|
|
|
109
110
|
data: new MultimediaItem({
|
|
110
111
|
title: "Example Movie Full Details",
|
|
111
112
|
url: url,
|
|
112
|
-
posterUrl:
|
|
113
|
+
posterUrl: \`\${manifest.baseUrl}/poster.jpg\`,
|
|
113
114
|
type: "movie", // Valid types: movie, series, anime, livestream
|
|
114
|
-
bannerUrl:
|
|
115
|
+
bannerUrl: \`\${manifest.baseUrl}/banner.jpg\`, // (optional)
|
|
115
116
|
description: "This is a detailed description of the movie.", // (optional)
|
|
116
|
-
headers: { "Referer":
|
|
117
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }, // (optional)
|
|
117
118
|
episodes: [
|
|
118
119
|
new Episode({
|
|
119
120
|
name: "Episode 1",
|
|
120
|
-
url:
|
|
121
|
+
url: \`\${manifest.baseUrl}/watch/1\`,
|
|
121
122
|
season: 1, // (optional)
|
|
122
123
|
episode: 1, // (optional)
|
|
123
124
|
description: "Episode summary...", // (optional)
|
|
124
|
-
posterUrl:
|
|
125
|
-
headers: { "Referer":
|
|
125
|
+
posterUrl: \`\${manifest.baseUrl}/ep-poster.jpg\`, // (optional)
|
|
126
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` } // (optional)
|
|
126
127
|
})
|
|
127
128
|
]
|
|
128
129
|
})
|
|
@@ -146,9 +147,9 @@ const JS_TEMPLATE = `(function() {
|
|
|
146
147
|
new StreamResult({
|
|
147
148
|
url: "https://test-streams.mux.dev/x36xhzz/x36xhzz.m3u8",
|
|
148
149
|
quality: "1080p", // (optional)
|
|
149
|
-
headers: { "Referer":
|
|
150
|
+
headers: { "Referer": \`\${manifest.baseUrl}\` }, // (optional)
|
|
150
151
|
subtitles: [
|
|
151
|
-
{ url:
|
|
152
|
+
{ url: \`\${manifest.baseUrl}/sub.vtt\`, label: "English", lang: "en" } // (optional)
|
|
152
153
|
],
|
|
153
154
|
drmKid: "kid_value", // (optional)
|
|
154
155
|
drmKey: "key_value", // (optional)
|
|
@@ -227,21 +228,21 @@ jobs:
|
|
|
227
228
|
with:
|
|
228
229
|
node-version: '20'
|
|
229
230
|
|
|
230
|
-
- name:
|
|
231
|
+
- name: Deploy Repository
|
|
231
232
|
run: |
|
|
232
233
|
npm install -g skystream-cli
|
|
233
|
-
skystream
|
|
234
|
+
skystream deploy -u https://raw.githubusercontent.com/\${{ github.repository }}/main
|
|
234
235
|
|
|
235
236
|
- name: Commit and Push changes
|
|
236
237
|
run: |
|
|
237
238
|
git config --global user.name "github-actions[bot]"
|
|
238
239
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
|
239
240
|
git add .
|
|
240
|
-
git commit -m "chore: automated
|
|
241
|
+
git commit -m "chore: automated deploy [skip ci]" || echo "No changes to commit"
|
|
241
242
|
git push
|
|
242
243
|
`;
|
|
243
244
|
async function updatePluginsJson(rootDir) {
|
|
244
|
-
// Logic removed:
|
|
245
|
+
// Logic removed: deploy command now handles dynamic generation in dist/
|
|
245
246
|
}
|
|
246
247
|
program.command('init')
|
|
247
248
|
.description('Initialize a Sky Gen 2 Repository project')
|
|
@@ -284,6 +285,7 @@ program.command('init')
|
|
|
284
285
|
packageName: `${packageName}.${pluginSlug}`,
|
|
285
286
|
name: pluginName,
|
|
286
287
|
version: 1,
|
|
288
|
+
baseUrl: "https://example.com",
|
|
287
289
|
description: `${pluginName} plugin (Sky Gen 2)`,
|
|
288
290
|
authors: [options.author],
|
|
289
291
|
languages: ["en"],
|
|
@@ -320,6 +322,7 @@ program.command('add')
|
|
|
320
322
|
packageName: `${packageName}.${pluginSlug}`,
|
|
321
323
|
name: pluginName,
|
|
322
324
|
version: 1,
|
|
325
|
+
baseUrl: "https://example.com",
|
|
323
326
|
description: options.description || `${pluginName} plugin for ${repo.name}`,
|
|
324
327
|
authors: [options.author || repo.author || "Developer"],
|
|
325
328
|
languages: ["en"],
|
|
@@ -413,8 +416,8 @@ program.command('test')
|
|
|
413
416
|
else
|
|
414
417
|
await fn(options.query, callback);
|
|
415
418
|
});
|
|
416
|
-
program.command('
|
|
417
|
-
.description('
|
|
419
|
+
program.command('deploy')
|
|
420
|
+
.description('Deploy all plugins and repository index')
|
|
418
421
|
.requiredOption('-u, --url <url>', 'Base hosting URL for .sky files')
|
|
419
422
|
.action(async (options) => {
|
|
420
423
|
const rootDir = process.cwd();
|
|
@@ -449,7 +452,6 @@ program.command('build')
|
|
|
449
452
|
}
|
|
450
453
|
const finalRepo = {
|
|
451
454
|
...repo,
|
|
452
|
-
updatedAt: new Date().toISOString(),
|
|
453
455
|
pluginLists: [`${distUrl}/plugins.json`]
|
|
454
456
|
};
|
|
455
457
|
await fs.writeJson(repoPath, finalRepo, { spaces: 2 });
|
|
@@ -466,7 +468,7 @@ program.command('build')
|
|
|
466
468
|
console.log(`✓ Updated README.md with live URL`);
|
|
467
469
|
}
|
|
468
470
|
}
|
|
469
|
-
console.log(`\
|
|
471
|
+
console.log(`\nDeployment Complete. Assets generated in dist/`);
|
|
470
472
|
console.log(`\nYour Repo Link for the app:`);
|
|
471
473
|
console.log(`> ${baseRaw}/repo.json`);
|
|
472
474
|
});
|