rss-skill-cli 0.1.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 ADDED
@@ -0,0 +1,45 @@
1
+ # @rss-skill/cli
2
+
3
+ RSS skill pack for AI coding assistants (Claude Code, Cursor, Cline, etc.)
4
+
5
+ ## Installation
6
+
7
+ ```bash
8
+ npm install -g @rss-skill/cli
9
+ ```
10
+
11
+ ## Usage
12
+
13
+ Initialize skills in your project directory:
14
+
15
+ ```bash
16
+ # Interactive selection
17
+ rss-skill init
18
+
19
+ # Specify vendor directly
20
+ rss-skill init --vendor claude-code
21
+ rss-skill init --vendor cursor
22
+ rss-skill init --vendor cline
23
+ rss-skill init --vendor kimi-cli
24
+ rss-skill init --vendor generic
25
+ ```
26
+
27
+ This will create a `.claude/skills/` directory (or `.cursor/skills/`, etc. depending on vendor) with:
28
+
29
+ - `rss-find/SKILL.md` + `scripts/rss-find.exe` - Search RSSHub routes
30
+ - `rss-feed/SKILL.md` + `scripts/rss-feed.exe` - Manage RSS subscriptions
31
+ - `rss-gh/SKILL.md` + `scripts/rss-gh.exe` - Generate GitHub RSS feeds
32
+
33
+ ## Supported Vendors
34
+
35
+ | Vendor | Directory |
36
+ |--------|-----------|
37
+ | claude-code | `.claude/` |
38
+ | kimi-cli | `.kimi/` |
39
+ | cursor | `.cursor/` |
40
+ | cline | `.cline/` |
41
+ | generic | `.skills/` |
42
+
43
+ ## License
44
+
45
+ MIT
@@ -0,0 +1,22 @@
1
+ #!/usr/bin/env node
2
+
3
+ const { program } = require('commander');
4
+ const init = require('../src/init');
5
+ const path = require('path');
6
+
7
+ const pkg = require('../package.json');
8
+
9
+ program
10
+ .name('rss-skill')
11
+ .description('RSS skill pack for AI coding assistants')
12
+ .version(pkg.version);
13
+
14
+ program
15
+ .command('init')
16
+ .description('Initialize skill files in current directory')
17
+ .option('-v, --vendor <vendor>', 'Vendor to use (claude-code, kimi-cli, cursor, cline, generic)')
18
+ .action(async (options) => {
19
+ await init(options.vendor);
20
+ });
21
+
22
+ program.parse();
Binary file
Binary file
Binary file
package/package.json ADDED
@@ -0,0 +1,43 @@
1
+ {
2
+ "name": "rss-skill-cli",
3
+ "version": "0.1.0",
4
+ "description": "RSS skill pack for AI coding assistants (Claude Code, Cursor, Cline, etc.)",
5
+ "keywords": [
6
+ "rss",
7
+ "claude",
8
+ "claude-code",
9
+ "cursor",
10
+ "cline",
11
+ "ai",
12
+ "llm",
13
+ "skills"
14
+ ],
15
+ "author": "rss-skill",
16
+ "license": "MIT",
17
+ "bin": {
18
+ "rss-skill": "./bin/rss-skill.js"
19
+ },
20
+ "main": "./src/index.js",
21
+ "files": [
22
+ "bin",
23
+ "src",
24
+ "binaries"
25
+ ],
26
+ "scripts": {
27
+ "test": "node bin/rss-skill.js --help"
28
+ },
29
+ "dependencies": {
30
+ "commander": "^12.0.0"
31
+ },
32
+ "engines": {
33
+ "node": ">=16"
34
+ },
35
+ "repository": {
36
+ "type": "git",
37
+ "url": "https://github.com/rss-skill/rss-skill"
38
+ },
39
+ "bugs": {
40
+ "url": "https://github.com/rss-skill/rss-skill/issues"
41
+ },
42
+ "homepage": "https://github.com/rss-skill/rss-skill#readme"
43
+ }
package/src/index.js ADDED
@@ -0,0 +1,7 @@
1
+ const init = require('./init');
2
+ const templates = require('./templates');
3
+
4
+ module.exports = {
5
+ init,
6
+ templates
7
+ };
package/src/init.js ADDED
@@ -0,0 +1,173 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+ const readline = require('readline');
4
+ const templates = require('./templates');
5
+
6
+ // Vendor directory mapping
7
+ const vendorDirs = {
8
+ 'claude': '.claude',
9
+ 'claude-code': '.claude',
10
+ 'kimi-cli': '.kimi',
11
+ 'cursor': '.cursor',
12
+ 'cline': '.cline',
13
+ 'generic': '.skills'
14
+ };
15
+
16
+ const vendors = ['claude-code', 'kimi-cli', 'cursor', 'cline', 'generic'];
17
+
18
+ // Tool descriptions
19
+ const toolDescriptions = {
20
+ 'rss-find': 'Search RSS sources from RSSHub',
21
+ 'rss-feed': 'Manage RSS subscriptions',
22
+ 'rss-gh': 'Generate GitHub RSS feeds'
23
+ };
24
+
25
+ /**
26
+ * Get binary filename based on platform
27
+ */
28
+ function getBinaryName(tool) {
29
+ return process.platform === 'win32' ? `${tool}.exe` : tool;
30
+ }
31
+
32
+ /**
33
+ * Get binaries directory based on platform
34
+ */
35
+ function getBinariesDir() {
36
+ const platform = process.platform;
37
+ const arch = process.arch;
38
+
39
+ // Map platform/arch to directory name
40
+ const platformMap = {
41
+ 'win32': 'win',
42
+ 'darwin': 'darwin',
43
+ 'linux': 'linux'
44
+ };
45
+
46
+ const archMap = {
47
+ 'x64': 'x64',
48
+ 'arm64': 'arm64'
49
+ };
50
+
51
+ const platformName = platformMap[platform] || platform;
52
+ const archName = archMap[arch] || arch;
53
+
54
+ return path.join(__dirname, '..', 'binaries', `${platformName}-${archName}`);
55
+ }
56
+
57
+ /**
58
+ * Prompt user to select a vendor
59
+ */
60
+ async function selectVendor() {
61
+ return new Promise((resolve, reject) => {
62
+ const rl = readline.createInterface({
63
+ input: process.stdin,
64
+ output: process.stdout
65
+ });
66
+
67
+ console.log('\nSelect your AI coding tool:\n');
68
+ vendors.forEach((v, i) => {
69
+ console.log(` ${i + 1}. ${v}`);
70
+ });
71
+ console.log('');
72
+
73
+ rl.question('Enter number (1-5): ', (answer) => {
74
+ rl.close();
75
+ const num = parseInt(answer);
76
+ if (num >= 1 && num <= vendors.length) {
77
+ resolve(vendors[num - 1]);
78
+ } else {
79
+ reject(new Error('Invalid selection'));
80
+ }
81
+ });
82
+ });
83
+ }
84
+
85
+ /**
86
+ * Get vendor directory
87
+ */
88
+ function getVendorDir(vendor) {
89
+ const dir = vendorDirs[vendor];
90
+ if (!dir) {
91
+ throw new Error(`Unknown vendor: ${vendor}`);
92
+ }
93
+ return path.join(process.cwd(), dir);
94
+ }
95
+
96
+ /**
97
+ * Initialize skills for a vendor
98
+ */
99
+ async function init(vendor) {
100
+ // If no vendor specified, prompt for selection
101
+ if (!vendor) {
102
+ try {
103
+ vendor = await selectVendor();
104
+ } catch (err) {
105
+ console.error('\x1b[31m✗\x1b[0m No vendor selected');
106
+ process.exit(1);
107
+ }
108
+ }
109
+
110
+ // Validate vendor
111
+ if (!vendorDirs[vendor]) {
112
+ console.error(`\x1b[31m✗\x1b[0m Unknown vendor: ${vendor}`);
113
+ console.error(` Supported: ${Object.keys(vendorDirs).join(', ')}`);
114
+ process.exit(1);
115
+ }
116
+
117
+ const vendorDir = getVendorDir(vendor);
118
+ const skillDir = path.join(vendorDir, 'skills');
119
+
120
+ // Create skills directory
121
+ fs.mkdirSync(skillDir, { recursive: true });
122
+
123
+ const tools = ['rss-find', 'rss-feed', 'rss-gh'];
124
+ const binariesDir = getBinariesDir();
125
+
126
+ // Check if binaries exist
127
+ if (!fs.existsSync(binariesDir)) {
128
+ console.error(`\x1b[31m✗\x1b[0m Binaries not found for platform: ${binariesDir}`);
129
+ process.exit(1);
130
+ }
131
+
132
+ for (const tool of tools) {
133
+ const toolDir = path.join(skillDir, tool);
134
+ fs.mkdirSync(toolDir, { recursive: true });
135
+
136
+ // Create SKILL.md
137
+ const skillContent = templates[tool];
138
+ fs.writeFileSync(path.join(toolDir, 'SKILL.md'), skillContent);
139
+
140
+ // Create scripts directory
141
+ const scriptsDir = path.join(toolDir, 'scripts');
142
+ fs.mkdirSync(scriptsDir, { recursive: true });
143
+
144
+ // Copy binary to scripts directory
145
+ const binaryName = getBinaryName(tool);
146
+ const srcBinary = path.join(binariesDir, binaryName);
147
+ const destBinary = path.join(scriptsDir, binaryName);
148
+
149
+ if (fs.existsSync(srcBinary)) {
150
+ fs.copyFileSync(srcBinary, destBinary);
151
+ // Set executable permission (not needed on Windows, but doesn't hurt)
152
+ try {
153
+ fs.chmodSync(destBinary, 0o755);
154
+ } catch (e) {
155
+ // Ignore chmod errors on Windows
156
+ }
157
+ } else {
158
+ console.error(`\x1b[33m⚠\x1b[0m Binary not found: ${binaryName}`);
159
+ }
160
+ }
161
+
162
+ console.log(`\x1b[32m✓\x1b[0m Initialized skills for \x1b[36m${vendor}\x1b[0m in ${skillDir}`);
163
+ console.log('\nGenerated skills:');
164
+ tools.forEach(tool => {
165
+ console.log(` - ${tool}: ${toolDescriptions[tool]}`);
166
+ });
167
+
168
+ if (process.platform !== 'win32') {
169
+ console.log('\nNote: Make sure the tools in scripts/ have execute permission.');
170
+ }
171
+ }
172
+
173
+ module.exports = init;
@@ -0,0 +1,220 @@
1
+ const templates = {
2
+ 'rss-find': `---
3
+ name: rss-find
4
+ description: Search and discover RSS sources from RSSHub's extensive route collection. Use when looking for RSS feeds, subscribing to content sources, or when user mentions RSSHub, feeds, or content aggregation.
5
+ license: MIT
6
+ compatibility: Requires internet access to RSSHub
7
+ ---
8
+
9
+ # rss-find
10
+
11
+ Search and discover RSS sources from RSSHub's extensive route collection.
12
+
13
+ ## Available scripts
14
+
15
+ - **\`scripts/rss-find\`** — Self-contained binary for searching RSS sources
16
+
17
+ ## Commands
18
+
19
+ ### search
20
+ Search RSS sources by keyword.
21
+
22
+ \`\`\`bash
23
+ scripts/rss-find search "bilibili"
24
+ \`\`\`
25
+
26
+ ### info
27
+ Get detailed information about a specific route.
28
+
29
+ \`\`\`bash
30
+ scripts/rss-find info /bilibili/user/dynamic
31
+ \`\`\`
32
+
33
+ ### sync
34
+ Sync RSSHub routes manually to get latest available sources.
35
+
36
+ \`\`\`bash
37
+ scripts/rss-find sync
38
+ \`\`\`
39
+
40
+ ## Workflow
41
+
42
+ 1. Search for feeds:
43
+ \`\`\`bash
44
+ scripts/rss-find search "youtube"
45
+ \`\`\`
46
+
47
+ 2. Get route details:
48
+ \`\`\`bash
49
+ scripts/rss-find info /youtube/channel/UCxxxx
50
+ \`\`\`
51
+
52
+ 3. Use the RSS URL with rss-feed to subscribe.
53
+ `,
54
+
55
+ 'rss-feed': `---
56
+ name: rss-feed
57
+ description: Manage RSS subscriptions and articles for AI agent workflows. Subscribe to feeds, list unread articles with filters, and mark articles as read. Use when managing RSS subscriptions or processing feed content.
58
+ license: MIT
59
+ ---
60
+
61
+ # rss-feed
62
+
63
+ Manage RSS subscriptions and articles. Designed for AI agent workflows.
64
+
65
+ ## Available scripts
66
+
67
+ - **\`scripts/rss-feed\`** — Self-contained binary for managing RSS feeds
68
+
69
+ ## Commands
70
+
71
+ ### add
72
+ Add a new RSS feed subscription.
73
+
74
+ \`\`\`bash
75
+ scripts/rss-feed add <url> --name "My Feed" --category tech
76
+ \`\`\`
77
+
78
+ ### feeds
79
+ List all feed subscriptions (JSON output).
80
+
81
+ \`\`\`bash
82
+ scripts/rss-feed feeds
83
+ \`\`\`
84
+
85
+ ### list
86
+ List articles with filters (JSON output).
87
+
88
+ \`\`\`bash
89
+ scripts/rss-feed list --unread --today
90
+ scripts/rss-feed list --category tech
91
+ \`\`\`
92
+
93
+ ### mark-read
94
+ Mark articles as read.
95
+
96
+ \`\`\`bash
97
+ scripts/rss-feed mark-read --all
98
+ scripts/rss-feed mark-read --feed <feed-id>
99
+ \`\`\`
100
+
101
+ ### sync
102
+ Sync feed content.
103
+
104
+ \`\`\`bash
105
+ scripts/rss-feed sync
106
+ scripts/rss-feed sync -n "Feed Name"
107
+ \`\`\`
108
+
109
+ ### up
110
+ Start sync daemon for automatic feed updates.
111
+
112
+ \`\`\`bash
113
+ scripts/rss-feed up -d
114
+ \`\`\`
115
+
116
+ ### down
117
+ Stop sync daemon.
118
+
119
+ \`\`\`bash
120
+ scripts/rss-feed down
121
+ \`\`\`
122
+
123
+ ### status
124
+ Check daemon status.
125
+
126
+ \`\`\`bash
127
+ scripts/rss-feed status
128
+ \`\`\`
129
+
130
+ ## Agent Workflow
131
+
132
+ 1. Get unread articles (structured JSON output):
133
+ \`\`\`bash
134
+ scripts/rss-feed list --unread --today
135
+ \`\`\`
136
+
137
+ 2. Process content with AI
138
+
139
+ 3. Mark as read:
140
+ \`\`\`bash
141
+ scripts/rss-feed mark-read --all
142
+ \`\`\`
143
+
144
+ ## Daemon Mode
145
+
146
+ Configure automatic sync in feeds.yaml:
147
+ \`\`\`yaml
148
+ sync:
149
+ enabled: true
150
+ interval: "30m"
151
+ jitter: 0
152
+ on_startup: true
153
+ concurrency: 5 # Number of parallel fetchers
154
+ \`\`\`
155
+
156
+ Start background daemon:
157
+ \`\`\`bash
158
+ scripts/rss-feed up -d
159
+ \`\`\`
160
+ `,
161
+
162
+ 'rss-gh': `---
163
+ name: rss-gh
164
+ description: Generate RSS feeds for GitHub repositories including releases and commits. Search repositories and subscribe to their activity feeds. Use when tracking GitHub project updates or releases.
165
+ license: MIT
166
+ compatibility: Requires internet access to GitHub API
167
+ ---
168
+
169
+ # rss-gh
170
+
171
+ Generate RSS feeds for GitHub repositories (releases, commits).
172
+
173
+ ## Available scripts
174
+
175
+ - **\`scripts/rss-gh\`** — Self-contained binary for GitHub RSS generation
176
+
177
+ ## Commands
178
+
179
+ ### search
180
+ Search GitHub repositories (JSON output).
181
+
182
+ \`\`\`bash
183
+ scripts/rss-gh search "golang rss"
184
+ \`\`\`
185
+
186
+ ### rss
187
+ Generate RSS URL for a repository.
188
+
189
+ \`\`\`bash
190
+ scripts/rss-gh rss owner/repo --releases
191
+ scripts/rss-gh rss owner/repo --commits
192
+ \`\`\`
193
+
194
+ ### subscribe
195
+ Subscribe to repository RSS feed directly.
196
+
197
+ \`\`\`bash
198
+ scripts/rss-gh subscribe owner/repo --releases
199
+ \`\`\`
200
+
201
+ ## Workflow
202
+
203
+ 1. Search for a project:
204
+ \`\`\`bash
205
+ scripts/rss-gh search "react"
206
+ \`\`\`
207
+
208
+ 2. Get the RSS URL:
209
+ \`\`\`bash
210
+ scripts/rss-gh rss facebook/react --releases
211
+ \`\`\`
212
+
213
+ 3. Subscribe using rss-feed:
214
+ \`\`\`bash
215
+ scripts/rss-feed add <rss-url> --name "React Releases"
216
+ \`\`\`
217
+ `
218
+ };
219
+
220
+ module.exports = templates;