@airuleshub/cli 1.0.1 ā 1.0.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 +48 -12
- package/dist/src/commands/install.js +39 -30
- package/package.json +25 -3
package/README.md
CHANGED
|
@@ -1,8 +1,26 @@
|
|
|
1
1
|
# @airuleshub/cli
|
|
2
2
|
|
|
3
|
-
The
|
|
3
|
+
**The CLI for AI-Native Development.**
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
Fetch, manage, and share **Cursor Rules**, **Windsurf Instructions**, and **Copilot Guidelines** effortlessly.
|
|
6
|
+
|
|
7
|
+
[](https://opensource.org/licenses/ISC)
|
|
8
|
+
|
|
9
|
+
---
|
|
10
|
+
|
|
11
|
+
## š Table of Contents
|
|
12
|
+
|
|
13
|
+
- [Features](#-features)
|
|
14
|
+
- [Installation](#-installation)
|
|
15
|
+
- [Usage](#-usage)
|
|
16
|
+
- [Install Rules](#install-a-rule)
|
|
17
|
+
- [Interactive Mode](#interactive-mode)
|
|
18
|
+
- [About AI Rules Hub](#-about-airuleshub)
|
|
19
|
+
- [License](#-license)
|
|
20
|
+
|
|
21
|
+
## š Introduction
|
|
22
|
+
|
|
23
|
+
**@airuleshub/cli** connects your local development environment with the vast library of rules available on [airuleshub.com](https://airuleshub.com). Whether you are starting a new **Next.js** project, setting up a **React Native** app, or configuring **Supabase**, proper context is key for AI coding assistants. This CLI makes it instant.
|
|
6
24
|
|
|
7
25
|
## š Installation
|
|
8
26
|
|
|
@@ -20,11 +38,11 @@ npx @airuleshub/cli install <rule-slug>
|
|
|
20
38
|
npm install -g @airuleshub/cli
|
|
21
39
|
```
|
|
22
40
|
|
|
23
|
-
##
|
|
41
|
+
## ļæ½ Usage
|
|
24
42
|
|
|
25
43
|
### Install a Rule
|
|
26
44
|
|
|
27
|
-
|
|
45
|
+
The primary command is `install`. It fetches the rule content and saves it to your project.
|
|
28
46
|
|
|
29
47
|
```bash
|
|
30
48
|
airuleshub install <rule-slug>
|
|
@@ -38,22 +56,40 @@ airuleshub install nextjs-app-router-cursor-rules
|
|
|
38
56
|
|
|
39
57
|
### Options
|
|
40
58
|
|
|
41
|
-
- **Format Selection
|
|
42
|
-
- **Overwrite Protection**:
|
|
59
|
+
- **Format Selection (`-f, --format`)**: Choose between `.md` (Markdown) or `.txt` (Text).
|
|
60
|
+
- **Overwrite Protection**: Safely checks if the file already exists before overwriting.
|
|
61
|
+
|
|
62
|
+
### Interactive Mode
|
|
63
|
+
|
|
64
|
+
You can also run the command without flags to use the interactive prompts:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
npx @airuleshub/cli install <rule-slug>
|
|
68
|
+
# ā Choose file format: Markdown (.md)
|
|
69
|
+
# ā File already exists. Overwrite? (y/N)
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
## ā Why use this?
|
|
73
|
+
|
|
74
|
+
Standardizing your AI context is critical for team consistency. Instead of copy-pasting `.cursorrules` files or prompts, use this CLI to pull the latest, verified versions.
|
|
43
75
|
|
|
44
76
|
## š ļø Features
|
|
45
77
|
|
|
46
|
-
- ā” **
|
|
47
|
-
- š **Multi-
|
|
48
|
-
- š¤ **
|
|
49
|
-
- š **Always
|
|
78
|
+
- ā” **Instant Setup**: Initialize Cursor rules in seconds without manual copy-pasting.
|
|
79
|
+
- š **Multi-Format Support**: Generate rules in `.md` (Markdown) or `.txt` formats compatible with various AI editors.
|
|
80
|
+
- š¤ **AI-Ready**: Optimized for Cursor, Windsurf, GitHub Copilot, and other AI coding assistants.
|
|
81
|
+
- š **Always Current**: Fetch the latest community-verified rules directly from the AI Rules Hub registry.
|
|
82
|
+
- š ļø **Developer Friendly**: Simple, intuitive CLI interface designed for modern web development workflows (Next.js, TypeScript, etc.).
|
|
50
83
|
|
|
51
84
|
## š¤ Author & Community
|
|
52
85
|
|
|
53
86
|
Built with ā¤ļø by **Nikunj Borad**.
|
|
54
87
|
|
|
55
|
-
|
|
88
|
+
Connect with the developer and the community:
|
|
89
|
+
|
|
90
|
+
- š **GitHub**: [@nikunjborad123](https://github.com/nikunjborad123)
|
|
91
|
+
- š **Website**: [AI Rules Hub.com](https://airuleshub.com)
|
|
56
92
|
|
|
57
93
|
## š License
|
|
58
94
|
|
|
59
|
-
This project is licensed under the ISC License.
|
|
95
|
+
This project is licensed under the [ISC License](https://opensource.org/licenses/ISC).
|
|
@@ -3,36 +3,45 @@ import inquirer from 'inquirer';
|
|
|
3
3
|
import { fetchRule } from '../api/rules.js';
|
|
4
4
|
import { writeRule, getRulePath } from '../fs/writer.js';
|
|
5
5
|
export async function installRule(slug, options) {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
{
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
6
|
+
try {
|
|
7
|
+
console.log(`š¦ Installing rule: ${slug}`);
|
|
8
|
+
const rule = await fetchRule(slug);
|
|
9
|
+
const format = options.format
|
|
10
|
+
? options.format
|
|
11
|
+
: (await inquirer.prompt([
|
|
12
|
+
{
|
|
13
|
+
type: 'list',
|
|
14
|
+
name: 'format',
|
|
15
|
+
message: 'š Choose file format:',
|
|
16
|
+
choices: [
|
|
17
|
+
{ name: 'Markdown (.md)', value: 'md' },
|
|
18
|
+
{ name: 'Text (.txt)', value: 'txt' },
|
|
19
|
+
],
|
|
20
|
+
default: 'md',
|
|
21
|
+
},
|
|
22
|
+
])).format;
|
|
23
|
+
const filePath = getRulePath(slug, format);
|
|
24
|
+
if (await fs.pathExists(filePath)) {
|
|
25
|
+
const { overwrite } = await inquirer.prompt([
|
|
26
|
+
{
|
|
27
|
+
type: 'confirm',
|
|
28
|
+
name: 'overwrite',
|
|
29
|
+
message: 'ā ļø File already exists. Overwrite?',
|
|
30
|
+
default: false,
|
|
31
|
+
},
|
|
32
|
+
]);
|
|
33
|
+
if (!overwrite) {
|
|
34
|
+
console.log('ā Installation cancelled.');
|
|
35
|
+
return;
|
|
36
|
+
}
|
|
35
37
|
}
|
|
38
|
+
await writeRule(rule, format ?? 'md');
|
|
39
|
+
}
|
|
40
|
+
catch (error) {
|
|
41
|
+
if (error.message?.includes('User force closed the prompt')) {
|
|
42
|
+
console.log('\nā Operation cancelled.');
|
|
43
|
+
process.exit(0);
|
|
44
|
+
}
|
|
45
|
+
throw error;
|
|
36
46
|
}
|
|
37
|
-
await writeRule(rule, format ?? 'md');
|
|
38
47
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@airuleshub/cli",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "",
|
|
6
6
|
"main": "index.js",
|
|
@@ -12,12 +12,34 @@
|
|
|
12
12
|
"bin": {
|
|
13
13
|
"airuleshub": "./dist/bin/airuleshub.js"
|
|
14
14
|
},
|
|
15
|
-
"keywords": [
|
|
15
|
+
"keywords": [
|
|
16
|
+
"ai",
|
|
17
|
+
"cli",
|
|
18
|
+
"rules",
|
|
19
|
+
"cursor",
|
|
20
|
+
"cursor-rules",
|
|
21
|
+
"windsurf",
|
|
22
|
+
"copilot",
|
|
23
|
+
"automation",
|
|
24
|
+
"scaffolding",
|
|
25
|
+
"productivity",
|
|
26
|
+
"developer-tools",
|
|
27
|
+
"airuleshub"
|
|
28
|
+
],
|
|
16
29
|
"files": [
|
|
17
30
|
"bin",
|
|
18
31
|
"dist"
|
|
19
32
|
],
|
|
20
|
-
"author": "",
|
|
33
|
+
"author": "Nikunj Borad <boradnikunj2001@gmail.com> (https://github.com/nikunjborad123)",
|
|
34
|
+
"repository": {
|
|
35
|
+
"type": "git",
|
|
36
|
+
"url": "git+https://github.com/nikunjborad123/airuleshub.git",
|
|
37
|
+
"directory": "airuleshub-cli"
|
|
38
|
+
},
|
|
39
|
+
"homepage": "https://github.com/nikunjborad123/airuleshub/tree/master/airuleshub-cli#readme",
|
|
40
|
+
"bugs": {
|
|
41
|
+
"url": "https://github.com/nikunjborad123/airuleshub/issues"
|
|
42
|
+
},
|
|
21
43
|
"license": "ISC",
|
|
22
44
|
"dependencies": {
|
|
23
45
|
"commander": "^14.0.3",
|