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

habits

v1.4.72

Published

Habits - Unified automation workflow platform combining Cortex executor and Base builder

Readme

habits

Unified automation workflow platform combining Cortex workflow executor and Base module manager.

For full documentation, guides, and schema reference, visit the Habits documentation portal.

Installation

npm install -g habits
# or
npx habits

Commands

Initialize Project

Create a new Habits project with .env and modules.json:

habits init
habits init --force  # Overwrite existing files

Cortex Mode (Workflow Executor)

Start the server in Cortex mode for executing workflows:

habits cortex --config ./stack.yaml
habits cortex -c ./stack.yaml -p 8080  # Custom port

Options:

  • --config, -c - Path to stack.yaml or config.json file (required)
  • --port, -p - Server port (default: 3000)

When running in Cortex mode:

  • Workflow execution API available at /api/:workflowId
  • Cortex management UI at /habits/cortex
  • Base UI embedded at /habits/base

Base Mode (Module Manager)

Start the server in Base mode for building and testing workflows:

habits base
habits base --port 8080
# Alias: habits edit

Options:

  • --port, -p - Server port (default: 3000)

Execute Workflow

Execute a workflow directly in CLI mode without starting a server:

# Execute from workflow file
habits execute ./workflow.json

# Execute by workflow ID from config
habits execute --config ./stack.yaml --id my-workflow

# Execute all workflows from config
habits execute --config ./stack.yaml --all

# Execute with input data
habits execute --config ./stack.yaml --id my-workflow --input '{"key": "value"}'

Convert Workflow

Convert n8n, Activepieces, or Script workflows to Habits format:

habits convert --input ./n8n-workflow.json --output ./habits-workflow.yaml

# Also generate .env template for credentials
habits convert --input ./workflow.json --output ./habits.yaml --env

Environment Variables

  • PORT - Server port (default: 3000)
  • HOST - Server host (default: 0.0.0.0)
  • HABITS_OPENAPI_ENABLED - Enable OpenAPI documentation (default: false)
  • HABITS_MANAGE_ENABLED - Enable management UI (default: false)
  • HABITS_DEBUG - Enable debug mode with verbose output (default: false)
  • HABITS_NODES_PATH - Custom path for downloaded modules

API Endpoints (Cortex Mode)

Workflow Execution

  • GET /misc/workflows - List all loaded workflows
  • GET /misc/workflow/:workflowId - Get workflow details
  • POST /api/:workflowId - Execute a workflow (supports ?stream=true for streaming)
  • GET /misc/execution/:id - Get execution status
  • GET /misc/executions - List all executions
  • DELETE /misc/execution/:id - Cancel execution

Webhooks

  • GET /webhook/health - Webhook health check
  • GET /webhook/list - List webhook endpoints
  • ALL /webhook/:workflowId/:nodeId - Webhook trigger endpoints

Health

  • GET /health - Health check
  • GET / - Frontend UI / Server info

UI Access

Cortex Mode

  • Frontend (Habit UI): http://localhost:3000/
  • Cortex Management UI: http://localhost:3000/habits/cortex
  • Base UI (embedded): http://localhost:3000/habits/base

Base Mode

  • Base UI: http://localhost:3000/habits/base

Programmatic Usage

import { startHabitsServer, startBaseServer } from 'habits';

// Start in Cortex mode
const server = await startHabitsServer({
  configPath: './stack.yaml',
  port: 3000,
});

// Start in Base mode
const baseServer = await startBaseServer({
  port: 3000,
});

License

Apache-2.0