> ## Documentation Index
> Fetch the complete documentation index at: https://docs.0xkey.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Using the CLI

> Install the 0xkey CLI, generate an API key, create a wallet, and stamp Public API requests.

## Prerequisites

1. A 0xkey organization ([Quickstart](/getting-started/quickstart))
2. Access to the Dashboard to register an API public key on your user

## Install `0xkey`

### From source / releases

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
go install github.com/0xkey-io/cli/cmd/0xkey@latest
# or clone https://github.com/0xkey-io/cli and run `make install`
```

### Homebrew

The formula name is **`oxkey`** (Homebrew Ruby classes cannot start with a digit). The installed binary is still **`0xkey`**:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
brew install 0xkey-io/tap/oxkey
0xkey version
```

Source and verification notes: [0xkey-io/cli](https://github.com/0xkey-io/cli).

## Find your organization ID

All API requests require an organization ID. Copy it from the Dashboard user menu, then:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
export ZEROXKEY_ORGANIZATION_ID="<Your Org ID>"
```

<Note>
  Environment variables use the `ZEROXKEY_` prefix (never `0XKEY_` — POSIX forbids names that start with a digit).
</Note>

## Generate an API key

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
0xkey generate api-key --organization "$ZEROXKEY_ORGANIZATION_ID" --key-name quickstart
```

The CLI stores the private key under `~/.config/0xkey/keys/` (mode `0600`). Copy the `publicKey` from the JSON output.

Persist non-secret defaults (optional):

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
0xkey config set zeroxkey.organization "$ZEROXKEY_ORGANIZATION_ID"
0xkey config set zeroxkey.key_name quickstart
```

## Register the public key

In the Dashboard: **My Profile → New API key → Advanced Settings**, paste the CLI-generated public key, and approve with your authenticator.

## Whoami

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
0xkey whoami --key-name quickstart
```

## Create a wallet and Ethereum account

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
0xkey wallets create --name default --key-name quickstart
0xkey wallets accounts create --wallet default --address-format ADDRESS_FORMAT_ETHEREUM --key-name quickstart
0xkey wallets accounts list --wallet default --key-name quickstart
```

## Stamp a Public API request

Paths use 0xkey Public API style: `/public/v1/query/*` and `/public/v1/submit/*`.

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
0xkey request --path /public/v1/query/whoami --body "{
  \"organizationId\": \"$ZEROXKEY_ORGANIZATION_ID\"
}" --key-name quickstart
```

Preview the stamp and curl without posting:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
0xkey request --no-post --path /public/v1/submit/sign_transaction --body '{
  "timestampMs": "'"$(date +%s)"'000",
  "type": "ACTIVITY_TYPE_SIGN_TRANSACTION_V2",
  "organizationId": "'"$ZEROXKEY_ORGANIZATION_ID"'",
  "parameters": {
    "type": "TRANSACTION_TYPE_ETHEREUM",
    "signWith": "<Your Ethereum address>",
    "unsignedTransaction": "<Your Transaction>"
  }
}' --key-name quickstart
```

Or use the typed helper:

```bash theme={"theme":{"light":"github-light","dark":"github-dark"}}
0xkey ethereum transaction --signer "<address>" --payload "<unsigned-tx-hex>" --key-name quickstart
```

## Shared config contract

```text theme={"theme":{"light":"github-light","dark":"github-dark"}}
~/.config/0xkey/
├── config.toml          # host / organization / key_name only — never secrets
├── keys/                # API keys
└── encryption-keys/     # TEK for wallet import/export
```

The same layout is shared with AgentOS tooling (`0xkey-wallet`). Private keys are never written into `config.toml`.

## Next steps

* [Go SDK getting started](/sdks/go/getting-started)
* [API overview](/developer-reference/api-overview/intro)
* [CLI source](https://github.com/0xkey-io/cli)
