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

@areai51/sob-cli

v1.0.0

Published

CLI to query Great Britain departments datasets from State of Britain API

Downloads

49

Readme

Britain Departments CLI

A command-line interface for querying Great Britain departments datasets from the State of Britain API. This CLI provides easy access to 18 government datasets covering public services, economy, and society.

Features

  • List all departments - View available datasets with categories and coverage
  • Detailed information - Get comprehensive info about specific departments
  • Smart search - Find datasets by keyword matching
  • Statistics - Overview of available data coverage and frequencies
  • Sample data preview - See actual data structure when exploring departments

Installation

# Clone the repository
git clone <repository-url>
cd sob-cli

# Install dependencies
npm install

# Build the CLI
npm run build

# Link globally (optional)
npm link

Usage

Basic Commands

# Show help
britain-cli --help

# List all available departments
britain-cli list

# Get detailed information about a specific department
britain-cli info spending
britain-cli info nhs
britain-cli info education

# Search departments by keyword
britain-cli search energy
britain-cli search immigration

# Show statistics about available datasets
britain-cli stats

Available Departments

🏛️ State (4 datasets):

  • spending - Public Spending (1978-2030 forecasts)
  • defence - Defence (1990-2024)
  • immigration - Immigration & Demographics (1991-2024)
  • justice - Justice & Policing (2002-2024)

🏗️ Foundations (6 datasets):

  • nhs - NHS Waiting Times & A&E (2012-2026)
  • cpih - Consumer Prices (CPIH) (2010-present)
  • energy - Energy Mix (1990-2024)
  • environment - Emissions & Air Quality (1990-2024)
  • family - Family & Fertility (1960-2024)
  • water - Water Company Performance (2019-2024)

🌱 Growth (8 datasets):

  • startups - Business Demography (2019-2024)
  • investment - Business Investment (1948-2024)
  • education - Education (2003-2024)
  • productivity - Productivity (1971-2024)
  • industrial - Industrial Production (1970-2023)
  • infrastructure - Infrastructure (2000-2025)
  • research - R&D Spending (2018-2023)
  • workforce - Public Sector Workforce (2009-2025)

Development

# Run in development mode
npm run dev

# Build the project
npm run build

# Run tests
./test-cli.sh

Data Sources

All data comes from official UK government sources:

  • Office for Budget Responsibility (OBR)
  • NHS England
  • Office for National Statistics (ONS)
  • Department for Energy Security and Net Zero (DESNZ)
  • HM Treasury
  • Department for Education (DfE)
  • And other official government bodies

License

  • Data: Open Government Licence v3.0
  • CLI Code: MIT License

AgentSkill Integration

This CLI is integrated with an AgentSkill that provides intelligent query capabilities. The skill recognizes when users ask about British government data and automatically uses the appropriate CLI commands to fetch and present information.

Skill Triggers

The AgentSkill activates when users mention:

  • "Britain departments"
  • "UK government data"
  • "public sector statistics"
  • "State of Britain"
  • "government spending"
  • "NHS data"
  • "education statistics"
  • "immigration data"
  • "UK public services data"

Examples

Research Use Cases

# What economic datasets are available?
britain-cli list | grep -E "(investment|spending|productivity)"

# Get NHS waiting times information
britain-cli info nhs

# Find all education-related data
britain-cli search education

Journalism and Analysis

# Overview of all available data
britain-cli stats

# Search for immigration data
britain-cli search immigration

# Get details about defense spending
britain-cli info defence

API Reference

The CLI queries the State of Britain API at:

  • Base URL: https://stateofbritain.github.io/api
  • Index: /index.json
  • Datasets: /data/{id}.json

Testing

Run the test suite:

./test-cli.sh

This will verify all CLI commands are working correctly.

Contributing

  1. Fork the repository
  2. Create a feature branch
  3. Make your changes
  4. Add tests if applicable
  5. Submit a pull request

Troubleshooting

Common Issues

  • Network errors: Ensure you have internet access to reach the State of Britain API
  • Permission errors: Make sure the CLI is properly installed with npm link
  • TypeScript errors: Run npm run build to compile the TypeScript code

Debug Mode

For development, use:

npm run dev

This runs the CLI without compilation, making it easier to debug TypeScript issues.

Support

For issues or questions:

  1. Check the troubleshooting section
  2. Review the test output
  3. Ensure all dependencies are installed
  4. Verify network connectivity to the API