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

@n5s/bruno-wordpress-converter

v2.0.0

Published

Convert WordPress REST API to Bruno collection format with beautiful interactive CLI

Readme

WordPress REST API to Bruno Converter

Convert any WordPress REST API to a Bruno collection with beautiful interactive CLI or direct command-line usage.

Compatibility

| Package Version | Bruno Version | Format | |-----------------|---------------|--------| | 1.x | Bruno 2.x / 3.x | .bru (Bru Lang) | | 2.x | Bruno 3.x | .yml (OpenCollection) |

Version 2.x generates the OpenCollection YAML format introduced in Bruno 3.

Features

  • Dynamic discovery of all endpoints (core, plugins, custom post types)
  • Organization by namespace and resource type
  • Beautiful interactive CLI with prompts
  • Authentication ready (Basic Auth, Application Passwords)
  • Optional schema fetching for faster conversions

Installation

Local Installation

pnpm add @n5s/bruno-wordpress-converter

Global Installation

pnpm add -g @n5s/bruno-wordpress-converter

After global installation, the wp-to-bruno command is available anywhere:

wp-to-bruno https://example.com/wp-json/

Usage

Interactive Mode (Recommended)

# Local
node src/cli.js

# Global
wp-to-bruno

The CLI will prompt you for:

  • WordPress API URL
  • Collection name (optional, defaults to "{site name} REST API")
  • Output directory
  • Namespace filtering (optional)
  • Schema fetching preference

Command Line Mode

# Local
node src/cli.js https://example.com/wp-json/ -o ./my-api -n "My API"

# Global
wp-to-bruno https://example.com/wp-json/ -o ./my-api -n "My API"

CLI Options

| Option | Alias | Description | |--------|-------|-------------| | --output <dir> | -o | Output directory | | --name <name> | -n | Collection name (defaults to "{site name} REST API") | | --namespaces <list> | | Comma-separated namespaces (e.g., "wp/v2,wc/v3") | | --no-schemas | | Skip detailed schema fetching (faster) | | --username <username> | -u | WordPress username for authentication | | --password <password> | -p | WordPress application password | | --insecure | -k | Allow insecure SSL connections | | --help | -h | Show help |

Examples

# Interactive mode
wp-to-bruno

# Quick conversion with defaults
wp-to-bruno https://example.com/wp-json/

# Full CLI mode
wp-to-bruno https://example.com/wp-json/ -o ./my-api -n "My API"

# Filter specific namespaces
wp-to-bruno https://example.com/wp-json/ --namespaces "wp/v2"

# Fast conversion without schemas
wp-to-bruno https://example.com/wp-json/ --no-schemas

# With authentication (for private/restricted endpoints)
wp-to-bruno https://example.com/wp-json/ -u admin -p "xxxx xxxx xxxx xxxx xxxx xxxx"

# Full example with all options
wp-to-bruno https://example.com/wp-json/ \
  -o ./my-api \
  -n "My Private API" \
  -u admin \
  -p "xxxx xxxx xxxx xxxx xxxx xxxx" \
  --namespaces "wp/v2,custom/v1"

How It Works

  1. Fetches the API index from /wp-json/ to discover all routes
  2. Optionally fetches detailed schemas via OPTIONS requests
  3. Converts WordPress schema to Bruno OpenCollection YAML format
  4. Organizes endpoints by namespace and resource type
  5. Generates .yml files with environment variables

Output Structure

bruno-collection/
├── opencollection.yml         # Collection configuration
├── environments/
│   └── default.yml            # baseUrl, username, password
├── wp-v2/
│   ├── folder.yml
│   ├── posts/
│   │   ├── folder.yml
│   │   ├── list-posts.yml
│   │   ├── create-posts.yml
│   │   ├── get-posts-by-id.yml
│   │   └── ...
│   ├── pages/
│   └── users/
└── [other-namespaces]/

Each endpoint includes:

  • Request details (method, URL, headers)
  • Query/path parameters with descriptions
  • Request body examples for POST/PUT/PATCH

Authentication

During Conversion

For private or restricted endpoints, you can provide authentication credentials during the conversion process:

Interactive Mode: The CLI will prompt you if you need authentication for private endpoints.

Command Line Mode:

wp-to-bruno https://example.com/wp-json/ -u admin -p "xxxx xxxx xxxx xxxx"

Using the Generated Collection

After conversion, configure authentication in environments/default.yml:

name: Default
variables:
  - name: baseUrl
    value: https://example.com/wp-json
  - name: username
    value: your-username
  - name: password
    value: your-application-password

WordPress Application Passwords

Application Passwords (available since WordPress 5.6) are the recommended way to authenticate:

  1. Create an Application Password:

    • Go to WordPress Admin → Users → Profile
    • Scroll to "Application Passwords" section
    • Enter a name (e.g., "Bruno API Client")
    • Click "Add New Application Password"
    • Copy the generated password immediately (it's only shown once)
  2. Use the Password:

    • The password will have spaces (e.g., xxxx xxxx xxxx xxxx)
    • Spaces are automatically removed by the tool
    • You can use it with or without spaces
  3. Security Benefits:

    • Works only for API requests (not site login)
    • Can be revoked anytime without changing your account password
    • Create separate passwords for different applications
    • Works with 2FA-protected accounts

Note: Application Passwords require HTTPS. For local development with self-signed certificates, use the --insecure flag.

Troubleshooting

CORS Errors: Use a CORS plugin or run on the server

Authentication Required: Temporarily disable auth or manually download schema

SSL Certificate Errors: Use --insecure flag for local development with self-signed certificates

License

MIT