@naganpm/fetch-prompts
v1.0.6
Published
Fetch prompts from GitLab repository
Readme
fetch-prompts
Fetch prompts from a public GitLab repository.
Quick Start
Simple - no authentication required!
npx -y @naganpm/fetch-promptsThis downloads all .md prompt files from https://gitlab.com/prompts4/prompt-manager into a local prompts/ folder.
Alternative: For Private Repos
If the GitLab repo becomes private, users will need:
- Access to the GitLab repo (ask owner to add you as member)
- A GitLab personal access token
Step 1: Get Added to GitLab Repo
Ask the repo owner to add you at: https://gitlab.com/prompts4/prompt-manager/-/project_members
Step 2: Create GitLab Token
- Go to: https://gitlab.com/-/profile/personal_access_tokens
- Create token with scopes:
read_api,read_repository - Copy your token (starts with
glpat-)
Step 3: Run with Token
GITLAB_TOKEN=glpat-your-token-here npx -y @naganpm/fetch-promptsOr export it first:
export GITLAB_TOKEN=glpat-your-token-here
npx -y @naganpm/fetch-promptsFor Repo Owner: Adding Users (Private Repos Only)
To grant someone access to fetch prompts:
- Go to: https://gitlab.com/prompts4/prompt-manager/-/project_members
- Click "Invite members"
- Add their GitLab username or email
- Set role to "Reporter" (read-only access)
- Click "Invite"
They can then create their own token and use the npx command above.
Setup (For Development)
If you want to fork/modify this package:
Edit
bin/index.jsto point to your GitLab repo:const GITLAB_PROJECT = 'your-group/your-project'; const GITLAB_BRANCH = 'main'; const PROMPTS_PATH = 'prompts';Create
.envfor local testing:# Copy the example cp .env.example .env # Edit .env and add your GitLab token GITLAB_TOKEN=glpat-xxxxxxxxxxxxCreate a token at: https://gitlab.com/-/profile/personal_access_tokens Required scopes:
read_api,read_repositoryPrepare your GitLab repo with a
prompts/folder containing.mdfiles:your-gitlab-repo/ └── prompts/ ├── assessments-result-feed.md └── other-prompt.mdTest locally:
# Install dependencies
npm install
# Make bin/index.js executable
chmod +x bin/index.js
# Create .env with your token (for private repos)
cp .env.example .env
# Edit .env and add your GITLAB_TOKEN
# Test locally
npm link
npx -y @naganpm/fetch-prompts
# Or run directly
node bin/index.jsGitLab Repository Structure
Your GitLab repo should have:
prompts/
├── assessments-result-feed.md
├── another-route.md
└── more-prompts.mdAll .md files in the prompts/ folder will be downloaded.
