{"_id":"@asagiri-design/labels-config","_rev":"3-643ecad5281e6c83746ed580410c6754","name":"@asagiri-design/labels-config","dist-tags":{"latest":"0.3.1"},"versions":{"0.2.2":{"name":"@asagiri-design/labels-config","version":"0.2.2","keywords":["labels","github","issue-tracking","config","management","schema","validation"],"author":{"name":"BoxPistols"},"license":"MIT","_id":"@asagiri-design/labels-config@0.2.2","maintainers":[{"name":"asagiri-design","email":"ito.atsu.mail@gmail.com"}],"homepage":"https://github.com/BoxPistols/labels-config#readme","bugs":{"url":"https://github.com/BoxPistols/labels-config/issues"},"bin":{"labels-config":"dist/cli.js"},"dist":{"shasum":"8259dfb22a230c656c7f26f100816385a5b62d0e","tarball":"https://registry.npmjs.org/@asagiri-design/labels-config/-/labels-config-0.2.2.tgz","fileCount":32,"integrity":"sha512-X3W3WDjtnlELz4PTQMKZCNSi6TY+H1wcXxkXsFBQPq7EFn5ECthldHlfIeWIB6GJcu9TzOy67J6Lc2Hjglyx1A==","signatures":[{"sig":"MEYCIQDzBADodOwto/JNz2jjutAa+25/ZPZJAq1n0w+EXB8qSAIhAKD/5j9gfRMvFJ1wCjUSHUQhwnWQaNgqXijhyczqHJ6y","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":196086},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.esm.js","browser":"dist/index.umd.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.esm.js","require":"./dist/config/index.js"},"./github":{"types":"./dist/github/index.d.ts","import":"./dist/github/index.esm.js","require":"./dist/github/index.js"}},"gitHead":"9f434db89468c6db599aabcac5e61011b9e570d5","scripts":{"cli":"tsx src/cli.ts","dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src --fix","test":"vitest","build":"tsup src/index.ts src/config/index.ts src/github/index.ts src/cli.ts --format cjs,esm --dts --shims","test:ui":"vitest --ui","version":"node -e \"const fs=require('fs');const v=require('./package.json').version;fs.writeFileSync('src/version.ts','export const version = \\''+v+'\\'\\n')\" && git add src/version.ts","build:umd":"tsup src/index.ts --format iife --dts --globalName LabelsConfig --outDir dist","type-check":"tsc --noEmit","release:beta":"npm version prerelease --preid=beta -m 'Release v%s [skip ci]' && npm publish --access public --tag beta && git push --follow-tags","release:major":"npm version major -m 'Release v%s [skip ci]' && npm publish --access public && git push --follow-tags","release:minor":"npm version minor -m 'Release v%s [skip ci]' && npm publish --access public && git push --follow-tags","release:patch":"npm version patch -m 'Release v%s [skip ci]' && npm publish --access public && git push --follow-tags","test:coverage":"vitest --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"asagiri-design","email":"ito.atsu.mail@gmail.com"},"repository":{"url":"git+https://github.com/BoxPistols/labels-config.git","type":"git"},"_npmVersion":"10.9.2","description":"Terminal-first label management system for GitHub repositories using gh CLI - No token required","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"zod":"^3.22.4"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.0.2","eslint":"^8.54.0","vitest":"^1.0.4","typescript":"^5.3.3","@types/node":"^20.10.0","@typescript-eslint/parser":"^6.13.0","@typescript-eslint/eslint-plugin":"^6.13.0"},"_npmOperationalInternal":{"tmp":"tmp/labels-config_0.2.2_1763064935467_0.0885852697960865","host":"s3://npm-registry-packages-npm-production"}},"0.3.0":{"name":"@asagiri-design/labels-config","version":"0.3.0","keywords":["labels","github","issue-tracking","config","management","schema","validation"],"author":{"name":"BoxPistols"},"license":"MIT","_id":"@asagiri-design/labels-config@0.3.0","maintainers":[{"name":"asagiri-design","email":"ito.atsu.mail@gmail.com"}],"homepage":"https://github.com/BoxPistols/labels-config#readme","bugs":{"url":"https://github.com/BoxPistols/labels-config/issues"},"bin":{"labels-config":"dist/cli.js"},"dist":{"shasum":"24afd8fbe865f82efd296bed15e29a52a3d02c35","tarball":"https://registry.npmjs.org/@asagiri-design/labels-config/-/labels-config-0.3.0.tgz","fileCount":37,"integrity":"sha512-Krcnj1hyc08iQYForC1uRbotJotn61Wv71DjFhXC669k4c/bprhDhjTcvrSDCOqsH0IQIltibCrQD/I4OsHG5A==","signatures":[{"sig":"MEUCIQCuqjRzh4sZLT7G24OW/lRLFQob5DQcDf9gxsAPPMjAcQIgdKzGFwD/rhfbUewr/CrUeIlgzn7qZz3yWzfTX1qLuYc=","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"unpackedSize":288570},"main":"dist/index.js","types":"dist/index.d.ts","module":"dist/index.esm.js","browser":"dist/index.umd.js","engines":{"node":">=18.0.0"},"exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.esm.js","require":"./dist/config/index.js"},"./github":{"types":"./dist/github/index.d.ts","import":"./dist/github/index.esm.js","require":"./dist/github/index.js"}},"gitHead":"61a1323f9d99acac6e669dae19e0b4a35dadf4a7","scripts":{"cli":"tsx src/cli.ts","dev":"tsup src/index.ts --format cjs,esm --dts --watch","lint":"eslint src --fix","test":"vitest","build":"tsup src/index.ts src/config/index.ts src/github/index.ts src/cli.ts --format cjs,esm --dts --shims","test:ui":"vitest --ui","version":"node -e \"const fs=require('fs');const v=require('./package.json').version;fs.writeFileSync('src/version.ts','export const version = \\''+v+'\\'\\n')\" && git add src/version.ts","build:umd":"tsup src/index.ts --format iife --dts --globalName LabelsConfig --outDir dist","type-check":"tsc --noEmit","test:coverage":"vitest --coverage","prepublishOnly":"npm run build"},"_npmUser":{"name":"asagiri-design","email":"ito.atsu.mail@gmail.com"},"repository":{"url":"git+https://github.com/BoxPistols/labels-config.git","type":"git"},"_npmVersion":"10.9.2","description":"Terminal-first label management system for GitHub repositories using gh CLI - No token required","directories":{},"sideEffects":false,"_nodeVersion":"22.18.0","dependencies":{"zod":"^3.22.4"},"_hasShrinkwrap":false,"devDependencies":{"tsx":"^4.7.0","tsup":"^8.0.2","eslint":"^8.54.0","vitest":"^1.0.4","typescript":"^5.3.3","@types/node":"^20.10.0","@typescript-eslint/parser":"^6.13.0","@typescript-eslint/eslint-plugin":"^6.13.0"},"_npmOperationalInternal":{"tmp":"tmp/labels-config_0.3.0_1763625909096_0.05275783782048138","host":"s3://npm-registry-packages-npm-production"}},"0.3.1":{"name":"@asagiri-design/labels-config","version":"0.3.1","description":"Terminal-first label management system for GitHub repositories using gh CLI - No token required","main":"dist/index.js","module":"dist/index.esm.js","types":"dist/index.d.ts","browser":"dist/index.umd.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.esm.js","require":"./dist/index.js"},"./config":{"types":"./dist/config/index.d.ts","import":"./dist/config/index.esm.js","require":"./dist/config/index.js"},"./github":{"types":"./dist/github/index.d.ts","import":"./dist/github/index.esm.js","require":"./dist/github/index.js"}},"bin":{"labels-config":"dist/cli.js"},"sideEffects":false,"scripts":{"build":"tsup src/index.ts src/config/index.ts src/github/index.ts src/cli.ts --format cjs,esm --dts --shims","build:umd":"tsup src/index.ts --format iife --dts --globalName LabelsConfig --outDir dist","dev":"tsup src/index.ts --format cjs,esm --dts --watch","type-check":"tsc --noEmit","test":"vitest","test:ui":"vitest --ui","test:coverage":"vitest --coverage","lint":"eslint src --fix","cli":"tsx src/cli.ts","prepublishOnly":"npm run build","version":"node -e \"const fs=require('fs');const v=require('./package.json').version;fs.writeFileSync('src/version.ts','export const version = \\''+v+'\\'\\n')\" && git add src/version.ts"},"keywords":["labels","github","issue-tracking","config","management","schema","validation"],"author":{"name":"BoxPistols"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/BoxPistols/labels-config.git"},"bugs":{"url":"https://github.com/BoxPistols/labels-config/issues"},"homepage":"https://github.com/BoxPistols/labels-config#readme","devDependencies":{"@types/node":"^20.10.0","@typescript-eslint/eslint-plugin":"^6.13.0","@typescript-eslint/parser":"^6.13.0","eslint":"^8.54.0","tsup":"^8.0.2","tsx":"^4.7.0","typescript":"^5.3.3","vitest":"^1.0.4"},"dependencies":{"zenn-cli":"^0.2.11","zod":"^3.22.4"},"engines":{"node":">=18.0.0"},"_id":"@asagiri-design/labels-config@0.3.1","gitHead":"aceaec1c533c60cc92eee8d0a37b7416d009af25","_nodeVersion":"20.19.6","_npmVersion":"10.8.2","dist":{"integrity":"sha512-5dhQIsijGu+r46nFfu408g4RhM203Xg1G77AERYW1kywn/ZJpHcL4xSV6JtZdOsqG6dpwePcL/7zrxjzUeRlAA==","shasum":"303301625f33b7c5821bbc87b415bf9381a31da1","tarball":"https://registry.npmjs.org/@asagiri-design/labels-config/-/labels-config-0.3.1.tgz","fileCount":34,"unpackedSize":262282,"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEUCID+igimC5qaoTNn5fScGH7crt5QKY3Mb/L15IbIQdMxeAiEA0n2Tja2LbE0yzP3gxWAknT9I7vh90WwAeOdJQBUcgRA="}]},"_npmUser":{"name":"asagiri-design","email":"ito.atsu.mail@gmail.com"},"directories":{},"maintainers":[{"name":"asagiri-design","email":"ito.atsu.mail@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/labels-config_0.3.1_1767356786687_0.6028474820527912"},"_hasShrinkwrap":false}},"time":{"created":"2025-11-13T20:15:35.404Z","modified":"2026-01-02T12:26:27.050Z","0.2.2":"2025-11-13T20:15:35.702Z","0.3.0":"2025-11-20T08:05:09.290Z","0.3.1":"2026-01-02T12:26:26.855Z"},"bugs":{"url":"https://github.com/BoxPistols/labels-config/issues"},"author":{"name":"BoxPistols"},"license":"MIT","homepage":"https://github.com/BoxPistols/labels-config#readme","keywords":["labels","github","issue-tracking","config","management","schema","validation"],"repository":{"type":"git","url":"git+https://github.com/BoxPistols/labels-config.git"},"description":"Terminal-first label management system for GitHub repositories using gh CLI - No token required","maintainers":[{"name":"asagiri-design","email":"ito.atsu.mail@gmail.com"}],"readme":"# @boxpistols/labels-config\n\nTerminal-first GitHub label management - Simple, fast, no token needed.\n\nManage GitHub labels from your terminal using gh CLI. No manual token setup required.\n\n---\n\n## Quick Start\n\n```bash\n# 1. Install gh CLI and authenticate (one-time setup)\nbrew install gh  # macOS\ngh auth login\n\n# 2. Install labels-config\nnpm install -g @boxpistols/labels-config\n\n# 3. Initialize from template\nlabels-config init minimal --file labels.json\n\n# 4. Sync to your repository\nlabels-config sync --owner your-name --repo your-repo --file labels.json\n```\n\nDone! Your labels are synced.\n\n---\n\n## Features\n\n- **Terminal-First**: No token management - uses gh CLI authentication\n- **Simple CLI**: 5 commands, straightforward usage\n- **Pre-built Templates**: 9 ready-to-use label sets\n- **Validation**: Check your config before syncing\n- **Dry Run**: Preview changes before applying\n\n---\n\n## Installation\n\n### Prerequisites\n\nInstall and authenticate gh CLI:\n\n```bash\n# macOS\nbrew install gh\n\n# Linux (Debian/Ubuntu)\nsudo apt install gh\n\n# Windows\nwinget install --id GitHub.cli\n\n# Authenticate\ngh auth login\n```\n\n### Install labels-config\n\n```bash\nnpm install -g @boxpistols/labels-config\n```\n\n---\n\n## Usage\n\n### Understanding init vs sync\n\n**Important:** The `init` command creates a local configuration file - it does NOT sync to GitHub.\n\n| Command | What it does |\n|---------|--------------|\n| `init` | Creates `labels.json` locally (no GitHub changes) |\n| `sync` | Applies `labels.json` to your GitHub repository |\n\n**Example workflow:**\n```bash\n# Step 1: Create local config file (no GitHub changes yet)\nlabels-config init prod-ja --file labels.json\n\n# Step 2: Check what's in the file\ncat labels.json\n\n# Step 3: Apply to GitHub (this actually changes your labels)\nlabels-config sync --owner your-name --repo your-repo --file labels.json\n```\n\n### 1. Create label configuration\n\n**From template:**\n```bash\nlabels-config init minimal --file labels.json\n```\n\n**Available templates:**\n- `minimal` - Basic 3-label set (bug, feature, documentation)\n- `github` - GitHub standard labels\n- `prod-ja` - Production project (Japanese, 14 labels)\n- `prod-en` - Production project (English, 14 labels)\n- `agile` - Agile/Scrum workflow\n- `react`, `vue`, `frontend` - Framework-specific\n\n### 2. Validate configuration\n\n```bash\nlabels-config validate labels.json\n```\n\n### 3. Preview changes (dry run)\n\n```bash\nlabels-config sync \\\n  --owner your-name \\\n  --repo your-repo \\\n  --file labels.json \\\n  --dry-run \\\n  --verbose\n```\n\n### 4. Sync to GitHub\n\n**Append mode** (default - keeps existing labels):\n```bash\nlabels-config sync --owner your-name --repo your-repo --file labels.json\n```\n\n**Replace mode** (removes unlisted labels):\n```bash\nlabels-config sync --owner your-name --repo your-repo --file labels.json --delete-extra\n```\n\n### 5. Export existing labels\n\n```bash\nlabels-config export --owner your-name --repo your-repo --file exported.json\n```\n\n---\n\n## CLI Commands\n\n| Command | Description |\n|---------|-------------|\n| `init <template>` | Create label config from template |\n| `validate <file>` | Validate label configuration |\n| `sync` | Sync labels to GitHub |\n| `export` | Export labels from GitHub |\n| `help` | Show help |\n\n### Options\n\n| Option | Description |\n|--------|-------------|\n| `--owner <name>` | Repository owner |\n| `--repo <name>` | Repository name |\n| `--file <path>` | Config file path |\n| `--dry-run` | Preview changes only |\n| `--delete-extra` | Delete unlisted labels (replace mode) |\n| `--verbose` | Show detailed output |\n\n---\n\n## Label Configuration Format\n\n```json\n{\n  \"version\": \"1.0.0\",\n  \"labels\": [\n    {\n      \"name\": \"bug\",\n      \"color\": \"d73a4a\",\n      \"description\": \"Something isn't working\"\n    },\n    {\n      \"name\": \"feature\",\n      \"color\": \"0e8a16\",\n      \"description\": \"New feature request\"\n    }\n  ]\n}\n```\n\n**Requirements:**\n- `name`: 1-50 characters\n- `color`: 3 or 6 character hex code (without #)\n- `description`: 1-200 characters\n\n---\n\n## Sync Modes\n\n### Append Mode (Default)\nAdds new labels and updates existing ones. Keeps labels not in your config.\n\n```bash\nlabels-config sync --owner user --repo repo --file labels.json\n```\n\n### Replace Mode\nDeletes all labels not in your config. Complete control.\n\n```bash\nlabels-config sync --owner user --repo repo --file labels.json --delete-extra\n```\n\n⚠️ **Warning**: Replace mode removes labels from all issues and PRs. Always use `--dry-run` first!\n\n---\n\n## Multi-Repository Sync\n\nSync the same labels to multiple repositories:\n\n```bash\n#!/bin/bash\nREPOS=(\"org/repo1\" \"org/repo2\" \"org/repo3\")\n\nfor REPO in \"${REPOS[@]}\"; do\n  OWNER=$(echo $REPO | cut -d'/' -f1)\n  REPO_NAME=$(echo $REPO | cut -d'/' -f2)\n\n  labels-config sync \\\n    --owner $OWNER \\\n    --repo $REPO_NAME \\\n    --file labels.json \\\n    --verbose\ndone\n```\n\n---\n\n## Workflow Integration\n\n### GitHub Actions\n\n```yaml\nname: Sync Labels\n\non:\n  push:\n    paths:\n      - 'labels.json'\n    branches:\n      - main\n\njobs:\n  sync:\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v4\n\n      - name: Setup Node.js\n        uses: actions/setup-node@v4\n        with:\n          node-version: '18'\n\n      - name: Install labels-config\n        run: npm install -g @boxpistols/labels-config\n\n      - name: Install gh CLI\n        run: |\n          sudo apt update\n          sudo apt install gh -y\n\n      - name: Authenticate gh CLI\n        env:\n          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}\n        run: echo \"$GITHUB_TOKEN\" | gh auth login --with-token\n\n      - name: Sync labels\n        run: |\n          labels-config sync \\\n            --owner ${{ github.repository_owner }} \\\n            --repo ${{ github.event.repository.name }} \\\n            --file labels.json \\\n            --verbose\n```\n\n---\n\n## 🔐 Security & Publishing\n\n### Automated npm Publishing with Trusted Publishers (OIDC)\n\nThis package uses **npm Trusted Publishers (OIDC)** for secure, automated publishing. No long-lived tokens required!\n\n**Key Features:**\n- ✅ Zero token management - GitHub Actions authenticates automatically\n- ✅ Enhanced security - No risk of token leakage\n- ✅ Automatic provenance - Package authenticity verification\n- ✅ Auto-release on merge - Patch version published when merging to main\n\n### How It Works\n\n**Automatic Release (main branch):**\n```bash\n# When you merge to main, the system automatically:\n# 1. Bumps the patch version (e.g., 0.2.0 → 0.2.1)\n# 2. Builds the package\n# 3. Publishes to npm with provenance\n# 4. Pushes the version tag\n```\n\n**Manual Release:**\nUse GitHub Actions UI to trigger manual releases with custom version bumps:\n- Navigate to **Actions** → **Manual Release**\n- Choose version type: `patch` / `minor` / `major` / `prerelease`\n- Run the workflow\n\n**Skip Auto-Release:**\nInclude `[skip ci]` or `[no release]` in your commit message:\n```bash\ngit commit -m \"docs: update README [skip ci]\"\n```\n\n### Setup Required\n\nFor maintainers: OIDC publishing requires one-time setup in npm. See the detailed guide:\n\n📖 **[Complete OIDC Setup Guide (in Japanese)](./docs/NPM_SETUP.md)**\n\n> **Note:** npm Trusted Publisher setup must be done via [npmjs.com](https://www.npmjs.com/) Web UI.\n> CLI/terminal configuration is not currently supported by npm.\n\n### Migration from Local Release Scripts\n\nThe following npm scripts have been **removed** (now automated via GitHub Actions):\n\n```bash\n# 🚫 No longer available\nnpm run release:patch\nnpm run release:minor\nnpm run release:major\nnpm run release:beta\n```\n\nAll releases are now handled automatically through GitHub Actions workflows.\n\n---\n\n## Troubleshooting\n\n### Authentication failed\n\n```bash\n# Check gh CLI status\ngh auth status\n\n# Re-authenticate\ngh auth login\n\n# Refresh authentication\ngh auth refresh\n```\n\n### Validation errors\n\n```bash\n# Run validation to see specific errors\nlabels-config validate labels.json\n\n# Common issues:\n# - Duplicate label names\n# - Invalid hex colors (must be 3 or 6 chars without #)\n# - Name too long (max 50 chars)\n# - Description too long (max 200 chars)\n```\n\n### Labels not syncing\n\n```bash\n# Check with verbose output\nlabels-config sync --owner user --repo repo --file labels.json --verbose\n\n# Try dry run to see what would change\nlabels-config sync --owner user --repo repo --file labels.json --dry-run --verbose\n```\n\n### Rate limit exceeded\n\n```bash\n# Check rate limit status\ngh api rate_limit\n\n# Wait for reset (typically 60 minutes)\n```\n\n---\n\n## Best Practices\n\n**✅ DO:**\n- Keep `labels.json` in version control\n- Run `--dry-run` before actual sync\n- Use semantic commit messages\n- Document label purposes in your project\n- Use consistent colors across projects\n\n**❌ DON'T:**\n- Delete labels without checking issue/PR usage\n- Change label names frequently\n- Skip validation before syncing\n\n---\n\n## Advanced Usage\n\n### As npm Package\n\nYou can also use this as a library in your code:\n\n```typescript\nimport { GitHubLabelSync } from '@boxpistols/labels-config/github'\nimport { CONFIG_TEMPLATES } from '@boxpistols/labels-config'\n\nconst sync = new GitHubLabelSync({\n  owner: 'your-org',\n  repo: 'your-repo'\n})\n\nconst labels = CONFIG_TEMPLATES.minimal\nawait sync.syncLabels(labels)\n```\n\nInstall in your project:\n```bash\nnpm install @boxpistols/labels-config\n```\n\n---\n\n## License\n\nMIT\n\n---\n\n## Related\n\n- [日本語 README](./README.ja.md)\n- [npm Publish Release Flow (in Japanese)](./docs/RELEASE_FLOW.md)\n- [npm OIDC Setup Guide (in Japanese)](./docs/NPM_SETUP.md)\n\n---\n\n**Made for terminal users who love gh CLI** 🚀\n","readmeFilename":"README.md"}