update cli sdk doc, tweak json output options
[arvados.git] / doc / user / sdk-cli.textile
1 ---
2 layout: default
3 navsection: userguide
4 title: Command line SDK
5 navorder: 10
6 ---
7
8 {% include alert-stub.html %}
9
10 h1. Command line SDK
11
12 If you are logged in to an Arvados VM, the command line SDK should be
13 installed. Try:
14
15   arv --help
16
17 h3. First...
18
19 Set the @ARVADOS_API_HOST@ environment variable.
20
21 <pre>
22 export ARVADOS_API_HOST=xyzzy.arvadosapi.com
23 </pre>
24
25 Log in to Workbench and get an API token for your account. Set the @ARVADOS_API_TOKEN@ environment variable.
26
27 <code>
28 export ARVADOS_API_TOKEN=c0vdbi8wp7f703lbthyadlvmaivgldxssy3l32isslmax93k9
29 </code>
30
31 h3. Usage
32
33 @arv [global_options] resource_type resource_method [method_parameters]@
34
35 h3. Basic examples
36
37 Get UUID of the current user
38 @arv user current@
39
40 Get entire record (json) for current user
41 @arv -h user current@
42
43 Get entire record for identified user
44 @arv -h user get --uuid 6dnxa-tpzed-iimd25zhzh84gbk@
45
46 Update user record
47 @arv user update --uuid 6dnxa-tpzed-iimd25zhzh84gbk --first_name "Bob"@
48
49 Get list of groups (showing just UUIDs)
50 @arv group list@
51
52 Get list of groups (showing entire records)
53 @arv -h group list@
54
55 h3. Global options
56
57 - @--json@, @-j@ := Output entire response as compact JSON.
58
59 - @--pretty@, @--human@, @-h@ := Output entire response as JSON with whitespace for better human-readability.
60
61 - @--uuid@ := Output only the UUIDs of object(s) in the API response, one per line.
62
63 h3. Resource types and methods
64
65 Get list of resource types
66 @arv --help@
67
68 Get list of resource methods for the "user" resource type
69 @arv user --help@