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

@oneuptime/copilot

v9.2.12

Published

Standalone OneUptime Copilot coding agent CLI

Readme

OneUptime Copilot Agent

A standalone CLI coding agent that mirrors the autonomous workflows we use inside VS Code Copilot Chat. It connects to LM Studio, Ollama, OpenAI, or Anthropic chat-completion models, inspects a workspace, reasons about the task, and uses a toolbox (file/patch editing, search, terminal commands) to complete coding requests.

Prerequisites

  • Node.js 18+
  • At least one supported LLM provider:
    • LM Studio exposing a chat completions endpoint (for example http://localhost:1234/v1/chat/completions).
    • Ollama running locally with the OpenAI-compatible HTTP server (default http://localhost:11434/v1/chat/completions).
    • OpenAI API access and an API key with chat-completions enabled.
    • Anthropic API access and an API key with Messages API enabled.
  • The workspace you want the agent to modify must already exist locally.

Installation

cd Copilot
npm install
npm run build
npm link   # optional, provides the global oneuptime-copilot command

Usage

LM Studio (local HTTP endpoint)

oneuptime-copilot \
  --prompt "Refactor auth middleware and add unit tests" \
  --provider lmstudio \
  --model http://localhost:1234/v1/chat/completions \
  --model-name openai/gpt-oss-20b \
  --workspace-path ./

OpenAI (hosted)

oneuptime-copilot \
  --prompt "Refactor auth middleware and add unit tests" \
  --provider openai \
  --model-name gpt-4o-mini \
  --api-key "$OPENAI_API_KEY" \
  --workspace-path ./

Anthropic (hosted)

oneuptime-copilot \
  --prompt "Refactor auth middleware and add unit tests" \
  --provider anthropic \
  --model-name claude-3-5-sonnet-latest \
  --api-key "$ANTHROPIC_API_KEY" \
  --workspace-path ./

Ollama (local OpenAI-compatible endpoint)

oneuptime-copilot \
  --prompt "Refactor auth middleware and add unit tests" \
  --provider ollama \
  --model-name mistral:7b-instruct \
  --workspace-path ./

CLI options

| Flag | Description | | ---- | ----------- | | --prompt | Required. Natural language description of the task. | | --provider | Selects the LLM backend: lmstudio (default), ollama, openai, or anthropic. | | --model | Endpoint override. Required for lmstudio; optional for other providers (defaults to their hosted or local API). | | --workspace-path | Required. Absolute or relative path to the repo the agent should use. | | --model-name | Provider-specific model identifier (default lmstudio). | | --temperature | Sampling temperature (default 0.1). | | --max-iterations | Maximum agent/tool-call loops before stopping (default 100). | | --timeout | LLM HTTP timeout per request in milliseconds (default 120000). | | --api-key | Required for OpenAI/Anthropic; optional bearer token for secured LM Studio/Ollama endpoints. | | --log-level | debug, info, warn, or error (default info). | | --log-file | Optional file path. When provided, all logs are appended to this file in addition to stdout. |

Provider cheatsheet:

  • lmstudio – Always pass a full HTTP endpoint via --model. API keys are optional.
  • ollama – Defaults to http://localhost:11434/v1/chat/completions; override with --model when remote tunneling. API keys are optional.
  • openai – Provide --api-key and --model-name (for example gpt-4o-mini). --model is optional and defaults to https://api.openai.com/v1/chat/completions.
  • anthropic – Provide --api-key and --model-name (for example claude-3-5-sonnet-latest). --model falls back to https://api.anthropic.com/v1/messages when omitted.

Debug logging

Pass --log-file when running the agent to persist verbose debugging output (including debug level messages) for later inspection:

oneuptime-copilot \
  --prompt "Track flaky jest tests" \
  --provider lmstudio \
  --model http://localhost:1234/v1/chat/completions \
  --workspace-path ./ \
  --log-file ./logs/copilot-agent-debug.log

The agent will create any missing parent directories and continuously append to the specified file while still streaming logs to stdout.

Architecture snapshot

  • src/agent – Orchestrates the conversation loop, builds the system prompt (inspired by the VS Code Copilot agent), snapshots the workspace, and streams messages to the configured provider.
  • src/tools – Implements the toolbelt (list_directory, read_file, search_workspace, apply_patch, write_file, run_command). These wrap Common utilities (Execute, LocalFile, Logger) to stay consistent with other OneUptime services.
  • src/llm – Contains the LM Studio/Ollama/OpenAI-compatible clients plus the native Anthropic adapter, all using undici with timeout + error handling.
  • src/@types/Common – Lightweight shim typings so TypeScript consumers get the pieces of Common they need without re-compiling that entire package.

Development scripts

npm run build   # Compile TypeScript -> build/dist
npm run dev     # Run with ts-node for quick experiments

For example:

npm run dev -- --prompt "Write tests for this project. These tests should be in Jest and TypeScript." \
  --provider lmstudio \
  --model http://localhost:1234/v1/chat/completions \
  --model-name deepseek/deepseek-r1-0528-qwen3-8b \
  --workspace-path ./ \
  --log-file ./copilot-agent-debug.log

The agent intentionally mirrors Copilot’s workflow: it iteratively plans, reads files, edits them through patches or full rewrites, and executes commands/tests via the terminal tool. Logs stream to stdout so you can follow each tool invocation in real time.