# Run in Scripts and CI

> Documentation index: [llms.txt](https://namera.ai/llms.txt).

Source: https://namera.ai/docs/cli/guides/automation/run-in-scripts-and-ci

Use explicit inputs, JSON output, and a secret-backed credential.

## Authenticate Without Browser Prompts [#authenticate-without-browser-prompts]

Install Node.js 24.14+ and the CLI. Supply `NAMERA_API_KEY` through your CI
secret store, not a committed configuration file or command-line argument.
Pin the CLI version used by the job to a release you have tested.

```sh
npm install -g @namera-ai/cli@1.2.0
namera --output json wallet list
```

<div className="docs-response">

```json
[
  {
    "id": "0199dfe1-0000-7000-8000-000000000001",
    "organizationId": "0199dfe1-0000-7000-8000-000000000004",
    "metadata": {
      "version": 1,
      "name": "Example account",
      "logo": { "type": "emoji", "value": "👛" },
      "description": "SDK test account"
    },
    "status": "active",
    "namespace": "eip155",
    "address": "0x1111111111111111111111111111111111111111",
    "owner": {
      "signingKeyId": "0199dfe1-0000-7000-8000-000000000005",
      "custody": "namera-managed",
      "provider": "1claw",
      "algorithm": "secp256k1"
    },
    "createdAt": "2026-10-11T09:00:00.000Z",
    "updatedAt": "2026-10-11T09:00:00.000Z",
    "implementation": "alchemy-modular-v2",
    "data": {
      "version": 1,
      "modularAccountVersion": "2.0.0",
      "validatorType": "ecdsa_secp256k1",
      "entryPointVersion": "0.7",
      "accountMode": "7702",
      "delegationVersion": "v1.1.0"
    }
  }
]
```

</div>

API keys take precedence over saved CLI login profiles. For another deployment,
also supply `NAMERA_API_URL`.

## Separate Results from Errors [#separate-results-from-errors]

This POSIX shell example requires `jq` and uses an existing submission ID:

```sh
submission_id='0199dfe1-0000-7000-8000-000000000003'
if namera --output json execution status "$submission_id" > status.json 2> error.json; then
  status=$(jq -r '.status' status.json)
  case "$status" in
    confirmed) printf '%s\n' 'Confirmed' ;;
    failed) printf '%s\n' 'Submission failed' >&2; exit 1 ;;
    *) printf '%s\n' 'Still pending; check this ID again later' ;;
  esac
else
  jq -r '.error | "\(.code): \(.message)\n\(.nextStep)"' error.json >&2
  exit 1
fi
```

Do not merge stderr into stdout when parsing JSON. The CLI prints successful
data directly, not under a `data` field.

## Make Inputs Explicit [#make-inputs-explicit]

JSON output, quiet mode, and redirected streams disable missing-input prompts.
Supply all operation flags, or pass one complete `--params` request. See
[Interactive and Scripted Usage](https://namera.ai/docs/cli/interactive-and-scripted-usage).

For imports, the export passphrase remains interactive. A local signing key must
already be available to the runner's OS user and keyring. API-key authentication
alone does not provide signing-key material. Do not put private keys or keyring
unlock secrets into command arguments.

## Preserve Submission State [#preserve-submission-state]

Store a successful execution's `submissionId` with the job in durable storage.
Avoid duplicate workers and automatic whole-command execution retries. A job
that lost its response needs [reconciliation](https://namera.ai/docs/cli/guides/transactions/handle-retries-and-recovery),
not an immediate replacement transfer.

Example output uses fixture accounts and hashes, captured with the CLI's output
formatters. Plain-text output is shown without terminal colors; your values and
relative expiry dates will differ.
