@naganpm/fetch-prompts 1.0.2 → 1.0.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.
Files changed (3) hide show
  1. package/README.md +64 -34
  2. package/bin/index.js +1 -1
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -1,18 +1,71 @@
1
- # fetch-angular-prompts
1
+ # fetch-prompts
2
2
 
3
- Fetch Angular routing prompts from your GitLab repository.
3
+ Fetch prompts from a public GitLab repository.
4
4
 
5
- ## Setup
5
+ ## Quick Start
6
6
 
7
- 1. **Edit `bin/index.js`** and update the configuration:
7
+ **Simple - no authentication required!**
8
+
9
+ ```bash
10
+ npx -y @naganpm/fetch-prompts
11
+ ```
12
+
13
+ This downloads all `.md` prompt files from https://gitlab.com/prompts4/prompt-manager into a local `prompts/` folder.
14
+
15
+ ---
16
+
17
+ ## Alternative: For Private Repos
18
+
19
+ If the GitLab repo becomes private, users will need:
20
+ 1. Access to the GitLab repo (ask owner to add you as member)
21
+ 2. A GitLab personal access token
22
+
23
+ ### Step 1: Get Added to GitLab Repo
24
+ Ask the repo owner to add you at:
25
+ https://gitlab.com/prompts4/prompt-manager/-/project_members
26
+
27
+ ### Step 2: Create GitLab Token
28
+ 1. Go to: https://gitlab.com/-/profile/personal_access_tokens
29
+ 2. Create token with scopes: `read_api`, `read_repository`
30
+ 3. Copy your token (starts with `glpat-`)
31
+
32
+ ### Step 3: Run with Token
33
+ ```bash
34
+ GITLAB_TOKEN=glpat-your-token-here npx -y @naganpm/fetch-prompts
35
+ ```
36
+
37
+ Or export it first:
38
+ ```bash
39
+ export GITLAB_TOKEN=glpat-your-token-here
40
+ npx -y @naganpm/fetch-prompts
41
+ ```
42
+
43
+ ---
44
+
45
+ ## For Repo Owner: Adding Users (Private Repos Only)
46
+
47
+ To grant someone access to fetch prompts:
48
+
49
+ 1. Go to: https://gitlab.com/prompts4/prompt-manager/-/project_members
50
+ 2. Click **"Invite members"**
51
+ 3. Add their GitLab username or email
52
+ 4. Set role to **"Reporter"** (read-only access)
53
+ 5. Click **"Invite"**
54
+
55
+ They can then create their own token and use the `npx` command above.
56
+
57
+ ## Setup (For Development)
58
+
59
+ If you want to fork/modify this package:
60
+
61
+ 1. **Edit `bin/index.js`** to point to your GitLab repo:
8
62
  ```js
9
- const GITLAB_PROJECT = 'youruser/yourproject'; // Your GitLab project path
10
- const GITLAB_BRANCH = 'main'; // Your branch name
11
- const PROMPTS_PATH = 'prompts'; // Folder containing .md files
12
- const GITLAB_HOST = 'gitlab.com'; // Or your GitLab instance
63
+ const GITLAB_PROJECT = 'your-group/your-project';
64
+ const GITLAB_BRANCH = 'main';
65
+ const PROMPTS_PATH = 'prompts';
13
66
  ```
14
67
 
15
- 2. **For private repos**, create a `.env` file in the package root:
68
+ 2. **Create `.env`** for local testing:
16
69
  ```bash
17
70
  # Copy the example
18
71
  cp .env.example .env
@@ -32,30 +85,7 @@ Fetch Angular routing prompts from your GitLab repository.
32
85
  └── other-prompt.md
33
86
  ```
34
87
 
35
- ## Usage
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
88
+ 3. **Test locally:**
59
89
 
60
90
  ```bash
61
91
  # Install dependencies
@@ -70,7 +100,7 @@ cp .env.example .env
70
100
 
71
101
  # Test locally
72
102
  npm link
73
- npx -y fetch-angular-prompts
103
+ npx -y @naganpm/fetch-prompts
74
104
 
75
105
  # Or run directly
76
106
  node bin/index.js
package/bin/index.js CHANGED
@@ -12,7 +12,7 @@ if (fs.existsSync(envPath)) {
12
12
  }
13
13
 
14
14
  // Configuration - update these with your GitLab details
15
- const GITLAB_PROJECT = 'npm-packages713505/prompt-manager'; // group/project
15
+ const GITLAB_PROJECT = 'prompts4/prompt-manager'; // group/project
16
16
  const GITLAB_BRANCH = 'main'; // or 'master'
17
17
  const PROMPTS_PATH = 'prompts'; // folder in your GitLab repo
18
18
  const GITLAB_HOST = 'gitlab.com'; // or your self-hosted GitLab domain
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naganpm/fetch-prompts",
3
- "version": "1.0.2",
3
+ "version": "1.0.5",
4
4
  "description": "Fetch prompts from GitLab repository",
5
5
  "bin": {
6
6
  "fetch-prompts": "bin/index.js"