npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@gitpagedocs/cli

v1.1.55

Published

CLI that scaffolds and maintains gitpagedocs documentation, generates docs with AI, configures GitHub Pages, and runs the MCP server.

Readme

@gitpagedocs/cli

The published npm package of the Git Page Docs monorepo (the command it installs is gitpagedocs). It scaffolds the gitpagedocs/ docs contract, generates docs with AI, configures GitHub Pages, and runs the MCP server.

npm install -g @gitpagedocs/cli   # global (installs the `gitpagedocs` command)
gitpagedocs                       # generate gitpagedocs/ config (config-only)

# or one-off, no install:
npx @gitpagedocs/cli

This package ships its TypeScript sources and runs them via tsx; it depends on the workspace packages @gitpagedocs/tools and @gitpagedocs/mcp (published alongside it).

Commands

| Command | Description | |---|---| | gitpagedocs | Generate gitpagedocs/ config + versioned docs (config-only) | | gitpagedocs --layoutconfig | Also emit local layout templates in gitpagedocs/layouts/ | | gitpagedocs --push --owner <o> --repo <r> [--path <sub>] | Generate, configure Pages, create workflow, commit + push | | gitpagedocs --home | Standalone distribution (gitpagedocshome/: static site + .env + Dockerfile) | | gitpagedocs -i / --interactive | Interactive prompts | | gitpagedocs ai | Interactive AI documentation generator — writes pages in the gitpagedocs pattern (see below) | | gitpagedocs provider [id] · models [provider] | List AI providers / catalog models | | gitpagedocs document[:repo\|:file\|:folder] | Generate documentation with AI in the gitpagedocs pattern | | gitpagedocs password | Set a documentation access password (writes the public key to config.json, prints the private key) | | gitpagedocs deploy / pages [actions\|deploy] | Configure GitHub Pages via Actions + push | | gitpagedocs docs | Refresh managed regions of README/CONTRIBUTING/SECURITY | | gitpagedocs doctor · version · update | Diagnostics / version / update hint | | gitpagedocs mcp start | Start the MCP server over stdio |

The AI-CLI implementation lives in cli/ai/ (relocated from the frontend so the published package is self-contained).

CLI Architecture (Clean Architecture + SOLID)

Layer Overview

cli/
|-- index.mjs                          # Node entry (bootstraps TS presentation via tsx)
|-- package.json                       # the published `gitpagedocs` package
|-- ai/                                # AI documentation CLI (provider/model/paths → markdown)
|-- contracts/                         # Stable contracts for external tooling
|   `-- doc-versions.mjs
|
|-- presentation/                      # Interface/composition root
|   |-- index.ts
|   |-- options/
|   `-- ui/
|
|-- application/                       # Use-cases and ports
|   |-- config-only/handler.mjs
|   |-- home/handler.mjs
|   |-- report/config-only-reporter.mjs
|   |-- use-cases/dispatch-mode.ts
|   `-- ports/cli-runtime-ports.ts
|
|-- domain/                            # Business rules
|   `-- services/sanitize-segment.mjs
|
|-- infrastructure/                    # Side effects and adapters
|   |-- config-only/runtime.mjs
|   `-- home/runtime.mjs
|
|-- builders/                          # Pure config builders
|-- data/                              # Constants and metadata
|-- content/                           # Static docs content
|-- runtime/                           # Low-level runtime helpers
`-- home/                              # Home templates/files

SOLID Principles

| Principle | Application | |-----------|-------------| | SRP | application/report only formats messages; handlers only orchestrate | | OCP | New runtime implementations can be injected through ports | | LSP | dispatch-mode works with any runner implementing CliCommandRunner | | ISP | Split runtime contracts (ConfigOnlyRuntimePort, HomeRuntimePort) | | DIP | Use-cases depend on application/ports, not concrete fs/git/exec |

Clean Architecture

  • Interfaces/Presentation: parse CLI args, resolve mode, wire dependencies in presentation/index.ts
  • Application: orchestrate flows with explicit ports, without direct fs/git/exec imports
  • Domain: sanitize and core rules with no infrastructure dependencies
  • Infrastructure: concrete adapters for runtime side effects
  • Contracts: tools/smoke consumes cli/contracts instead of internal CLI modules

Authorized Routes Pipeline

The CLI now generates authorized-route docs and config entries in PT/EN/ES.

  • Source content: cli/content/docs.mjs (authorizedRoutes key per language)
  • Route metadata: cli/data/route-metas.mjs (ROUTE_META_ID6)
  • Route path mapping: cli/data/path-mappings.mjs (authorized-routes.md)
  • Version config composition: cli/builders/version-config-builder.mjs
  • Doc key resolution: cli/runtime/doc-path-resolver.mjs

Generated artifacts include:

  • gitpagedocs/docs/versions/<version>/config.json with auth and route authorization
  • gitpagedocs/docs/versions/<version>/{pt,en,es}/authorized-routes.md
  • menus-header-md entry dedicated to Authorized Routes

GitHub Pages Push Paths

  • Default project-site publish (--push without --path) targets /<repo>/.
  • Custom project subpath publish (--push --path <segment>) targets /<repo>/<segment>/.
  • --path accepts a single sanitized segment (letters, numbers, ., _, -).

Example:

npx gitpagedocs --owner vidigal-code --repo energy-bill-ai-parser --path git-docs --push

Expected URL after deployment:

https://vidigal-code.github.io/energy-bill-ai-parser/git-docs/

AI CLI (interactive + config file)

The CLI now includes a dedicated interactive AI mode:

npx gitpagedocs ai

What it does

  • asks provider (openai, claude, gemini, ollama)
  • asks API key or Ollama URL
  • asks paths to scan (supports one or many paths, including other repositories)
  • generates documentation in pt, en, es in the gitpagedocs pattern
  • optionally persists config in .gitpagedocsconfig

gitpagedocs pattern output

The model is given a gitpagedocs-aware system prompt and returns documentation split into pages (delimited by === PAGE: <slug> | <Title> ===). The CLI scaffolds the base gitpagedocs/ structure first, then writes each page to gitpagedocs/docs/versions/<latest>/<lang>/<slug>.md for every language and wires it into that version's config.json (routes-md + menus-header-md) so the pages render in the viewer menu. Entries are tagged aiGenerated and idempotent (re-running replaces them). A later plain gitpagedocs rebuild drops the wiring — re-run gitpagedocs ai to restore.

.gitpagedocsconfig (manual mode)

You can create/edit this file manually and then run npx gitpagedocs ai:

{
	"version": 1,
	"ai": {
		"provider": "openai",
		"model": "gpt-4o-mini",
		"apiKey": "<YOUR_API_KEY>",
		"paths": ["src", "cli", "../another-repo/src"],
		"languages": ["pt", "en", "es"],
		"outputDir": "gitpagedocs/docs",
		"filePrefix": "ai-generated",
		"contextPrompt": "Você é um redator técnico sênior..."
	}
}

For Ollama, use baseUrl instead of apiKey.

Interactive fallback

If a directory is not found, CLI offers fallback choices:

  • fix paths and retry
  • skip missing paths and continue
  • abort safely