@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 linkUsage
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 statsAvailable 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.shData 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 educationJournalism 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 defenceAPI 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.shThis will verify all CLI commands are working correctly.
Contributing
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- 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 buildto compile the TypeScript code
Debug Mode
For development, use:
npm run devThis runs the CLI without compilation, making it easier to debug TypeScript issues.
Support
For issues or questions:
- Check the troubleshooting section
- Review the test output
- Ensure all dependencies are installed
- Verify network connectivity to the API
