Skip to content

Commit 7709f7d

Browse files
committed
DOC: Add CLI tab to getting started guide
1 parent b5aae2e commit 7709f7d

File tree

1 file changed

+27
-23
lines changed

1 file changed

+27
-23
lines changed

docs/index.md

Lines changed: 27 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ Before you begin, ensure you:
1717
- Are familiar with Python
1818
- Have the following tools installed:
1919
- Python >= 3.10
20-
- The `octue` python library (see [installation instructions](installation.md))
20+
- The `octue` python library / CLI (see [installation instructions](installation.md))
2121

2222
<!-- prettier-ignore-end -->
2323

@@ -37,9 +37,11 @@ No authentication is needed to run the example data service. To authenticate for
3737

3838
The following shell command asks a question to the local example data service:
3939

40-
```shell
41-
octue twined question ask example --input-values='{"some": "data"}'
42-
```
40+
=== "CLI"
41+
42+
```shell
43+
octue twined question ask example --input-values='{"some": "data"}'
44+
```
4345

4446
!!! tip
4547

@@ -51,30 +53,32 @@ octue twined question ask example --input-values='{"some": "data"}'
5153

5254
### Receive an answer
5355

54-
The output from asking a question usually contains log messages followed by the answer as [JSON](https://en.wikipedia.org/wiki/JSON):
56+
=== "CLI"
5557

56-
```text
57-
[2025-09-23 18:20:13,513 | WARNING | octue.resources.dataset] <Dataset('cleaned_met_mast_data')> is empty at instantiation time (path 'cleaned_met_mast_data').
58-
[2025-09-23 18:20:13,649 | INFO | app] [fb85f10d-4428-4239-9543-f7650104b43c] Starting clean up of files in <Manifest(8ead7669-8162-4f64-8cd5-4abe92509e17)>
59-
[2025-09-23 18:20:13,649 | INFO | app] [fb85f10d-4428-4239-9543-f7650104b43c] Averaging window set to 600s
60-
[2025-09-23 18:20:13,673 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] The analysis didn't produce output values.
61-
[2025-09-23 18:20:13,673 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] The analysis produced an output manifest.
62-
[2025-09-23 18:20:13,673 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] No output location was set in the service configuration - can't upload output datasets.
63-
[2025-09-23 18:20:13,726 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] Validated outputs against the twine.
64-
{"kind": "result", "output_values": {"some": "output", "heights": [1, 2, 3, 4, 5]}, "output_manifest": {"id": "2e1fb3e4-2f86-4eb2-9c2f-5785d36c6df9", "name": null, "datasets": {"cleaned_met_mast_data": "/var/folders/9p/25hhsy8j4wv66ck3yylyz97c0000gn/T/tmps_qcb4yw"}}}
65-
```
58+
The output from asking a question usually contains log messages followed by the answer as [JSON](https://en.wikipedia.org/wiki/JSON):
6659

67-
!!! tip
60+
```text
61+
[2025-09-23 18:20:13,513 | WARNING | octue.resources.dataset] <Dataset('cleaned_met_mast_data')> is empty at instantiation time (path 'cleaned_met_mast_data').
62+
[2025-09-23 18:20:13,649 | INFO | app] [fb85f10d-4428-4239-9543-f7650104b43c] Starting clean up of files in <Manifest(8ead7669-8162-4f64-8cd5-4abe92509e17)>
63+
[2025-09-23 18:20:13,649 | INFO | app] [fb85f10d-4428-4239-9543-f7650104b43c] Averaging window set to 600s
64+
[2025-09-23 18:20:13,673 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] The analysis didn't produce output values.
65+
[2025-09-23 18:20:13,673 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] The analysis produced an output manifest.
66+
[2025-09-23 18:20:13,673 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] No output location was set in the service configuration - can't upload output datasets.
67+
[2025-09-23 18:20:13,726 | INFO | octue.twined.resources.analysis] [fb85f10d-4428-4239-9543-f7650104b43c] Validated outputs against the twine.
68+
{"kind": "result", "output_values": {"some": "output", "heights": [1, 2, 3, 4, 5]}, "output_manifest": {"id": "2e1fb3e4-2f86-4eb2-9c2f-5785d36c6df9", "name": null, "datasets": {"cleaned_met_mast_data": "/var/folders/9p/25hhsy8j4wv66ck3yylyz97c0000gn/T/tmps_qcb4yw"}}}
69+
```
6870

69-
You can pipe the output JSON into other CLI tools or redirect it to a file:
71+
!!! tip
7072

71-
```shell
72-
# Fromat the result using the `jq` command line tool
73-
octue twined question ask example --input-values='{"some": "data"}' | jq
73+
You can pipe the output JSON into other CLI tools or redirect it to a file:
7474

75-
# Store the result in a file
76-
octue twined question ask example --input-values='{"some": "data"}' > result.json
77-
```
75+
```shell
76+
# Fromat the result using the `jq` command line tool
77+
octue twined question ask example --input-values='{"some": "data"}' | jq
78+
79+
# Store the result in a file
80+
octue twined question ask example --input-values='{"some": "data"}' > result.json
81+
```
7882

7983
## Next steps
8084

0 commit comments

Comments
 (0)