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

@sensecall/govuk-rewrite-cli

v0.2.1

Published

A tiny CLI that rewrites text into GOV.UK-style content

Downloads

177

Readme

@sensecall/govuk-rewrite-cli

A minimal CLI that rewrites text into GOV.UK-style content. Supports one-shot rewrites, piped input, and an interactive chat mode.

Install

npm install -g @sensecall/govuk-rewrite-cli

Quick start

govuk-rewrite setup
govuk-rewrite "Please kindly complete the form below"
# Complete the form below.

Commands

One-shot rewrite

govuk-rewrite "Please kindly complete the form below"

Piped input

echo "Click here to find out more" | govuk-rewrite
cat content.txt | govuk-rewrite

Flags

| Flag | Description | |---|---| | --explain | Print short explanation bullets after the rewrite | | --check | Check for style issues without rewriting | | --diff | Show a line diff of changes | | --json | Output structured JSON | | --provider | Override provider (openai, anthropic, openrouter) | | --model | Override model name | | --mode | Content type hint (see below) | | --context | Additional context for the rewrite | | --no-spinner | Suppress the spinner | | --copy | Copy rewritten text to clipboard |

Content modes

govuk-rewrite --mode error-message "Please enter a valid date"

Available modes: page-body, error-message, hint-text, notification, button

Interactive chat

govuk-rewrite chat

Stays open until /quit or Ctrl+C when input is empty. Paste text to rewrite, use /help for shortcuts. Paste multiline content, then press Enter to send it. The composer stays single-line and switches to a clear PASTE READY state with:

  • explicit actions (Enter to send, Ctrl+C to clear)
  • an unsent preview of the first 2 lines
  • a +N more lines summary when applicable

Chat commands:

/help
/provider <openai|anthropic|openrouter>
/model <name>
/mode <page-body|error-message|hint-text|notification|button>
/context <text>
/context clear
/explain on|off
/check on|off
/diff on|off
/json on|off
/tokens on|off
/show
/quit

Chat shortcuts:

Ctrl+C            Clear input (or exit if empty)
?                 Toggle shortcut help

Setup wizard

govuk-rewrite setup

Writes provider, model, and timeout settings to your config file. API keys are never stored — the wizard prints the exact export command to add to your shell profile.

Configuration

Precedence: CLI flags > environment variables > config file > defaults.

Config file location

  • macOS/Linux: ~/.config/govuk-rewrite/config.json
  • Windows: %APPDATA%\govuk-rewrite\config.json

Environment variables

OPENAI_API_KEY
ANTHROPIC_API_KEY
OPENROUTER_API_KEY
GOVUK_REWRITE_PROVIDER
GOVUK_REWRITE_MODEL
GOVUK_REWRITE_TIMEOUT_MS
GOVUK_REWRITE_BASE_URL

Exit codes

| Code | Meaning | |---|---| | 0 | Success | | 1 | Runtime / provider / config error | | 2 | Usage error |

Library

If you want to use the rewrite engine directly in your own code, install @sensecall/govuk-rewrite instead.

Repository

github.com/sensecall/govuk-rewrite