Skip to content

Borgund/nameday-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Navnedag CLI

A command-line interface tool for Norwegian namedays (navnedager). This CLI allows you to search for namedays, check today's nameday, and list all namedays in the database.

Features

  • 🔍 Search namedays by month and/or day
  • 📅 Today's nameday - quickly check what names are celebrated today
  • 📋 List all namedays - view the complete database of Norwegian namedays
  • Fast execution - built with Bun for optimal performance
  • 🗄️ SQLite database - local storage with Norwegian nameday data

Installation

Prerequisites

  • Bun runtime (v1.2.10 or higher)

Setup

  1. Clone the repository:
git clone <repository-url>
cd navnedag-cli
  1. Install dependencies:
bun install
  1. Link the CLI for development:
bun link
bun link navnedag-cli

Usage

Global Usage (after linking)

bunx navnedag <command> [options]

Local Development

bun run navnedag <command> [options]

or if you are a bit lazy

bun navnedag <command> [options]

Commands

today [t]

Get today's nameday(s).

bunx navnedag today
bunx navnedag t

Output: Displays the names celebrated today.

search [s]

Search for namedays by month and/or day.

bunx navnedag search [options]
bunx navnedag s [options]

Options:

  • --name, -n <string> - Search for a name.
  • --month, -m <number> - Filter by month (1-12)
  • --day, -d <number> - Filter by day (1-31)

Examples:

# Search for the nameday of a name
bunx navnedag search --name adrian

# Search for namedays in March
bunx navnedag search --month 3

# Search for namedays on March 15th
bunx navnedag s --m 3 --d 15

# Search for today's namedays (default behavior)
bunx navnedag search

list [l]

List all namedays in the database.

bunx navnedag list
bunx navnedag l

Output: Displays all names with their corresponding dates in the format Name (day/month).

Development

Project Structure

navnedag-cli/
├── src/
│   ├── index.ts      # CLI entry point
│   ├── command.ts    # Command definitions
│   ├── db.ts         # Database operations
│   └── init.ts       # Initialization logic
├── navnedag.db       # SQLite database with nameday data
├── package.json      # Project configuration
└── README.md         # This file

Available Scripts

  • bun run build - Build the project for distribution
  • bun run dev - Run in development mode with watch
  • bun run publish - Build and publish the package

Database

The CLI uses a local SQLite database (navnedag.db) containing Norwegian nameday data. The database schema:

CREATE TABLE navnedager (
  name TEXT PRIMARY KEY,
  month INTEGER,
  day INTEGER
);

About

All you need for a nameday cli tool! Written with bun

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published