@naganpm/fetch-prompts 1.0.2 → 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 +52 -34
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,18 +1,59 @@
|
|
|
1
|
-
# fetch-
|
|
1
|
+
# fetch-prompts
|
|
2
2
|
|
|
3
|
-
Fetch
|
|
3
|
+
Fetch prompts from a private GitLab repository.
|
|
4
4
|
|
|
5
|
-
##
|
|
5
|
+
## Quick Start
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
**This package fetches from a private GitLab repository.** Users need:
|
|
8
|
+
1. Access to the GitLab repo (ask owner to add you as member)
|
|
9
|
+
2. A GitLab personal access token
|
|
10
|
+
|
|
11
|
+
### Step 1: Get Added to GitLab Repo
|
|
12
|
+
Ask the repo owner to add you at:
|
|
13
|
+
https://gitlab.com/npm-packages713505/prompt-manager/-/project_members
|
|
14
|
+
|
|
15
|
+
### Step 2: Create GitLab Token
|
|
16
|
+
1. Go to: https://gitlab.com/-/profile/personal_access_tokens
|
|
17
|
+
2. Create token with scopes: `read_api`, `read_repository`
|
|
18
|
+
3. Copy your token (starts with `glpat-`)
|
|
19
|
+
|
|
20
|
+
### Step 3: Run the Package
|
|
21
|
+
```bash
|
|
22
|
+
GITLAB_TOKEN=glpat-your-token-here npx -y @naganpm/fetch-prompts
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
Or export it first:
|
|
26
|
+
```bash
|
|
27
|
+
export GITLAB_TOKEN=glpat-your-token-here
|
|
28
|
+
npx -y @naganpm/fetch-prompts
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
This downloads all `.md` prompt files from the GitLab repo into a local `prompts/` folder.
|
|
32
|
+
|
|
33
|
+
## For Repo Owner: Adding Users
|
|
34
|
+
|
|
35
|
+
To grant someone access to fetch prompts:
|
|
36
|
+
|
|
37
|
+
1. Go to: https://gitlab.com/npm-packages713505/prompt-manager/-/project_members
|
|
38
|
+
2. Click **"Invite members"**
|
|
39
|
+
3. Add their GitLab username or email
|
|
40
|
+
4. Set role to **"Reporter"** (read-only access)
|
|
41
|
+
5. Click **"Invite"**
|
|
42
|
+
|
|
43
|
+
They can then create their own token and use the `npx` command above.
|
|
44
|
+
|
|
45
|
+
## Setup (For Development)
|
|
46
|
+
|
|
47
|
+
If you want to fork/modify this package:
|
|
48
|
+
|
|
49
|
+
1. **Edit `bin/index.js`** to point to your GitLab repo:
|
|
8
50
|
```js
|
|
9
|
-
const GITLAB_PROJECT = '
|
|
10
|
-
const GITLAB_BRANCH = 'main';
|
|
11
|
-
const PROMPTS_PATH = 'prompts';
|
|
12
|
-
const GITLAB_HOST = 'gitlab.com'; // Or your GitLab instance
|
|
51
|
+
const GITLAB_PROJECT = 'your-group/your-project';
|
|
52
|
+
const GITLAB_BRANCH = 'main';
|
|
53
|
+
const PROMPTS_PATH = 'prompts';
|
|
13
54
|
```
|
|
14
55
|
|
|
15
|
-
2. **
|
|
56
|
+
2. **Create `.env`** for local testing:
|
|
16
57
|
```bash
|
|
17
58
|
# Copy the example
|
|
18
59
|
cp .env.example .env
|
|
@@ -32,30 +73,7 @@ Fetch Angular routing prompts from your GitLab repository.
|
|
|
32
73
|
└── other-prompt.md
|
|
33
74
|
```
|
|
34
75
|
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
After publishing to npm:
|
|
38
|
-
```bash
|
|
39
|
-
npx -y fetch-angular-prompts
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
This creates a `prompts/` folder in the current directory with all `.md` files from your GitLab repo.
|
|
43
|
-
|
|
44
|
-
## Publishing
|
|
45
|
-
|
|
46
|
-
### To npm:
|
|
47
|
-
```bash
|
|
48
|
-
npm login
|
|
49
|
-
npm publish
|
|
50
|
-
```
|
|
51
|
-
|
|
52
|
-
### Or use from GitHub:
|
|
53
|
-
Push this package to GitHub, then users can run:
|
|
54
|
-
```bash
|
|
55
|
-
npx github:youruser/your-repo
|
|
56
|
-
```
|
|
57
|
-
|
|
58
|
-
## Local Testing
|
|
76
|
+
3. **Test locally:**
|
|
59
77
|
|
|
60
78
|
```bash
|
|
61
79
|
# Install dependencies
|
|
@@ -70,7 +88,7 @@ cp .env.example .env
|
|
|
70
88
|
|
|
71
89
|
# Test locally
|
|
72
90
|
npm link
|
|
73
|
-
npx -y fetch-
|
|
91
|
+
npx -y @naganpm/fetch-prompts
|
|
74
92
|
|
|
75
93
|
# Or run directly
|
|
76
94
|
node bin/index.js
|