Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

config init

Interactive wizard. Five prompts, one written file: ./apyx.config.json.

apyx config init

Synopsis

apyx config init

No flags. The wizard runs in the current directory and writes ./apyx.config.json (the project config). Pre-existing files are detected and the wizard asks before overwriting.

What it asks

$ apyx config init
chain (ethereum | base) [ethereum]:
rpcUrl [https://eth.llamarpc.com]:
signer type (key | ledger | none) [key]:
keyPath [~/.apyx/keys/default]:
wrote /path/to/cwd/apyx.config.json
next: put your hex private key at ~/.apyx/keys/default
      (one line, 32 bytes; `chmod 600` the file).
PromptDefaultEffect
chainethereumSets profiles.default.chain.
rpcUrlhttps://eth.llamarpc.com (or Base default for Base)Sets profiles.default.rpcUrl. Use a paid RPC for any real workload — see Custom RPC recipe.
signer typekeyPicks the signer shape. none writes a profile without a signer (read-only).
keyPath~/.apyx/keys/defaultOnly asked when signer type = key. Path is stored verbatim — the wizard does not create the file.
derivationPathm/44'/60'/0'/0/0Only asked when signer type = ledger.

After writing the file the wizard prints a “next:” reminder pointing at whichever path you chose for the key.

What gets written

{
  "defaultProfile": "default",
  "profiles": {
    "default": {
      "chain": "ethereum",
      "rpcUrl": "https://eth.llamarpc.com",
      "signer": { "type": "key", "keyPath": "~/.apyx/keys/default" }
    }
  }
}

Only one profile (default). To add more, edit the file by hand or add another profile block — the schema is in Configuration.

Overwrite handling

If ./apyx.config.json already exists:

$ apyx config init
./apyx.config.json already exists. Overwrite? (y/N): n
aborted

Decline and the file is untouched, exit code 1. The decline path is covered by an e2e spec — see test/e2e/cli/config.e2e.spec.ts.

Exit codes

CodeMeaning
0Wrote a new config file
1User declined to overwrite an existing file, or wizard aborted via ^C

Common follow-ups

After config init:

  1. Drop your hex private key into the keyPath you chose:
    echo '0xYOUR_KEY' > ~/.apyx/keys/default
    chmod 600 ~/.apyx/keys/default
    
  2. Verify the resolved config: apyx config show.
  3. Open the REPL: apyx repl.