{"id":42026096,"url":"https://github.com/pleaseai/cli-toolkit","last_synced_at":"2026-01-26T04:09:12.429Z","repository":{"id":321568477,"uuid":"1086311086","full_name":"pleaseai/cli-toolkit","owner":"pleaseai","description":null,"archived":false,"fork":false,"pushed_at":"2025-10-30T10:06:19.000Z","size":72,"stargazers_count":0,"open_issues_count":2,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-10-30T11:29:26.165Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pleaseai.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-10-30T08:44:45.000Z","updated_at":"2025-10-30T10:06:24.000Z","dependencies_parsed_at":"2025-10-30T11:31:15.282Z","dependency_job_id":null,"html_url":"https://github.com/pleaseai/cli-toolkit","commit_stats":null,"previous_names":["pleaseai/cli-toolkit"],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/pleaseai/cli-toolkit","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Fcli-toolkit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Fcli-toolkit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Fcli-toolkit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Fcli-toolkit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pleaseai","download_url":"https://codeload.github.com/pleaseai/cli-toolkit/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pleaseai%2Fcli-toolkit/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28766485,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-26T03:54:34.369Z","status":"ssl_error","status_checked_at":"2026-01-26T03:54:33.031Z","response_time":59,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-26T04:09:11.703Z","updated_at":"2026-01-26T04:09:12.421Z","avatar_url":"https://github.com/pleaseai.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# @pleaseai/cli-toolkit\n\n[![npm version](https://badge.fury.io/js/@pleaseai%2Fcli-toolkit.svg)](https://badge.fury.io/js/@pleaseai%2Fcli-toolkit)\n[![CI](https://github.com/pleaseai/gh-please/actions/workflows/ci.yml/badge.svg)](https://github.com/pleaseai/cli-toolkit/actions/workflows/ci.yml)\n[![codecov](https://codecov.io/gh/pleaseai/cli-toolkit/graph/badge.svg?token=lAPii2Uj1a)](https://codecov.io/gh/pleaseai/cli-toolkit)\n[![code style](https://antfu.me/badge-code-style.svg)](https://github.com/antfu/eslint-config)\n\nShared CLI utilities for LLM-focused command-line tools.\n\n## Features\n\n- **Output Formatting**: JSON and TOON (Token-Oriented Object Notation) output with field filtering\n- **Internationalization**: Language detection and message management (Korean/English)\n- **Progress Indicators**: Emoji-based status messages for long-running operations\n- **Input Validation**: Type-safe validation for common input patterns\n\n## Installation\n\n```bash\nbun add @pleaseai/cli-toolkit\n```\n\n## Usage\n\n### Output Module\n\nFormat command output as JSON or TOON with optional field filtering:\n\n```typescript\nimport { outputData, parseFields } from '@pleaseai/cli-toolkit/output'\n\nconst data = [\n  { number: 123, title: 'Feature request', state: 'OPEN' },\n  { number: 124, title: 'Bug fix', state: 'CLOSED' },\n]\n\n// JSON output with all fields\noutputData(data, 'json')\n\n// TOON output for LLM consumption (58.9% token savings vs JSON)\noutputData(data, 'toon')\n\n// JSON output with field filtering\nconst fields = parseFields('number,title')\noutputData(data, 'json', fields)\n// Output: [{\"number\": 123, \"title\": \"Feature request\"}, ...]\n```\n\n### i18n Module\n\nManage multilingual messages for your CLI:\n\n```typescript\nimport { detectSystemLanguage, I18nManager } from '@pleaseai/cli-toolkit/i18n'\n\nconst i18n = new I18nManager()\n\n// Register messages\ni18n.register('myapp.issues', 'en', {\n  creating: 'Creating issue...',\n  created: (number: number) =\u003e `Issue #${number} created!`,\n})\n\ni18n.register('myapp.issues', 'ko', {\n  creating: '이슈 생성 중...',\n  created: (number: number) =\u003e `이슈 #${number}가 생성되었습니다!`,\n})\n\n// Auto-detect language and get messages\nconst lang = detectSystemLanguage() // 'ko' or 'en' based on LANG env var\nconst msg = i18n.get('myapp.issues', lang)\n\nconsole.log(msg.creating) // 'Creating issue...' or '이슈 생성 중...'\nconsole.log(msg.created(123)) // 'Issue #123 created!' or '이슈 #123가 생성되었습니다!'\n```\n\n### Progress Module\n\nDisplay user-friendly progress indicators:\n\n```typescript\nimport { createProgressIndicator } from '@pleaseai/cli-toolkit/progress'\n\nconst progress = createProgressIndicator()\n\nprogress.start('Fetching data...') // 📡 Fetching data...\nprogress.update('Processing records...') // ⏳ Processing records...\nprogress.success('Operation completed!') // ✅ Operation completed!\nprogress.error('Operation failed') // ❌ Operation failed\nprogress.info('Additional info') // ℹ️  Additional info\n```\n\n### Validation Module\n\nValidate user inputs with clear error messages:\n\n```typescript\nimport {\n  validateNonEmptyString,\n  validatePattern,\n  validatePositiveInteger,\n} from '@pleaseai/cli-toolkit/validation'\n\n// Validate positive integers\nconst id = validatePositiveInteger('123', 'Issue ID') // 123\n// validatePositiveInteger('0', 'Issue ID') → throws \"Issue ID must be a positive integer\"\n\n// Validate non-empty strings\nconst body = validateNonEmptyString('Hello world', 'Comment body') // 'Hello world' (trimmed)\n// validateNonEmptyString('', 'Comment body') → throws \"Comment body cannot be empty\"\n\n// Validate patterns\nconst username = validatePattern('user123', /^[a-z0-9]+$/, 'Username', 'alphanumeric only')\n// validatePattern('user-123', /^[a-z0-9]+$/, 'Username') → throws \"Username must be alphanumeric only\"\n```\n\n## API Reference\n\n### Output Module\n\n- `outputData(data, format, fields?)` - Output data in JSON or TOON format\n- `outputJson(data)` - Output as JSON\n- `outputToon(data)` - Output as TOON (58.9% token savings)\n- `parseFields(fieldString)` - Parse comma-separated field list\n- `filterFields(data, fields)` - Filter object/array to specified fields\n- `isStructuredOutput(options)` - Check if structured output is requested\n- `validateFormat(format)` - Validate output format\n\n### i18n Module\n\n- `detectSystemLanguage()` - Detect language from environment variables\n- `I18nManager` - Message registry and manager\n  - `register(domain, lang, messages)` - Register message dictionary\n  - `get(domain, lang)` - Get messages for domain and language\n  - `has(domain)` - Check if domain is registered\n  - `hasLanguage(domain, lang)` - Check if language is registered\n- `getCommonMessages(lang)` - Get built-in common messages\n\n### Progress Module\n\n- `createProgressIndicator()` - Create console-based progress indicator\n- `formatSuccess(message)` - Format success message with ✅\n- `formatError(message)` - Format error message with ❌\n- `formatInfo(message)` - Format info message with ℹ️\n- `formatWarning(message)` - Format warning message with ⚠️\n- `formatProgress(message)` - Format progress message with ⏳\n\n### Validation Module\n\n**Numeric:**\n\n- `validatePositiveInteger(value, fieldName?)` - Validate positive integer string\n- `validateNumericId(value, fieldName?)` - Validate positive integer (string or number)\n- `validateRange(value, min, max, fieldName?)` - Validate number within range\n\n**Text:**\n\n- `validateNonEmptyString(value, fieldName?)` - Validate non-empty string\n- `validateMaxLength(value, maxLength, fieldName?)` - Validate string length\n- `validateString(value, maxLength, fieldName?)` - Validate non-empty + max length\n- `validatePattern(value, pattern, fieldName?, description?)` - Validate regex pattern\n\n## TypeScript Support\n\nAll modules are fully typed with TypeScript. Import types directly:\n\n```typescript\nimport type { Language, OutputFormat, ProgressIndicator } from '@pleaseai/cli-toolkit'\n```\n\n## Testing\n\n```bash\nbun test\nbun test --coverage\n```\n\n## License\n\nMIT\n\n## Author\n\nPleaseAI\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleaseai%2Fcli-toolkit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpleaseai%2Fcli-toolkit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpleaseai%2Fcli-toolkit/lists"}