Skip to content

Commit b1f283c

Browse files
cyEverlastingBugstopperStephenBarlow
authored
docs: document rover readme commands (#1141)
Co-authored-by: Avery Harnish <[email protected]> Co-authored-by: Stephen Barlow <[email protected]>
1 parent cc9cd88 commit b1f283c

File tree

2 files changed

+65
-2
lines changed

2 files changed

+65
-2
lines changed

docs/source/config.json

+3-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"Contributing": "/contributing",
1919
"Migrating from the Apollo CLI": "/migration",
2020
"Base Commands": {
21-
"graph": "/graphs"
21+
"graph": "/graphs",
22+
"readme": "/readmes"
2223
},
2324
"Federation Commands": {
2425
"subgraph": "/subgraphs",
@@ -28,4 +29,4 @@
2829
"Error codes": "/errors"
2930
}
3031
}
31-
}
32+
}

docs/source/readmes.md

+62
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
---
2+
title: Rover README commands
3+
description: Publish and retrieve your graph variant's README
4+
---
5+
6+
These Rover commands enable you to publish and fetch the [README](/studio/org/graphs/#the-readme-page) associated with a particular graph variant.
7+
8+
READMEs are [Markdown-based](/studio/org/graphs/#supported-markdown) and support Apollo-specific shortcodes, which are documented [here](/studio/org/graphs/#readme-shortcodes).
9+
10+
## Fetching a README from Apollo Studio
11+
12+
> This requires first [authenticating Rover with Apollo Studio](./configuring/#authenticating-with-apollo-studio).
13+
14+
You can use Rover to fetch the README of any Studio graph variant you have access to.
15+
16+
Run the `readme fetch` command, like so:
17+
18+
```bash
19+
rover readme fetch my-graph@my-variant
20+
```
21+
22+
The argument `my-graph@my-variant` is the `graph ref`, which you can read about [here](./conventions#graph-refs).
23+
24+
### Output format
25+
26+
By default, the README is output to `stdout`. You can also save the output to a `.md` file like so:
27+
28+
```bash
29+
# Creates README.md or overwrites if it already exists
30+
rover readme fetch my-graph@my-variant > README.md
31+
```
32+
33+
You can also request the output as JSON with the `--output json` option:
34+
35+
```bash
36+
rover readme fetch my-graph@my-variant --output json
37+
```
38+
39+
> For more on passing values via `stdout`, see [Conventions](./conventions#using-stdout).
40+
41+
## Publishing a README to Apollo Studio
42+
43+
> This requires first [authenticating Rover with Apollo Studio](./configuring/#authenticating-with-apollo-studio).
44+
45+
You can use Rover to publish a README to one of your [Apollo Studio graphs](/studio/org/graphs/).
46+
47+
Use the `readme publish` command, like so:
48+
49+
```bash
50+
rover readme publish my-graph@my-variant --file ./README.md
51+
```
52+
53+
The argument `my-graph@my-variant` is the `graph ref`, which you can read about [here](./conventions#graph-refs).
54+
55+
You can also pipe in the README's contents via `stdin` by providing `-` as the value of the `--file` option, like so:
56+
57+
```bash
58+
echo "sample readme contents" | rover readme publish my-graph@my-variant --file -
59+
```
60+
61+
> For more on accepting input via `stdin`, see [Conventions](./conventions#using-stdin).
62+

0 commit comments

Comments
 (0)