# macOS安装redis-cli {#macos安装redis-cli}
本文介绍如何在macOS上安装且仅安装redis的客户端工具redis-cli。
# 1. 安装软件包仓库 {#_1-安装软件包仓库}
执行如下命令安装redis-cli的软件包仓库:
brew tap ringohub/redis-cli
wangshibiao@bogon redis %
brew tap ringohub/redis-cli
==> Tapping ringohub/redis-cli
Cloning into '/usr/local/Homebrew/Library/Taps/ringohub/homebrew-redis-cli'...
remote: Enumerating objects: 46, done.
remote: Counting objects: 100% (5/5), done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 46 (delta 1), reused 4 (delta 0), pack-reused 41
Receiving objects: 100% (46/46), 6.31 KiB | 923.00 KiB/s, done.
Resolving deltas: 100% (14/14), done.
Tapped 1 formula (31 files, 37.6KB).
wangshibiao@bogon redis %
# 2. 更新本地仓库配置 {#_2-更新本地仓库配置}
执行命令brew update && brew doctor
wangshibiao@bogon redis % brew update && brew doctor
Already up-to-date.
Please note that these warnings are just used to help the Homebrew maintainers
with debugging if you file an issue. If everything you use Homebrew for is
working fine: please don't worry or file an issue; just ignore this. Thanks!
Warning: Unbrewed dylibs were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected dylibs:
/usr/local/lib/libprotobuf-lite.21.dylib
/usr/local/lib/libprotobuf.21.dylib
/usr/local/lib/libprotoc.21.dylib
Warning: Unbrewed header files were found in /usr/local/include.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected header files:
/usr/local/include/google/protobuf/any.h
/usr/local/include/google/protobuf/any.pb.h
/usr/local/include/google/protobuf/api.pb.h
/usr/local/include/google/protobuf/arena.h
/usr/local/include/google/protobuf/arena_impl.h
/usr/local/include/google/protobuf/arenastring.h
/usr/local/include/google/protobuf/compiler/code_generator.h
/usr/local/include/google/protobuf/compiler/command_line_interface.h
/usr/local/include/google/protobuf/compiler/cpp/cpp_generator.h
/usr/local/include/google/protobuf/compiler/csharp/csharp_generator.h
/usr/local/include/google/protobuf/compiler/csharp/csharp_names.h
/usr/local/include/google/protobuf/compiler/importer.h
/usr/local/include/google/protobuf/compiler/java/java_generator.h
/usr/local/include/google/protobuf/compiler/java/java_names.h
/usr/local/include/google/protobuf/compiler/js/js_generator.h
/usr/local/include/google/protobuf/compiler/js/well_known_types_embed.h
/usr/local/include/google/protobuf/compiler/objectivec/objectivec_generator.h
/usr/local/include/google/protobuf/compiler/objectivec/objectivec_helpers.h
/usr/local/include/google/protobuf/compiler/parser.h
/usr/local/include/google/protobuf/compiler/php/php_generator.h
/usr/local/include/google/protobuf/compiler/plugin.h
/usr/local/include/google/protobuf/compiler/plugin.pb.h
/usr/local/include/google/protobuf/compiler/python/python_generator.h
/usr/local/include/google/protobuf/compiler/ruby/ruby_generator.h
/usr/local/include/google/protobuf/descriptor.h
/usr/local/include/google/protobuf/descriptor.pb.h
/usr/local/include/google/protobuf/descriptor_database.h
/usr/local/include/google/protobuf/duration.pb.h
/usr/local/include/google/protobuf/dynamic_message.h
/usr/local/include/google/protobuf/empty.pb.h
/usr/local/include/google/protobuf/extension_set.h
/usr/local/include/google/protobuf/extension_set_inl.h
/usr/local/include/google/protobuf/field_mask.pb.h
/usr/local/include/google/protobuf/generated_enum_reflection.h
/usr/local/include/google/protobuf/generated_enum_util.h
/usr/local/include/google/protobuf/generated_message_reflection.h
/usr/local/include/google/protobuf/generated_message_table_driven.h
/usr/local/include/google/protobuf/generated_message_util.h
/usr/local/include/google/protobuf/has_bits.h
/usr/local/include/google/protobuf/implicit_weak_message.h
/usr/local/include/google/protobuf/inlined_string_field.h
/usr/local/include/google/protobuf/io/coded_stream.h
/usr/local/include/google/protobuf/io/gzip_stream.h
/usr/local/include/google/protobuf/io/io_win32.h
/usr/local/include/google/protobuf/io/printer.h
/usr/local/include/google/protobuf/io/strtod.h
/usr/local/include/google/protobuf/io/tokenizer.h
/usr/local/include/google/protobuf/io/zero_copy_stream.h
/usr/local/include/google/protobuf/io/zero_copy_stream_impl.h
/usr/local/include/google/protobuf/io/zero_copy_stream_impl_lite.h
/usr/local/include/google/protobuf/map.h
/usr/local/include/google/protobuf/map_entry.h
/usr/local/include/google/protobuf/map_entry_lite.h
/usr/local/include/google/protobuf/map_field.h
/usr/local/include/google/protobuf/map_field_inl.h
/usr/local/include/google/protobuf/map_field_lite.h
/usr/local/include/google/protobuf/map_type_handler.h
/usr/local/include/google/protobuf/message.h
/usr/local/include/google/protobuf/message_lite.h
/usr/local/include/google/protobuf/metadata.h
/usr/local/include/google/protobuf/metadata_lite.h
/usr/local/include/google/protobuf/parse_context.h
/usr/local/include/google/protobuf/port.h
/usr/local/include/google/protobuf/reflection.h
/usr/local/include/google/protobuf/reflection_ops.h
/usr/local/include/google/protobuf/repeated_field.h
/usr/local/include/google/protobuf/service.h
/usr/local/include/google/protobuf/source_context.pb.h
/usr/local/include/google/protobuf/struct.pb.h
/usr/local/include/google/protobuf/stubs/bytestream.h
/usr/local/include/google/protobuf/stubs/callback.h
/usr/local/include/google/protobuf/stubs/casts.h
/usr/local/include/google/protobuf/stubs/common.h
/usr/local/include/google/protobuf/stubs/fastmem.h
/usr/local/include/google/protobuf/stubs/hash.h
/usr/local/include/google/protobuf/stubs/logging.h
/usr/local/include/google/protobuf/stubs/macros.h
/usr/local/include/google/protobuf/stubs/map_util.h
/usr/local/include/google/protobuf/stubs/mutex.h
/usr/local/include/google/protobuf/stubs/once.h
/usr/local/include/google/protobuf/stubs/platform_macros.h
/usr/local/include/google/protobuf/stubs/port.h
/usr/local/include/google/protobuf/stubs/status.h
/usr/local/include/google/protobuf/stubs/stl_util.h
/usr/local/include/google/protobuf/stubs/stringpiece.h
/usr/local/include/google/protobuf/stubs/strutil.h
/usr/local/include/google/protobuf/stubs/template_util.h
/usr/local/include/google/protobuf/text_format.h
/usr/local/include/google/protobuf/timestamp.pb.h
/usr/local/include/google/protobuf/type.pb.h
/usr/local/include/google/protobuf/unknown_field_set.h
/usr/local/include/google/protobuf/util/delimited_message_util.h
/usr/local/include/google/protobuf/util/field_comparator.h
/usr/local/include/google/protobuf/util/field_mask_util.h
/usr/local/include/google/protobuf/util/json_util.h
/usr/local/include/google/protobuf/util/message_differencer.h
/usr/local/include/google/protobuf/util/time_util.h
/usr/local/include/google/protobuf/util/type_resolver.h
/usr/local/include/google/protobuf/util/type_resolver_util.h
/usr/local/include/google/protobuf/wire_format.h
/usr/local/include/google/protobuf/wire_format_lite.h
/usr/local/include/google/protobuf/wrappers.pb.h
Warning: Unbrewed '.la' files were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected '.la' files:
/usr/local/lib/libprotobuf-lite.la
/usr/local/lib/libprotobuf.la
/usr/local/lib/libprotoc.la
Warning: Unbrewed '.pc' files were found in /usr/local/lib/pkgconfig.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected '.pc' files:
/usr/local/lib/pkgconfig/protobuf-lite.pc
/usr/local/lib/pkgconfig/protobuf.pc
Warning: Unbrewed static libraries were found in /usr/local/lib.
If you didn't put them there on purpose they could cause problems when
building Homebrew formulae, and may need to be deleted.
Unexpected static libraries:
/usr/local/lib/libprotobuf-lite.a
/usr/local/lib/libprotobuf.a
/usr/local/lib/libprotoc.a
Warning: You have unlinked kegs in your Cellar.
Leaving kegs unlinked can lead to build-trouble and cause formulae that depend on
those kegs to fail to run properly once built. Run `brew link` on these:
protobuf
wangshibiao@bogon redis %
# 3. 安装redis-cli {#_3-安装redis-cli}
执行命令brew install redis-cli
安装redis-cli客户端工具
wangshibiao@bogon redis % brew install redis-cli
==> Installing redis-cli from ringohub/redis-cli
==> Downloading https://github.com/antirez/redis/archive/6.0.1.tar.gz
# # # # -=O=- % -=O=- # # # #
==> make redis-cli
🍺 /usr/local/Cellar/redis-cli/6.0.1: 5 files, 264.7KB, built in 12 seconds
wangshibiao@bogon redis % redis-cli --version
redis-cli 6.0.1
wangshibiao@bogon redis % which redis-cli
/usr/local/bin/redis-cli
wangshibiao@bogon redis %