You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ o -o name#shape#shape-conf.ocpus#state list comp inst -c kevco.
24
+
25
+
display-name shape ocpus lifecycle-state
26
+
atos VM.Standard.E4.Flex 1.0 STOPPED
27
+
cron VM.Standard.A1.Flex 1.0 RUNNING
28
+
zara VM.Standard2.4 4.0 RUNNING
29
+
humans VM.Standard2.1 1.0 STOPPED
30
+
robotics VM.Standard.E2.1 1.0 RUNNING
38
31
```
39
-
with **``o``** you get this
40
-
```
41
-
$ o -o display#life#cidr-block#compartment list subn -c sales -v west go
42
-
43
-
display-name lifecycle cidr-block compartment-id
44
-
Public Subnet VLKn:US-ASHBURN-AD-3 AVAILABLE 10.0.2.0/24 sales
45
-
Public Subnet VLKn:US-ASHBURN-AD-2 AVAILABLE 10.0.1.0/24 sales
46
-
Public Subnet VLKn:US-ASHBURN-AD-1 AVAILABLE 10.0.0.0/24 sales
47
-
```
48
-
**``o``** default output is a table of commonly useful fields, but **``o``** makes it easy to pick just what you want (as seen in the above example).
32
+
**``o``** picks just what you want from the output.
49
33
34
+
<aname="install"></a>
50
35
## Installation
51
36
52
-
**Pre-reqs:****``o``** works in Linux, Mac, WSL and CloudShell. `oci` must installed and configured. `o` does not replace `oci`, but it *uses*`oci`. See [Requirements](#requirements) below for more details.
37
+
**Important:**`oci` must *installed* and *configured*. `o` does not replace `oci`, but helps you *use*`oci`.
53
38
54
-
**``o``** is a single file. To install, get **``o``** from github, place it in your PATH (probably in the same place as ``oci``), and make it executable. Use these commands to download ``o`` and install it next to ``oci``.
55
-
<aname="install"></a>
39
+
To install, get **``o``** from github, place it in your PATH (perhaps in the same place as ``oci``), and make it executable. Use these commands to download ``o`` and install it next to ``oci``.
When you first run `o` it will tell you run `o oci_commands` to create the commands file *$HOME/.oci/oci_commands*. This collects a list of all possible `oci` commands with usage details.
51
+
When you first run `o` it will tell you run `o oci_commands` to create the commands file *$HOME/.oci/oci_commands*. This collects a list of all possible `oci` commands with usage details. This should take about two minutes. If it doesn't work (in Windows) or runs slowly (python 3.6), copy `oci_commands` from another source to *$HOME/.oci/oci_commands*.
63
52
64
-
Then `o` asks you to run `o <tenancy_ocid>` to initialize your *$HOME/.oci/ocids*. This seeds your *ocids* file with OCIDs of the compartments in your tenancy.
53
+
Then `o` asks you to run `o <tenancy_ocid>` to initialize your *$HOME/.oci/ocids*. This seeds your *ocids* file with OCIDs of the compartments in your tenancy. If this doesn't work it probably means that your `oci` is not configured properly.
65
54
66
55
#### Updates and maintenance
67
56
@@ -71,7 +60,9 @@ To install an `o` update, just re-run the two-line [installation command](#insta
71
60
72
61
Update `oci` every few months (or more frequently to keep up with the latest service additions). See [Upgrading the CLI](https://docs.oracle.com/en-us/iaas/Content/API/SDKDocs/cliupgrading.htm).
73
62
74
-
Run `o oci_commands` every couple of months to update *$HOME/.oci/oci_commands* with commands for the latest services added to OCI.
63
+
After you update `oci`, also update *$HOME/.oci/oci_commands* with the latest commands and services:
64
+
-`rm $HOME/.oci/oci_commands`
65
+
-`o oci_commands`
75
66
76
67
Keep using your existing *$HOME/.oci/ocids* file. If, however, it becomes unusable (with old data) or you want a fresh start, simply remove it and create a new one:
77
68
-`rm $HOME/.oci/ocids`
@@ -142,8 +133,7 @@ This will get a fresh list of all compartments in the tenancy, which is a great
142
133
- Example: For table output with right-most 8 characters of `id`, 10 (or more) characters of `display-name`, and first 10 characters (no more than 10) of `time-created`
143
134
-`o -o id:-.8#name:10#create:.10 comp inst list`
144
135
145
-
<aname="newinversion"></a>
146
-
#### New in version 1.5 (2023-02-28)
136
+
#### New in version 1.5 (2023-02-27)
147
137
- If you like the default output but want to add another field use `-o +field`:
148
138
- Example: `o -o +subnet list-vnics -c sales`
149
139
- If you like the default output fields, but want to change the format style, just add the separator:
@@ -152,6 +142,25 @@ This will get a fresh list of all compartments in the tenancy, which is a great
152
142
- change to "text" and add fields: `-o +/subnet list-vnics ...`
153
143
- Show additional output fields (not in "data") to stderr, such as "etag" or os "prefixes". Use `o -q` to hide this non-data.
154
144
145
+
<aname="newinversion"></a>
146
+
#### New in version 1.6 (2023-04-03)
147
+
-**o** runs on *Windows* PowerShell and Command shell. Not fully tested, but the basics appear to work.
PATHEXT should contain `.PY` to allow execution of `o.py`
153
+
- oci_commands generation doesn’t work, so pull the file from another system and copy it to your `.oci\oci_commands`
154
+
- Output from the last command is saved to `.oci/.otmp` if `.oci/.otmp` exists
155
+
- re-format the output by running `o -o <format>` with no oci command or parameters
156
+
-`o -o/` is useful for seeing what fields are available in the data
157
+
-`o -oj` shows JSON output
158
+
-`o -o name#id:.10#...` - customize the format without needing to rerun the `oci` command
159
+
- to activate this feature, simply touch `$HOME/.oci/.otmp`
160
+
- Added “reg" column to identify region key in default table output
161
+
- This is not shown nor available in csv or text formats.
162
+
- Region isn't in the resource data for most data types. **o** is extracting it from the ocid
163
+
155
164
## How **``o``** works
156
165
-**``o``** compares your input with thousands of ``oci`` commands, and uses an fuzzy matching to find the command you want.
157
166
@@ -161,25 +170,24 @@ This will get a fresh list of all compartments in the tenancy, which is a great
161
170
162
171
- Options for **`o`** such as `-o field#list` must appear *before* the `<command>` specification. `oci` options must appear *after*`<command>`. While this ordering is not strictly required by `oci`, `o` uses this to determine which options are for `o` and which are for `oci`.
163
172
164
-
- Add `go` or `.` to the end of the command and **``o``** will execute the ``oci`` command.
173
+
- Add `go` or `.` to the end of the command and **``o``** will execute the ``oci`` command. Add `!` to force run (sometimes needed when `o` doesn't know the command is complete).
165
174
166
175
-``oci`` returns JSON data when you create, get, list, or update resources. **``o``** captures resource names and Oracle Cloud IDs (OCIDs) and saves these to your *$HOME/.oci/ocids* file. **``o``** later uses this information to find resources by name, and to translate names to IDs.
167
176
168
-
-**``o``** scans the JSON results from ``oci`` for key names that match or partially match any of your <nobr>``-o key/word/list``</nobr>. The key words determine *what* presented, while the **``/``** separator character determines *how* they are presented.
177
+
-**``o``** scans the JSON data from ``oci`` for key names that match or partially match any of your <nobr>``-o key/word/list``</nobr>. The key words determine *what* presented, while the **``/``** separator character determines *how* they are presented.
169
178
170
179
## <aname="requirements"></a> Requirements
171
180
172
181
You will need:
173
182
174
-
- MacOS, Linux or WSL.
175
-
- Python 3.6+. If ``oci`` is installed, you have Python. (`oci` works better with python 3.7+)
176
183
-``oci`` - The Oracle Cloud Infrastructure command line interface must be *installed and configured*.
177
-
- Try running ``oci os ns get`` to verify that it's working.
184
+
- Try running ``oci os ns get`` to verify that it's authenticating okay.
178
185
- See https://docs.cloud.oracle.com/en-us/iaas/Content/API/SDKDocs/cliinstall.htm
179
186
- You need sufficient permissions in your tenancy
180
187
-**Authorization failed or requested resource not found** often means you connected to the cloud okay, but policies don't allow you to do what you tried to do.
181
188
- Minimally you need permission to **inspect** resources in order for most commands to work.
182
189
-``oci`` must be in your PATH so that ``o`` can find it
190
+
- Python 3.6+. If ``oci`` is installed, you have Python. (`oci` and `o` work better with python 3.7+)
183
191
184
192
**OCIDs File**
185
193
@@ -214,7 +222,7 @@ If you use ``oci`` for multiple tenancies, by default ``o`` will save OCIDs for
214
222
215
223
**``o``** works on MacOS and Linux (including Windows WSL) and Oracle CloudShell.
216
224
217
-
**``o``**should be relatively easy to port to Windows, but isn't there yet. Volunteer?
225
+
**``o``**version 1.6 introduces partial support for Windows PowerShell and Command shell. The `o` command works, but installation and setup are not automated.
0 commit comments