aihubs-cli
v1.3.9
Published
Local multi-account manager for AI CLI providers
Maintainers
Readme
aihubs-cli
aihubs-cli is a local multi-account manager for supported AI CLI providers.
It stores account metadata locally, switches authentication files, and displays
available usage information without printing credentials.
Supported providers:
codexgrokagyclaudefreebuff
Install
Requirements: Node.js 20+, the CLI for the provider you want to use, and Windows, macOS, or Linux.
npm install -g aihubs-cli
aihubs-cli --helpThe selected provider CLI must be installed and available on PATH.
Welcome screen
Running the command without arguments shows the quick-start screen for the current version:
PS C:\Users\YourName> aihubs-cli
█████╗ ██╗██╗ ██╗██╗ ██╗██████╗ ███████╗
██╔══██╗██║██║ ██║██║ ██║██╔══██╗██╔════╝
███████║██║███████║██║ ██║██████╔╝███████║
██╔══██║██║██╔══██║██║ ██║██╔══██╗╚════██║
██║ ██║██║██║ ██║╚██████╔╝██║ ██║███████║
╚═╝ ╚═╝╚═╝╚═╝ ╚═╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
── C L I ──
Welcome to aihubs-cli v0.0.0
A simple local manager for your AI provider accounts and sessions.
GET STARTED
aihubs-cli login Sign in and save an account
aihubs-cli list View your saved accounts
aihubs-cli switch Change the active account
aihubs-cli status Check authentication status
Run aihubs-cli --help for all commands and options.Common commands
# Sign in
aihubs-cli login codex
aihubs-cli login grok
aihubs-cli login freebuff
aihubs-cli login agy
aihubs-cli login claude
# List accounts
aihubs-cli list
aihubs-cli list codex
aihubs-cli list grok
aihubs-cli list agy
aihubs-cli session codex
aihubs-cli continue
aihubs-cli continue grok
aihubs-cli continue codex
aihubs-cli continue claude
aihubs-cli grok
aihubs-cli codex
aihubs-cli agy
aihubs-cli current codex
# Inspect and switch accounts
aihubs-cli current
aihubs-cli status
aihubs-cli doctor
aihubs-cli clean --all --yes
aihubs-cli switch codex 01
aihubs-cli switch grok [email protected]
# Manage accounts
aihubs-cli alias set 01 personal
aihubs-cli alias clear personal
aihubs-cli remove 01 02 --yes
aihubs-cli export accounts.json
aihubs-cli import accounts.jsonAccount selectors can be row numbers, account IDs, email addresses, or aliases.
switch always requires an explicit provider and uses the global row number
shown by list, for example aihubs-cli switch codex 04. list can show more
than one active account because each provider has its own active session.
Account switching is supported only for codex and grok.
Provider-specific forms are supported for list, session, continue, and
current. continue resumes a conversation within the selected provider;
cross-provider continuation is not supported. status always shows all
providers. Without a provider, other
commands use the configured default provider. Use
aihubs-cli --help for the complete command list.
Account list
The human-readable list includes the row ID, provider, plan, token usage, reset date, and last activity:
An asterisk (*) marks the active account. Because providers maintain separate
sessions, list may show one active * for Codex and another for Grok, Agy, or
other providers.
ID PROVIDER ACCOUNT PLAN TOKEN USAGE RESET AT LAST ACTIVITY
-------------------------------------------------------------------------------------------------------------------------
01 codex [email protected] Go 9% Sep 22, 2026 Aug 24, 2026
02 codex [email protected] Free Auth expired - Aug 23, 2026For Codex accounts, usage is retrieved independently for every account from the authenticated Codex backend. The CLI reads the primary and secondary rate-limit windows and treats server-provided reset timestamps as authoritative.
Codex accounts are discovered from the active auth file and the per-account files in:
~/.codex/accounts/*.auth.jsonOn Windows, ~ means the current user profile directory. Auth expired,
Access denied, Rate limited, and Unknown are status messages, not usage
percentages. Missing usage is displayed as -.
Provider login
Login delegates to the selected provider CLI:
aihubs-cli login <provider>Freebuff login URLs open automatically in the default browser. Other providers use their own installed CLI login flow.
Agy
Use the Antigravity CLI through the agy command. Install agy, then sign in
and manage it with:
agy --version
aihubs-cli login agy
aihubs-cli list agy
aihubs-cli current agyAgy account emails are discovered from the provider account file under
~/.gemini/google_accounts.json and
recent Agy authentication logs. Agy does not expose separate switchable OAuth
profiles, so switch agy ... is not supported; use Agy's own sign-out and
Google authentication flow to change accounts. Agy quota is shown as
Unknown because its quota panel is interactive and has no supported
non-interactive billing endpoint.
JSON output
Use --json for scripts and integrations:
aihubs-cli --json list
aihubs-cli --json list codex
aihubs-cli --json status
aihubs-cli --json doctordoctor checks installed provider CLIs, saved account counts, and basic
authentication metadata. Use --no-update-check to skip the daily npm update
notification for a command, for example: aihubs-cli --no-update-check list.
Normal JSON output redacts access tokens, refresh tokens, API keys, cookies, authorization headers, and other sensitive values. Credential export requires both explicit flags:
aihubs-cli export accounts.json --include-credentials --confirm-sensitive-exportStorage
The manager stores registry metadata, protected account snapshots, usage cache, and backups in:
~/.provider-authProvider authentication remains in the provider's own home. Override locations when needed:
$env:PROVIDER_HOME = "D:\\path\\to\\provider-home"
$env:PROVIDER_AUTH_HOME = "D:\\path\\to\\aihubs-auth"Never commit authentication files, exports, backups, or tokens. See SECURITY.md.
Development
npm install
npm run build
npm testTypeScript source is under src/, tests are under test/, and compiled files
are written to dist/.
Troubleshooting
Verify the provider CLI is installed and available on PATH:
codex --version
grok --version
agy --version
claude --version
freebuff --versionIf a Codex account displays 401, authenticate that account again:
aihubs-cli login codexWhen developing locally, run the local build directly:
node .\\dist\\cli.js listLicense
Copyright © 2026. MIT License; see LICENSE.
