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

@nanokyuuun/nanocli

v1.0.0

Published

Terminal-first AI coding assistant with project memory, agent mode, and multi-model support via OpenRouter

Readme


NanoCLI adalah AI coding assistant yang berjalan sepenuhnya di terminal. Ia menggunakan OpenRouter untuk akses ke berbagai model LLM, menyimpan memori proyek secara lokal dengan SQLite FTS5, dan mendukung mode agent untuk mengeksekusi multi-step coding task secara otomatis.

Fitur Utama

| Fitur | Deskripsi | |-------|-----------| | Chat interaktif | Session chat dengan context compaction otomatis | | Agent mode | Multi-step task execution dengan approval gate | | Project memory | SQLite FTS5 untuk RAG (Retrieval-Augmented Generation) | | Multi-model | Support semua model di OpenRouter via picker UI | | Web search | Integrasi search otomatis berdasarkan konteks | | Code commands | review, debug, patch, test, plan, write, generate | | Security | Env var isolation, secret redaction, audit log |

Prasyarat

  • Node.js 20 atau lebih baru
  • npm 10 atau lebih baru
  • OpenRouter API key — daftar gratis di openrouter.ai

Instalasi

1. Clone repository

git clone <repo-url>
cd NanoCLI

2. Install dependencies

npm install

3. Build

npm run build

4. Install sebagai global command

npm install -g .

Setelah ini, perintah nanocli tersedia di seluruh sistem.

5. Setup API key

nanocli setup

Ikuti prompt untuk memasukkan OpenRouter API key dan memilih model default.

6. Inisialisasi project memory (opsional, tapi direkomendasikan)

nanocli init

Membuat .nanocli/ di direktori project dan mulai mengindeks file untuk RAG.


Penggunaan

Chat Interaktif

nanocli

Membuka sesi chat interaktif. Tekan /help di dalam chat untuk melihat semua perintah.

Quick Ask (non-interaktif)

nanocli ask "Apa itu dependency injection?"
nanocli ask "Jelaskan error ini: ..." --mode high
nanocli ask "Cari pola terbaru" --search on

Agent Mode (multi-step task)

nanocli agent "Buat auth service dengan JWT di src/auth.ts"
nanocli agent "Refactor semua console.log ke logger di folder src/" --dry-run
nanocli agent "Buat unit test untuk semua file di src/commands/" --verbose

Code Commands

# Review kode
nanocli review src/auth.ts

# Debug error
nanocli debug src/auth.ts "TypeError: Cannot read property 'id' of undefined"

# Patch file
nanocli patch src/auth.ts "Tambahkan validasi input di method login"
nanocli patch src/auth.ts "..." --apply   # langsung apply patch

# Generate unit test
nanocli test src/auth.ts --framework vitest

# Buat file baru
nanocli write docs/ARCHITECTURE.md "Dokumentasikan arsitektur sistem auth"

# Implementation plan
nanocli plan "Implementasi fitur notifikasi real-time dengan WebSocket"

# Generate dokumen
nanocli generate prd "Fitur login dengan OAuth2" --out docs/PRD-oauth.md
nanocli generate implementation "Fitur auth" --out docs/IMPL-auth.md

Memory Commands

# Di dalam chat:
/memory review          # Lihat 20 memory terakhir
/memory save <teks>     # Simpan memory manual
/memory forget <id>     # Hapus memory
/memory auto on|off     # Toggle auto-extraction saat exit
/memory update          # Re-index file project

Mode & Model

# Ganti mode kualitas
nanocli ask "..." --mode fast        # Cepat, murah
nanocli ask "..." --mode normal      # Seimbang (default)
nanocli ask "..." --mode high        # Kualitas tinggi
nanocli ask "..." --mode extra-high  # Terbaik, paling mahal

# Ganti model
nanocli model          # Picker interaktif
nanocli model list     # Daftar model tersedia

Terminal Commands

# Jalankan command dengan approval
nanocli run "npm test"
nanocli run "git status"

# Di dalam chat:
/run npm install
/terminal detect      # Deteksi shell tersedia

Struktur Direktori

src/
├── agent/          # AgentLoop, StepRunner, ToolRouter
├── commands/       # ask, review, debug, patch, test, plan, write, generate
├── files/          # ConfigManager, FileOperationManager
├── llm/            # OpenRouterClient, ModelManager
├── memory/         # Indexer (SQLite FTS5), MemoryManager, MemoryExtractor
├── prompts/        # PromptBuilder, system prompts
├── security/       # SecretRedactor, AuditLogger, PolicyEngine
├── terminal/       # CommandExecutor, ShellDetector
├── tokens/         # TokenBudgetManager, StatsManager
└── ui/             # ChatUI, Renderer, ModelPickerUI
tests/              # Vitest test files

Development

# Build ulang setelah perubahan
npm run build

# Typecheck tanpa build
npm run typecheck

# Jalankan test
npm test

# Watch mode untuk test
npm run test:watch

# Typecheck + test sekaligus
npm run check

Konfigurasi

Konfigurasi disimpan di ~/.nanocli/config.json (global) dan .nanocli/ (per-project).

File konfigurasi global berisi:

  • apiKey — OpenRouter API key (dienkripsi)
  • model — Model default per mode (fast, normal, high, extra-high)
  • mode — Mode koneksi: local | share | self-host

Security Notes

  • API key tidak pernah diwariskan ke subprocess (env var whitelist)
  • Secret redaction aktif di output terminal dan audit log
  • Path guard mencegah akses ke file di luar project root
  • Approval gate diperlukan sebelum file write atau command execution

License

ISC © NanoKyuuun