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

lumbung-cli

v1.0.5

Published

CLI tool for Lumbung Kode - Gudang Snippet Kode Modern

Downloads

25

Readme

🚀 Lumbung CLI - Command Line Interface

Lumbung CLI adalah terminal tool untuk mengelola snippet kode Anda langsung dari command line. Upload, download, dan cari snippet tanpa perlu buka browser!


📋 Daftar Isi

  1. Instalasi
  2. Quick Start
  3. Semua Command
  4. Contoh Penggunaan
  5. Tips & Tricks
  6. Troubleshooting

📦 Instalasi

Opsi 1: Install dari NPM (Recommended)

npm install -g lumbung-cli

Opsi 2: Install dari Source

git clone https://github.com/sofyan2108/lumbung-kode-ta.git
cd lumbung-kode-ta/cli
npm install
npm link

Verifikasi Instalasi:

lumbung --version

Quick Start

1. Login ke Akun Anda

lumbung login

Masukkan email & password yang sama dengan akun web app.

2. Upload Snippet Pertama

lumbung push myfile.js --public

3. Lihat Semua Snippet Anda

lumbung list

4. Download Snippet

lumbung get <snippet-id> --output downloaded.js

Selesai! 🎉


📖 Semua Command

🔐 Authentication

lumbung login

Login ke akun Lumbung Kode Anda.

lumbung login

Interactive prompt:


lumbung logout

Keluar dari akun.

lumbung logout

lumbung whoami

Cek status login saat ini.

lumbung whoami

📤 Upload Snippet

lumbung push <file>

Upload file sebagai snippet.

Basic Usage:

lumbung push myfile.js

Dengan Metadata Lengkap:

lumbung push component.jsx \
  --title "React Hook: useAuth" \
  --description "Custom authentication hook untuk login" \
  --tags "react,hooks,auth,custom" \
  --public \
  --dependencies '["react","zustand"]' \
  --usage "const { user, login } = useAuth()" \
  --docs "https://docs.example.com/hooks"

Options:

| Option | Alias | Deskripsi | Contoh | |--------|-------|-----------|---------| | --title <text> | -t | Judul snippet | --title "My Component" | | --description <text> | -d | Deskripsi snippet | --description "Does XYZ" | | --language <lang> | -l | Bahasa pemrograman | --language javascript | | --tags <tags> | - | Tags (pisah koma) | --tags "react,hooks" | | --public | - | Buat public | --public | | --dependencies <json> | - | Dependencies (JSON array) | --dependencies '["react"]' | | --usage <example> | - | Contoh penggunaan | --usage "import ..." | | --docs <url> | - | URL dokumentasi | --docs "https://..." |

Auto-Detect Language: CLI otomatis detect bahasa dari file extension:

  • .js, .jsx → JavaScript
  • .ts, .tsx → TypeScript
  • .py → Python
  • .java → Java
  • dll.

📥 Download Snippet

lumbung get <id>

Ambil snippet berdasarkan ID.

Tampilkan di Terminal:

lumbung get 8ad61948-9251-49be-887e-c215ec3839c5

Save ke File:

lumbung get 8ad61948-9251-49be-887e-c215ec3839c5 --output myfile.jsx

Copy ke Clipboard:

lumbung get 8ad61948-9251-49be-887e-c215ec3839c5 --copy

Options:

| Option | Alias | Deskripsi | |--------|-------|-----------| | --output <file> | -o | Simpan ke file | | --copy | -c | Copy ke clipboard |


📋 List Snippets

lumbung list

Tampilkan daftar snippet Anda.

Basic:

lumbung list

Filter By Language:

lumbung list --language javascript

Limit Results:

lumbung list --limit 20

Public Snippets Only:

lumbung list --public

Output as JSON:

lumbung list --json

Options:

| Option | Alias | Deskripsi | |--------|-------|-----------| | --language <lang> | -l | Filter by bahasa | | --limit <number> | -n | Max results (default: 10) | | --public | - | Hanya public snippets | | --json | - | Output format JSON |


🔍 Search Snippets

lumbung search <query>

Cari snippet dengan full-text search.

Basic Search:

lumbung search "react hooks"

Search My Snippets:

lumbung search "authentication" --mine

Search Public Snippets:

lumbung search "api client" --public

Filter + Limit:

lumbung search "useState" --language javascript --limit 5

Options:

| Option | Alias | Deskripsi | |--------|-------|-----------| | --language <lang> | -l | Filter by bahasa | | --limit <number> | -n | Max results (default: 10) | | --mine | - | Hanya snippet saya | | --public | - | Hanya public snippets |


💡 Contoh Penggunaan

Skenario 1: Upload Project File

# Navigasi ke folder project
cd D:/Projects/MyApp

# Upload dengan metadata lengkap
lumbung push src/components/Header.jsx \
  --title "Responsive Header Component" \
  --description "Header dengan dark mode support" \
  --tags "react,component,responsive,darkmode" \
  --dependencies '["react","lucide-react"]' \
  --public

Skenario 2: Cari & Download Snippet

# Cari snippet authentication
lumbung search "authentication" --public

# Download snippet yang ditemukan
lumbung get abc123...xyz --output auth-helper.js

Skenario 3: Backup Semua Snippet

# List semua snippet dalam JSON
lumbung list --json > my-snippets.json

# Loop & download satu per satu (Bash/PowerShell)
# ... (user bisa bikin script sendiri)

🎯 Tips & Tricks

1. Absolute vs Relative Path

# Relative path (dari current directory)
lumbung push ./src/utils.js

# Absolute path (dari mana saja)
lumbung push D:/Projects/app/helper.js

2. Escape JSON String di Windows

Jika pakai PowerShell, escape quotes dengan backslash:

lumbung push file.js --dependencies '[\"react\",\"zustand\"]'

Atau gunakan single quotes:

lumbung push file.js --dependencies '["react","zustand"]'

3. Kombinasi dengan Pipe

# Search & save IDs to file
lumbung search "react" --json | jq '.[] | .id' > snippet-ids.txt

4. Alias/Shortcut

Tambahkan ke .bashrc atau .zshrc:

alias lp='lumbung push'
alias ll='lumbung list'
alias lg='lumbung get'

🐛 Troubleshooting

Error: "Not logged in"

Solution:

lumbung login

Error: "Invalid API key"

Credentials expired. Login ulang:

lumbung logout
lumbung login

Error: "File not found"

Pastikan path ke file benar:

# Cek file exists
ls myfile.js

# Gunakan absolute path
lumbung push D:/full/path/to/file.js

JSON Parse Error (--dependencies)

Pastikan JSON valid:

# ❌ Salah
--dependencies ["react"]

# ✅ Benar
--dependencies '["react","zustand"]'

📚 Resources

  • Web App: https://lumbungkode.netlify.app
  • GitHub: https://github.com/sofyan2108/lumbung-kode-ta
  • NPM Package: https://npmjs.com/package/lumbung-cli

🆘 Butuh Bantuan?

# Help untuk semua command
lumbung --help

# Help untuk command tertentu
lumbung push --help
lumbung get --help

Made with ❤️ for Developers | Tugas Akhir Informatika 2026