A macOS command line utility to access Tencent's MMKV key-value stores.
This tool can be used to inspect keys, get, set and delete keys in MMKV store files. It can also clear the entire store or dump all keys and their values.
$ brew tap topkan/homebrew-tap
$ brew install mmkv-cli
mmkv-cli supports the following commands
keys
- enumerate keys in the storeget
- get key valueset
- set key valuedelete
- delete key and its valuedump
- dump store contentsreset
- clear the entire contents of the store
All commands support the following arguments:
Path to the MMKV store file. The default is ./
.
MMKV instance id. If not specified, default
is used.
Enumerate all keys in the store.
$ mmkv-cli keys <arguments>
Get key value.
$ mmkv-cli get <key> --prettify-json <arguments>
Prettify JSON key value. Default is no prettification.
Set key value.
$ mmkv-cli set <key> <value> <arguments>
Delete key and its value.
$ mmkv-cli delete key <arguments>
Reset the store, remove all keys and values.
$ mmkv-cli reset <arguments>
Dump all keys and values in the store. By default, the output is limited to first 100 characters of the value.
$ mmkv-cli dump <key> --prettify-json --truncate 80 <arguments>
Prettify JSON key value. Default is no prettification.
Truncate values to specified width. Default is 100
. Specifying 0
will surpress any truncation.
$ cd `xcrun simctl get_app_container booted <app id> data`/Library/mmkv
$ mmkv-cli get app-state --prettify-json --id default
mmkv-cli is made available under the terms of the Apache 2.0 license. See the LICENSE file that accompanies this distribution for the full text of the license.
MMKV is separately licensed under Tencent License.