Skip to content

Add agentview command + refactor CLI into command-registry architecture#1

Open
InlinePizza wants to merge 1 commit intomainfrom
feat/agentview
Open

Add agentview command + refactor CLI into command-registry architecture#1
InlinePizza wants to merge 1 commit intomainfrom
feat/agentview

Conversation

@InlinePizza
Copy link
Copy Markdown
Contributor

Summary

  • New agentview subcommand: fetches any HTTP/HTTPS URL and prints the markdown a coding agent would see — strips nav/header/footer/sidebar chrome via turndown, extracts <main> or <article> content first when available
  • CLI refactor: monolithic src/cli.ts split into src/commands/ with a central COMMANDS registry; slop-cop and completion each get their own file
  • Build config: adds tsup.config.ts (ESM bundle, Node 20 target, all deps inlined — ships as a single dist/cli.js)
  • Dependency: turndown + @types/turndown added as dev deps (bundled at build time)

Usage

promptless agentview <url>           # prints markdown to stdout
promptless agentview <url> -o doc.md # saves to a file

Test plan

  • promptless agentview --help shows usage
  • promptless agentview https://nodejs.org/en/about returns clean markdown (no nav, no scripts)
  • promptless agentview <url> -o out.md writes file correctly
  • promptless agentview (no URL) exits 2 with help text
  • promptless agentview not-a-url exits 2 with error
  • promptless slop-cop still works as before
  • promptless completion zsh still works as before

🤖 Generated with Claude Code

…ture

- Extract slop-cop and completion into separate command files under src/commands/
- Add COMMANDS registry (registry.ts) for clean subcommand dispatch
- Add agentview subcommand: fetches a URL and renders the markdown a coding
  agent sees, stripping nav/header/footer chrome via turndown
- Add tsup build config (ESM bundle, Node 20 target, zero external deps)
- Add turndown + @types/turndown for HTML→markdown conversion
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