Skip to content

Anomalous55/define-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

define — CLI Dictionary Tool

Look up word definitions right from your terminal.

Usage

define <word>

Example:

define prudent

Output:

Prudent <adjective>

1. Careful or wise in handling practical matters; exercising good judgment or common sense.
   "a prudent manager of money."
2. Characterized by or resulting from care or wisdom in practical matters.
   "a prudent investment."

  Pronunciation: /ˈpruːd(ə)nt/

Installation

Requirements

  • Node.js v18 or higher

Steps

1. Clone the repository and install dependencies:

git clone https://github.com/Anomalous55/define-cli.git
cd define-cli
npm install

2. If npm link fails with a permissions error, configure npm to use a local directory:

bash — add to ~/.bashrc:

mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH="$HOME/.npm-global/bin:$PATH"

Then source ~/.bashrc.

zsh — add to ~/.zshrc:

mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
export PATH="$HOME/.npm-global/bin:$PATH"

Then source ~/.zshrc.

fish:

mkdir -p ~/.npm-global
npm config set prefix '~/.npm-global'
set -Ux fish_user_paths $HOME/.npm-global/bin $fish_user_paths

3. Link globally:

npm link

Now run define from anywhere:

define serendipity
define ephemeral
define prudent

Uninstall

npm unlink -g define-cli

How It Works

Fetches definitions from the free DictionaryAPI — no API key needed. Results are grouped by part of speech, showing up to 4 definitions each with example sentences where available.

About

Look up word definitions right from your terminal!

Topics

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors