<p>Is there some command for this? It irks me that Openshift takes pride in having &quot;-o yaml&quot; and &quot;-o json&quot; commands to avoid having to use cut/grep/awk, but for listing the current project this seems to be the only way to do it:</p>
<pre><code>[root@bart-master ~]# oc project
Using project &quot;default&quot; on server &quot;https://api.bart.mycluster.com:6443&quot;.
[root@bart-master ~]# oc project | cut -d '&quot;' -f2
default
</code></pre>

<p>You can get the current project(namespace) using each <code>oc</code> and <code>kubectl</code> CLIs as follows</p>
<pre><code>$ oc config view --minify -o 'jsonpath={..namespace}'
$ kubectl config view --minify -o 'jsonpath={..namespace}'
</code></pre>
