|
| 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