6 permalink: docs/cmd/version.html
7 redirect_from: docs/cmd/version/
10 The version command will tell you the version and build information
11 for the currently running watchman service:
17 "buildinfo": "git:2727d9a1e47a4a2229c65cbb2f0c7656cbd96270"
21 To get the version of the client:
28 If the server and client versions don't match up, you should probably
29 restart your server: `watchman shutdown-server ; watchman`.
35 The version command can be used to check for named capabilities.
36 Capabilities make it easier to check whether the server implements
37 functionality based on the name of that function rather than by
38 having the client build up knowledge about when those functions
41 You can read more about the [available capability names](
42 /watchman/docs/capabilities.html).
44 To check whether the `relative_root` capability is supported:
47 $ watchman -j <<< '["version", {"optional":["relative_root"]}]'
56 If the capability is not supported:
59 $ watchman -j <<< '["version", {"optional":["will-never-exist"]}]'
63 "will-never-exist": false
68 To have the server generate an error response if a capability is not
72 $ watchman -j <<< '["version", {"required":["will-never-exist"]}]'
76 "will-never-exist": false
78 "error": "client required capability `will-never-exist` is not supported by this server"
82 To require one feature and test whether some optional features are supported:
85 $ watchman -j <<< '["version", {"required":["term-match"],"optional":["a","b"]}]'
98 The **node** and **python** clients provide a `capabilityCheck` method that
99 will perform the version check above, and that also provide limited support
100 for testing capability support against older versions of the watchman server.
101 This facilitates a smoother transition from version number based checks
102 to capability named based checks.
108 client = pywatchman.client()
109 # will throw an error if any of the required names are not supported
110 res = client.capabilityCheck(optional=['a'], required=['term-match'])
112 # {'version': '3.8.0', 'capabilities': {'term-match': True, 'a': False}}
118 var watchman = require('fb-watchman');
119 var client = new watchman.Client();
120 client.capabilityCheck({optional:['a'], required:['term-match']},
121 function (error, resp) {
123 // error will be an Error object if any of the required named
127 // {'version': '3.8.0', 'capabilities': {'term-match': false, 'a': false}}