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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@gibsonsc/divergent-flow-cli

v0.1.7

Published

Divergent Flow CLI - tools empowering neurodivergent minds to flow.

Readme

Divergent Flow CLI

Tools empowering neurodivergent minds to flow.

Install

Install globally from npm:

npm install -g divergent-flow-cli

Then run:

divergent-flow --help

Usage

After installing globally, use either divergent-flow or the short alias dflw:

# Show help
divergent-flow --help

# Show CLI version
divergent-flow version

# Show API version (calls the Divergent Flow API)
divergent-flow version api

# First-time setup (guided prompts)
divergent-flow config init

# View or change config values
divergent-flow config list
divergent-flow config get API_BASE_URL
divergent-flow config set API_BASE_URL http://localhost:3001
divergent-flow config unset USER_ID

# Quick capture
divergent-flow dump "Write down that idea quickly"

# Start interactive capture session
divergent-flow dump session

Configuration is stored in ~/.grindrc (JSON). Important keys:

  • APP_MODE: divergent (default) or typical
  • API_BASE_URL: Base URL for the API (e.g., http://localhost:3001)
  • LOG_LEVEL: info, warn, error, debug
  • USER_ID: Optional; if set, the CLI includes this when creating captures

Prerequisites

  • Node.js >= 18
  • API server must be running and accessible at http://localhost:8080/openapi.json for API client generation

Getting Started

Install dependencies

npm install

Run the CLI (development)

npm run dev

Run the CLI (built)

npm run build
npm start

Direct Commands

  • npm run dev version — Show CLI version
  • npm run dev version api — Show API version (calls API)

API Client Generation

The API client is generated from the OpenAPI spec using openapi-typescript-codegen.

To regenerate the API client after API changes:

  1. Ensure the API server is running and accessible at http://localhost:8080/openapi.json.
  2. Run:
npm run generate:api-client

This will update the files in src/api-client/.

Manual Files to Maintain

After generating the API client, you must maintain these files manually:

  • src/api-client/interfaces/IApiClient.ts — TypeScript interface for the API client (for DI, mocking, and testability)
  • src/api-client/ApiClientImpl.ts — Concrete implementation of IApiClient that wires up the generated services
  • src/di/container.ts — tsyringe DI container setup (registers ApiClientImpl for IApiClient)

If you add new API endpoints/services, update these files to reflect the changes.

Dependency Injection

This CLI uses tsyringe for dependency injection. All commands that use the API client resolve it via the DI container for consistency and testability.

Project Structure

  • src/commands/ — CLI command modules
  • src/menus/ — Menu UI logic
  • src/api-client/ — Generated API client and manual interface/implementation
  • src/di/ — Dependency injection container setup
  • src/index.ts — CLI entry point and command router

CLI Configuration (.grindrc)

The CLI stores user configuration in ~/.grindrc as JSON. Some important keys:

  • APP_MODE — UI mode, one of divergent or typical. Set by the interactive init wizard.
  • API_BASE_URL — Base URL for the API (e.g. http://localhost:3001). The CLI uses this for all API calls.
  • USER_ID — Optional: an explicit user id to attach to captures. If set, the CLI will send this userId when creating captures; otherwise the CLI falls back to a placeholder id.
  • LOG_LEVEL — Logging level used by the CLI (info, warn, error, debug).

Examples:

Set or update keys using the CLI config command:

# interactive init (prompts for APP_MODE, API_BASE_URL, LOG_LEVEL)
node dist/index.js config init

# set USER_ID
node dist/index.js config set USER_ID e1ccf5f8-e1d6-4541-ae0a-72946f5fb3d9

# unset/remove USER_ID
node dist/index.js config unset USER_ID

# view current config
node dist/index.js config list

# get a single value
node dist/index.js config get USER_ID

Note: USER_ID is optional and intentionally not part of the interactive init wizard.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Author

GSC Prod, a division of Gibson Service Company, LLC