---
title: Account
description: Create, upgrade, finalize, close, and inspect on-chain ABI accounts
  with thru abi account
source_url:
  html: https://thru.org/docs/cli-reference/abi-account/
  md: https://thru.org/docs/cli-reference/abi-account.md
---

# Account

Use `thru abi account` when you are publishing ABI YAML to chain state or reading an existing ABI account back out.

## Use This When

- you are attaching an ABI to a managed program you control
- you are publishing a third-party or standalone ABI account
- you need to inspect an ABI account address and optionally export its YAML contents

Choose another ABI command when:

- you want to generate client code locally: [Codegen](https://thru.org/docs/cli-reference/abi-codegen.md)
- you want to validate or inspect ABI types without touching chain state: [Analyze](https://thru.org/docs/cli-reference/abi-analyze.md)
- you want to decode a captured binary payload: [Reflect](https://thru.org/docs/cli-reference/abi-reflect.md)

## Account Types

Program

Use for the official ABI attached to a managed program you control.

Third-Party

Use when you are publishing an ABI for someone else’s deployed program.

Standalone

Use for shared type packages or ABI files not tied to one program account.

| Type | Use it for | Seed input | Signer flag | Extra requirement |
| - | - | - | - | - |
| `program` | ABI for a managed program you control. | The managed program seed. | `--authority` | None |
| `third-party` | ABI for a program you do not control. | A 32-byte hex seed. | `--publisher` | `--target-program` is required |
| `standalone` | ABI not tied to a specific program. | A standalone seed string. | `--publisher` | None |

`--authority` is still accepted as a compatibility alias for non-`program` account types, but `--publisher` is the clearer choice for third-party and standalone flows.

## Shared Flags

| Flag | Use it for |
| - | - |
| \`—account-type program | third-party |
| `—target-program <ADDRESS>` | Required for `third-party` accounts. |
| `--ephemeral` | Match ephemeral program mode when the ABI targets an ephemeral program. |
| `—authority <KEY_NAME>` | Choose the configured authority key for `program` ABIs. |
| `—publisher <KEY_NAME>` | Choose the configured publisher key for `third-party` and `standalone` ABIs. |
| `—fee-payer <KEY_NAME>` | Override the configured fee payer for state-changing commands. |
| `--include-data` | Include ABI YAML contents when using `get`. |
| `—out <PATH>` | Write ABI YAML contents from `get` to a file. |

## Command Shapes

| Command | Syntax |
| - | - |
| `create` | `thru abi account create [FLAGS] <SEED> <ABI_FILE>` |
| `upgrade` | `thru abi account upgrade [FLAGS] <SEED> <ABI_FILE>` |
| `finalize` | `thru abi account finalize [FLAGS] <SEED>` |
| `close` | `thru abi account close [FLAGS] <SEED>` |
| `get` | `thru abi account get <ABI_ACCOUNT> [—include-data] [—out <PATH>]` |

## Minimal Patterns

**Managed program ABI:**

```bash
thru abi account create my_program ./program.abi.yaml
```

**Third-party ABI:**

```bash
thru abi account create \
  --account-type third-party \
  --target-program ta...$program_id \
  --publisher default \
  0123456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef \
  ./community.abi.yaml
```

**Standalone ABI:**

```bash
thru abi account create \
  --account-type standalone \
  --publisher default \
  shared_types \
  ./types.abi.yaml
```

**Inspect and export an ABI:**

```bash
thru abi account get --include-data --out ./downloaded.abi.yaml ta...$abi_account
```

## Common Workflows

### Publish a managed program ABI

```bash
thru program create my_program ./build/program.bin
thru abi account create my_program ./program.abi.yaml
thru abi account get --include-data ta...$abi_account
```

### Upgrade before finalization

```bash
thru abi account upgrade my_program ./program_v2.abi.yaml
thru abi account get --include-data ta...$abi_account
```

### Finalize once stable

```bash
thru abi account finalize my_program
```

## Common Failures

- `third-party` accounts require `--target-program`. Without it, the command cannot derive the ABI account.
- `upgrade` and `close` fail once an ABI account has been finalized.
- The `seed` meaning changes with `--account-type`, so do not reuse a human-readable standalone seed where a third-party 32-byte hex seed is expected.
- `get` takes an ABI account address, not the original program seed.

> **Tip:**
>
> Use `thru --json abi account get ...` when another tool or agent needs the result in a machine-readable form.
