Account CLI
Manage customer sub-accounts from your terminal. List, create, pin, delete.
Overview
The oya account command group is the primary interface for agency operators. Every subcommand operates against your agency account's set of customer sub-accounts. Non-agency users will get a 403 from the backend.
~/.oya/config.json under the active_account_id key. Once set, every subsequent oya command (agents, templates, gateways, routines, KB) operates on that customer's data, not your own. Run oya account use --clear to switch back.oya account whoami
Show who you're signed in as and which customer you're currently targeting.
oya account whoami
# Logged in as: [email protected]
# Account type: agency
# Balance: $124.50
# Active target: acct_8f3c… (Acme Corp)oya account list
List every customer sub-account on your agency, with usage and activity stats.
oya account list
# ID LABEL AGENTS RUNS(7d) SPEND(MTD) LAST ACTIVITY
# acct_8f3c… Acme Corp 4 1,284 $48.20 2 min ago
# acct_b921… Globex Inc. 2 317 $12.04 3 hr ago
# acct_4e07… Initech LLC 1 0 $0.00 neveroya account create
Create a new customer sub-account.
oya account create \
--label "Acme Corp" \
--email "[email protected]" \
--useFlags
- --label (required) Display name shown in the customers list. 1–120 chars.
- --email (optional) Contact email for the future invite flow. Stored but not used today.
- --invite (optional) Stub for v2 magic-link invite. No-op today; safe to omit.
- --use (optional) Pin this new customer as your active target after creating it.
oya account use
Pin or clear the active target. Subsequent commands operate on the pinned customer.
# Pin a customer as the active target
oya account use acct_8f3c…
# Show the current active target (no arg)
oya account use
# Clear, operate on your own agency account again
oya account use --clearoya account delete
Soft-archive a customer. The account_type flips to customer_archived, agents stop running, and data is retained in case you need to restore. If the deleted account was your active target, it's automatically cleared.
oya account delete acct_8f3c…Under the hood
- whoami → GET /api/me
- list → GET /api/agency/customers
- create → POST /api/agency/customers
- use → no API call; writes to ~/.oya/config.json after validating against /api/agency/customers
- delete → DELETE /api/agency/customers/<id>
Server-side, the operating-on-a-customer model is enforced via the X-Target-Account-Id header that the CLI sends automatically when an active target is set. The backend validates the header against your accessible_account_ids() set before allowing the request.