Files
opentf/website/docs/cli/commands/state/pull.mdx
Kuba Martin 4d665a0091 Update website/docs/cli. (#171)
* Initial renaming, rewriting and cleaning up wave for the CLI docs.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* More renaming.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* More renaming.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* More renaming.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Remove tutorial references.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

* Post-review fixes.

Signed-off-by: Jakub Martin <kubam@spacelift.io>

---------

Signed-off-by: Jakub Martin <kubam@spacelift.io>
2023-08-25 11:09:18 +02:00

31 lines
1.2 KiB
Plaintext

---
page_title: 'Command: state pull'
description: >-
The `opentf state pull` command is used to manually download and output the
state from remote state.
---
# Command: state pull
The `opentf state pull` command is used to manually download and output
the state from [remote state](/opentf/language/state/remote). This command also
works with local state.
## Usage
Usage: `opentf state pull`
This command downloads the state from its current location, upgrades the
local copy to the latest state file version that is compatible with
locally-installed OpenTF, and outputs the raw format to stdout.
This is useful for reading values out of state (potentially pairing this
command with something like [jq](https://stedolan.github.io/jq/)). It is
also useful if you need to make manual modifications to state.
You cannot use this command to inspect the OpenTF version of
the remote state, as it will always be converted to the current OpenTF
version before output.
-> **Note:** OpenTF state files must be in UTF-8 format without a byte order mark (BOM). For PowerShell on Windows, use `Set-Content` to automatically encode files in UTF-8 format. For example, run `opentf state pull | sc opentf.tfstate`.