百科.dev
全部条目在线工具AI 编程趋势榜开源项目技术资讯提交条目
登录
< 返回工具列表
D

define

> 开发工具
开源

一个命令行词典(词汇库)应用程序,可访问多个来源,使用 Go 编写。

387 stars0 点赞1 次浏览
访问官网GitHub

工具介绍

一个命令行词典(词汇库)应用程序,可访问多个来源,使用 Go 编写。

define

A command-line dictionary (thesaurus) app, with access to multiple sources, written in Go.

Install

Pre-compiled binaries are available on the releases page.

If you have a working Go environment, you can install via go install:

bash
go install github.com/Rican7/define@latest

Configuration

The define app allows configuration through multiple means. You can either set configuration via:

  1. Command line flags (good for one-off use)
  2. Environment variables (good for API keys)
  3. A configuration file (good for your "dotfiles")

When multiple means of configuration are used, the values will take precedence in the aforementioned priority.

Command line flags

The list of command line flags is easily discovered via the --help flag. Any passed command line flag will take precedence over any other configuration mechanism.

Environment variables

Some configuration values can also be specified via environment variables. This is especially useful for API keys of different sources.

The following environment variables are read by define's sources:

  • MERRIAM_WEBSTER_DICTIONARY_APP_KEY
  • OXFORD_DICTIONARY_APP_ID
  • OXFORD_DICTIONARY_APP_KEY

Configuration file

A configuration file can be stored that define will automatically load the values from.

The path of the configuration file to load can be specified via the --config-file flag. If no config file path is specified, define will search for a config file in your OS's standard config directory paths. While these paths are OS-specific, there are two locations that are searched for that are shared among all platforms:

  1. $XDG_CONFIG_HOME/define/config.json (This is only searched for when the $XDG_CONFIG_HOME env variable is set)
  2. ~/.define.conf.json (Where ~ is equal to your $HOME or user directory for your OS)

To see which config file has been loaded, and to check what paths are searched for config files, use the --debug-config flag.

To print the default values of the configuration, simply use the --print-config flag. This can also be used to initialize a configuration file, for example:

bash
define --print-config > ~/.define.conf.json

Sources

The define app has access to multiple sources, however some of them require user-specific API keys, due to usage limitations.

A preferred source can be specified with the command line flag --preferred-source="..." or in a configuration file. For more information, see the section on Configuration.

Obtaining API keys

The following are links to register for API keys for the different sources:

  • Merriam-Webster's Dictionary API
  • Oxford Dictionaries API

Issues· 0 开放

查看全部 Issues在 GitHub 打开

暂无开放 Issues,或尚未同步最近议题。

> 标签

Goappclicommand-linecommand-line-tool

暂无评论,来聊聊你的看法吧

> 工具信息

发布日期2026年8月1日
最后更新2026年9月17日
分类开发工具
定价开源

> 相关工具

V
VS Code
流行的开源代码编辑器
G
Git
分布式版本控制系统
V
Vite
下一代前端构建工具