Download released files from Releases page.
Or
cd somwwhere/to/parent/dir
git clone https://github.com/akm/datastorecli.git
cd datastorecli
go install ./cmd/datastorecli
Login for Application Default Credentials.
gcloud auth application-default login
$ datastorecli query calcsvc --project-id=your-project
{"A":100,"B":23,"R":123}
{"A":1,"B":5,"R":6}
{"A":100,"B":24,"R":124}
{"A":100,"B":24,"R":124}
{"A":1,"B":5,"R":6}
{"A":100,"B":26,"R":126}
{"A":1,"B":5,"R":6}
{"A":100,"B":26,"R":126}
$ datastorecli put calcsvc '{"A":200,"B":36,"R":128}' --project-id=your-project
/calcsvc,5646874153320448
$ datastorecli put calcsvc 5646874153320448 '{"A":300,"B":36,"R":128}' --project-id=your-project
/calcsvc,5646874153320448
$ datastorecli get calcsvc 5646874153320448 --project-id=your-project
{"A":300,"B":36,"R":128}
$ datastorecli delete calcsvc 5646874153320448 --project-id=ayour-project
$ echo $?
0
$ datastorecli key encode calcsvc --id 5646874153320448; echo
EhIKB2NhbGNzdmMQgICAwNX5gwo
$ datastorecli key decode EhIKB2NhbGNzdmMQgICAwNX5gwo; echo
/calcsvc,5646874153320448
$ datastorecli key encode accounts --name [email protected]; echo
Eh0KCGFjY291bnRzGhF1c2VyMUBleGFtcGxlLmNvbQ
$ datastorecli key decode Eh0KCGFjY291bnRzGhF1c2VyMUBleGFtcGxlLmNvbQ; echo
/accounts,[email protected]
$ datastorecli key encode accounts --name [email protected] --namespace shop1; echo
CgciBXNob3AxEh0KCGFjY291bnRzGhF1c2VyMUBleGFtcGxlLmNvbQ
$ datastorecli key decode CgciBXNob3AxEh0KCGFjY291bnRzGhF1c2VyMUBleGFtcGxlLmNvbQ; echo
/accounts,[email protected] (namespace:shop1)
$ datastorecli key encode account_logs --id 123456789 --encoded-parent Eh0KCGFjY291bnRzGhF1c2VyMUBleGFtcGxlLmNvbQ; echo
Eh0KCGFjY291bnRzGhF1c2VyMUBleGFtcGxlLmNvbRITCgxhY2NvdW50X2xvZ3MQlZrvOg
$ datastorecli key decode Eh0KCGFjY291bnRzGhF1c2VyMUBleGFtcGxlLmNvbRITCgxhY2NvdW50X2xvZ3MQlZrvOg; echo
/accounts,[email protected]/account_logs,123456789