Skip to content

feat(cli): add devw pull command (v0.4)#42

Merged
gpolanco merged 3 commits intomainfrom
feat/pull-command
Feb 11, 2026
Merged

feat(cli): add devw pull command (v0.4)#42
gpolanco merged 3 commits intomainfrom
feat/pull-command

Conversation

@gpolanco
Copy link
Copy Markdown
Owner

@gpolanco gpolanco commented Feb 11, 2026

Summary

  • Add devw pull command to download rules from the official registry on GitHub
  • New modules: converter.ts (Markdown → YAML), github.ts (GitHub API), cache.ts (TTL cache)
  • 6 official rule sets: typescript/strict, javascript/react, javascript/nextjs, css/tailwind, testing/vitest, security/supabase-rls
  • Integration with devw doctor (check pulled files exist) and devw list rules (show pulled indicator)
  • Rules directory moved to content/rules/ for consistency with content/blocks/

Changes

New files (source):

  • packages/cli/src/commands/pull.ts — full command with --list, --force, --dry-run, --no-compile
  • packages/cli/src/core/converter.ts — Markdown frontmatter + bullets → YAML rules
  • packages/cli/src/utils/github.tsfetchRawContent, listDirectory, GitHubError
  • packages/cli/src/utils/cache.ts — disk cache with 1h TTL

New files (content):

  • content/rules/ — 6 rule sets + README (moved from rules/)

Modified files:

  • packages/cli/src/bridges/types.tsPulledEntry, source on Rule, pulled on ProjectConfig
  • packages/cli/src/core/parser.ts — parse pulled[] from config, source from rules
  • packages/cli/src/commands/doctor.tscheckPulledFilesExist() check
  • packages/cli/src/commands/list.ts — pulled indicator in output

Tests (12 files, 257 total):

  • 6 happy-path test files (converter, github, cache, pull, doctor, copilot/windsurf bridge updates)
  • 6 edge-case test files with 69 additional tests covering: malformed inputs, TTL expiration, YAML roundtrips, error wrapping, frontmatter coercion, parser skip/filter behavior

Test plan

  • pnpm build — no TS errors
  • pnpm test — 257 pass, 0 fail
  • Manual: devw pull --list shows categories
  • Manual: devw pull typescript/strict downloads, converts, compiles
  • Manual: devw pull typescript/strict (again) → "Already up to date"
  • Manual: devw doctor → pulled files check passes

Implement rule distribution via GitHub. Users can download official
rules from the dev-workflows registry with devw pull <category>/<rule>.

- Add pull command with --list, --force, --dry-run, --no-compile flags
- Add Markdown to YAML converter for rule files
- Add GitHub API helpers (raw content + contents API)
- Add cache with 1h TTL for registry listing
- Extend types with source field on Rule and pulled[] on ProjectConfig
- Add pulled files check to doctor command
- Add source indicator (pulled/manual) to list command
- Create 6 official rules in rules/ directory (P0 + P1)
- Add tests for converter, github, cache, and pull integration
- Move rules/ directory to content/rules/ for consistency with content/blocks/
- Change BRANCH from 'feat/pull-command' to 'main' in github.ts
- Update RAW_BASE and API_BASE URLs to point to content/rules/
- Update GitHub blob URL in generateYamlOutput
- Add 69 edge-case tests across 6 new test files:
  converter.edge, github.edge, cache.edge,
  pull.edge, parser.edge, doctor.edge
- Export validateInput, generateYamlOutput, updateConfig from pull.ts
@vercel
Copy link
Copy Markdown

vercel Bot commented Feb 11, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
landing Ready Ready Preview, Comment Feb 11, 2026 11:01pm

@gpolanco gpolanco merged commit d96bed1 into main Feb 11, 2026
4 checks passed
@gpolanco gpolanco deleted the feat/pull-command branch February 11, 2026 23:03
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