npx agnic@latest status --json
If already authenticated, no further action needed. If not, choose the appropriate mode below.
Preferred when no browser is available. Generate an API token at app.agnic.ai > Settings > API Tokens.
Option A -- Environment variable (recommended for automation):
export AGNIC_TOKEN=<your-api-token>
npx agnic@latest status --json
The CLI reads AGNIC_TOKEN automatically. All subsequent commands in the same shell session use it without extra flags.
Option B -- Inline flag (one-off commands):
npx agnic@latest --token <your-api-token> status --json
Use when a browser is available:
npx agnic@latest auth login
This command:
http://localhost:/callback Wait for the CLI to print Authenticated! before proceeding.
npx agnic@latest status --json
Expected output:
{
"authenticated": true,
"userId": "did:privy:...",
"email": "user@example.com",
"walletAddress": "0x...",
"tokenExpiry": "2026-05-22T14:30:00Z"
}
To remove stored credentials:
npx agnic@latest auth logout
~/.agnic/config.json with 0600 permissions. Tokens auto-refresh on 401 responses. Refresh token expires after 90 days.AGNIC_TOKEN env var or --token flag per invocation.AGNIC_TOKEN env var, pass --token, or run auth login共 1 个版本