<a id="hook-command-state-get"></a>

# `state-get`

> See also: [state-delete](https://documentation.ubuntu.com/juju/4.0/reference/hook-command/list-of-hook-commands/state-delete.md#hook-command-state-delete), [state-set](https://documentation.ubuntu.com/juju/4.0/reference/hook-command/list-of-hook-commands/state-set.md#hook-command-state-set)

## Summary

Prints server-side-state value.

## Usage

```text
state-get [options] [<key>]
```

### Options

| Flag             | Default   | Usage                                                 |
|------------------|-----------|-------------------------------------------------------|
| `--format`       | smart     | Specify output format (json|smart|yaml)               |
| `-o`, `--output` |           | Specify an output file                                |
| `--strict`       | false     | Returns an error if the requested key does not exist. |

## Details

`state-get` prints the value of the server side state specified by key.
If no key is given, or if the key is `"-"`, all keys and values will be printed.
