Skip to content

feat: add CLI package and shared extraction layer#79

Merged
wangdicoder merged 3 commits intomasterfrom
feat/cli-package
Mar 25, 2026
Merged

feat: add CLI package and shared extraction layer#79
wangdicoder merged 3 commits intomasterfrom
feat/cli-package

Conversation

@wangdicoder
Copy link
Owner

Summary

  • Add @tiny-design/cli — a CLI tool for querying component metadata, docs, demos, tokens, and icons from the terminal (fully offline, agent-optimized)
  • Extract shared extraction logic into @tiny-design/extract (internal private: true package) to eliminate duplication between MCP and CLI
  • Refactor @tiny-design/mcp to import types and extraction functions from the shared package
  • Add CLI documentation page (English + Chinese) to the docs site
  • Reorganize Guide sidebar menu into 4 grouped sections: Overview, Getting Started, AI, Resources

CLI Commands

Command Description
tiny-design list List all 80+ components by category
tiny-design info <component> Props table with types, defaults
tiny-design doc <component> Full markdown documentation
tiny-design demo <component> [name] Demo source code (TSX)
tiny-design token [category] Design token values
tiny-design icon [search] Search 240+ icons
tiny-design doctor Diagnose project setup issues
tiny-design usage [dir] Scan for import statistics

Release

  • @tiny-design/cli: minor (new package)
  • @tiny-design/mcp: patch (internal refactor, no API changes)

Test plan

  • pnpm install && pnpm build — all packages build successfully
  • pnpm --filter @tiny-design/mcp build — MCP builds with shared extraction
  • pnpm --filter @tiny-design/cli build — CLI builds and extracts metadata
  • node packages/cli/dist/index.js list — lists all components
  • node packages/cli/dist/index.js info Button --format json — JSON output works
  • node packages/cli/dist/index.js doc Button --lang zh — Chinese docs work
  • node packages/cli/dist/index.js demo Button Type — demo code displayed
  • node packages/cli/dist/index.js token colors — token values shown
  • node packages/cli/dist/index.js icon arrow — icon search works
  • node packages/cli/dist/index.js doctor — diagnostics run
  • pnpm --filter @tiny-design/docs build — docs build with new CLI page and grouped Guide menu

- Add @tiny-design/cli with 8 commands: list, info, doc, demo, token, icon, doctor, usage
- Extract shared extraction logic into @tiny-design/extract (internal package)
- Refactor @tiny-design/mcp to use shared extraction package
- Add CLI documentation page (en + zh) to docs site
- Reorganize Guide sidebar menu into 4 groups: Overview, Getting Started, AI, Resources
- Update extract test imports from deleted local scripts to @tiny-design/extract
- Use import.meta.url for __dirname in ESM test files
- Remove rootDir from MCP tsconfig to allow cross-package type imports
- Add --passWithNoTests to CLI test script
@wangdicoder wangdicoder merged commit 5b6860a into master Mar 25, 2026
1 check passed
@wangdicoder wangdicoder deleted the feat/cli-package branch March 25, 2026 10:39
@github-actions github-actions bot mentioned this pull request Mar 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant