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

ollama-console-markdown-display

v1.0.0

Published

Chat with Ollama models in your terminal with beautifully rendered markdown output, clipboard-copyable code blocks, and thinking mode. Powered by Bun.

Readme

Ollama Console Markdown Display

Chat with Ollama models in your terminal with beautifully rendered markdown output and clipboard-copyable code blocks. Powered by Bun v1.3.12's Bun.markdown.ansi() API.

Requirements

  • macOS (ARM or Intel)
  • Bun v1.3.12+
  • Ollama running locally

Usage

One-liner mode

# Basic question
bun run index.ts "explain closures in JavaScript"

# Specify a model
bun run index.ts -m qwen3.5:4b "write fizzbuzz in python"

# Save response to a file
bun run index.ts -o response.md "create a REST API in Node.js"

# Enable thinking/reasoning mode
bun run index.ts -t "why is the sky blue"

# Combine flags: custom model + thinking + save output
bun run index.ts -m qwen3.5:27b -t -o answer.md "explain monads"

Interactive chat mode

# Start chat with default model
bun run index.ts

# Start chat with a specific model
bun run index.ts -m qwen3.5:27b

# Start chat with thinking mode enabled
bun run index.ts -t

# Start chat with auto-save to file
bun run index.ts -o session.md

# Combine: specific model + thinking + output
bun run index.ts -m qwen3.5:4b -t -o log.md

Read a markdown file

# Auto-detect .md file
bun run index.ts README.md

# Explicit flag
bun run index.ts -r notes.md

Show help

bun run index.ts -h

Options

| Flag | Description | | --------------------- | ---------------------------------------- | | -m, --model <name> | Model to use (default: qwen3.5:latest) | | -o, --output <file> | Save response markdown to a file | | -r, --read <file> | Render a markdown file in the terminal | | -t, --think | Enable thinking/reasoning mode | | -h, --help | Show help |

Chat commands

| Command | Action | | --------------- | --------------------------------- | | copy <n> | Copy code block #n to clipboard | | copy all | Copy all code blocks to clipboard | | save <file> | Save last response to a file | | model <name> | Switch to a different model | | models | List available Ollama models | | think | Toggle thinking mode on/off | | think on/off | Set thinking mode explicitly | | exit / quit | End the chat |

Features

  • Streaming — tokens appear in real-time, then get replaced with formatted markdown
  • Rendered markdown — headings, lists, bold, italic, code blocks with language labels
  • Read .md files — render any markdown file in the terminal with syntax coloring
  • Code block clipboard — numbered code blocks with copy <n> to pbcopy
  • Save output — save responses to markdown files with -o flag or save command
  • Model switching — switch models mid-chat with model <name>, list with models
  • Thinking mode — enable chain-of-thought reasoning with -t flag or think command
  • Conversation memory — chat mode maintains full message history

Compile to Executable

Build a standalone binary with no runtime dependencies using bun build --compile:

bun build --compile index.ts --outfile ollama-chat

Then run it directly:

./ollama-chat "explain async/await in JavaScript"
./ollama-chat -t -m qwen3.5:27b
./ollama-chat README.md

Optionally move it to your PATH:

mv ollama-chat /usr/local/bin/