CLI Reference

Mushu CLI - Authentication and push notifications for your apps

Installation

pip install mushu-cli

Global Commands

mushu init

Initialize a .mushu.json config file in the current directory. This creates a project-specific configuration that the CLI will automatically use when running commands from this directory (or any subdirectory). Examples: mushu init --org org_abc123 mushu init --org org_abc123 --tenant tenant_xyz mushu init --org org_abc123 --app app_def456

mushu init
OptionDescription
--org, -o Organization ID
--org-name Organization name (for display)
--app, -a App ID
--app-name App name (for display)
--tenant, -t Notification tenant ID
--pay-tenant Pay tenant ID
--force, -f Overwrite existing config

mushu config

Configure global CLI settings. For per-project settings, use 'mushu init' to create a .mushu.json file.

mushu config
OptionDescription
--auth-url Set auth API URL
--notify-url Set notify API URL
--pay-url Set pay API URL
--media-url Set media API URL
--show, -s Show current config

mushu status

Show current status and effective configuration.

mushu status

auth commands

Authentication commands

mushu auth login

Sign in with Apple (opens browser). Opens your default browser for Apple Sign In. After authentication, the browser will redirect back to the CLI to complete login.

mushu auth login

Options

FlagDescription
--no-browser Print URL instead of opening browser

mushu auth login-manual

Manually enter tokens for testing.

mushu auth login-manual

mushu auth logout

Sign out and clear stored tokens.

mushu auth logout

mushu auth status

Show current authentication status.

mushu auth status

mushu auth token

Display current session token info.

mushu auth token

mushu auth refresh

Refresh session tokens.

mushu auth refresh

mushu auth user

Show current user profile.

mushu auth user

org commands

Organization management

mushu org create

Create a new organization.

mushu org create <name>

Arguments

NameDescriptionRequired
name Organization name Yes

mushu org list

List organizations you belong to.

mushu org list

mushu org show

Show organization details.

mushu org show <org_id>

Arguments

NameDescriptionRequired
org_id Organization ID Yes

mushu org use

Set default organization for commands.

mushu org use <org_id>

Arguments

NameDescriptionRequired
org_id Organization ID to set as default Yes

mushu org current

Show current default organization.

mushu org current

mushu org delete

Delete an organization (owner only).

mushu org delete <org_id>

Arguments

NameDescriptionRequired
org_id Organization ID Yes

Options

FlagDescription
--force, -f Skip confirmation

mushu org members

Organization member management

mushu org members

mushu org invites

Organization invite management

mushu org invites

app commands

App management

mushu app create

Create a new app.

mushu app create <name>

Arguments

NameDescriptionRequired
name App name Yes

Options

FlagDescription
--bundle-id, -b iOS bundle ID (e.g., com.company.app)*
--org, -o Organization ID
--android Android package name

mushu app list

List apps in an organization.

mushu app list

Options

FlagDescription
--org, -o Organization ID

mushu app show

Show app details.

mushu app show [app_id]

Arguments

NameDescriptionRequired
app_id App ID No

mushu app use

Set default app for commands.

mushu app use <app_id>

Arguments

NameDescriptionRequired
app_id App ID to set as default Yes

mushu app current

Show current default app.

mushu app current

mushu app delete

Delete an app (admin only).

mushu app delete [app_id]

Arguments

NameDescriptionRequired
app_id App ID No

Options

FlagDescription
--force, -f Skip confirmation

api-key commands

API key management

mushu api-key create

Create a new API key for an app. The full key is only shown once - save it immediately.

mushu api-key create <name>

Arguments

NameDescriptionRequired
name Key name (e.g., 'production-backend') Yes

Options

FlagDescription
--app, -a App ID
--scope, -s Scope: read, write, or admin
--expires Days until expiry (default: never)

mushu api-key list

List API keys for an app.

mushu api-key list

Options

FlagDescription
--app, -a App ID

mushu api-key show

Show API key details.

mushu api-key show <key_id>

Arguments

NameDescriptionRequired
key_id API key ID Yes

Options

FlagDescription
--app, -a App ID

mushu api-key delete

Revoke an API key. The key will stop working immediately.

mushu api-key delete <key_id>

Arguments

NameDescriptionRequired
key_id API key ID to revoke Yes

Options

FlagDescription
--app, -a App ID
--force, -f Skip confirmation

tenant commands

Tenant management commands

mushu tenant create

Create a new notification tenant for an organization.

mushu tenant create

Options

FlagDescription
--org, -o Organization ID (uses default if not specified)
--bundle-id, -b iOS app bundle ID*
--team-id, -t Apple Developer Team ID*
--key-id, -k APNs Key ID*
--key-file, -f Path to APNs .p8 key file*
--sandbox Use sandbox APNs

mushu tenant list

List tenants for an organization.

mushu tenant list

Options

FlagDescription
--org, -o Organization ID (uses default if not specified)

mushu tenant delete

Delete a tenant.

mushu tenant delete <tenant_id>

Arguments

NameDescriptionRequired
tenant_id Tenant ID to delete Yes

Options

FlagDescription
--yes, -y Skip confirmation

mushu tenant use

Set default tenant.

mushu tenant use <tenant_id>

Arguments

NameDescriptionRequired
tenant_id Tenant ID to set as default Yes

mushu tenant api-key

Create an API key for a tenant.

mushu tenant api-key [tenant_id]

Arguments

NameDescriptionRequired
tenant_id Tenant ID (uses default if not specified) No

Options

FlagDescription
--name, -n Key name

pay commands

Payment tenant management commands

mushu pay create

Create a new pay tenant for an organization.

mushu pay create

Options

FlagDescription
--org, -o Organization ID (uses default if not specified)
--name, -n Tenant name*
--stripe-key, -k Stripe secret key*
--webhook-secret, -w Stripe webhook secret

mushu pay list

List pay tenants for an organization.

mushu pay list

Options

FlagDescription
--org, -o Organization ID (uses default if not specified)

mushu pay use

Set default pay tenant.

mushu pay use <tenant_id>

Arguments

NameDescriptionRequired
tenant_id Pay tenant ID to set as default Yes

mushu pay products

List products for a pay tenant.

mushu pay products [tenant_id]

Arguments

NameDescriptionRequired
tenant_id Pay tenant ID (uses default if not specified) No

mushu pay add-product

Add a product (one-time credit pack).

mushu pay add-product

Options

FlagDescription
--tenant, -t Pay tenant ID (uses default if not specified)
--name, -n Product name*
--price, -p Price in cents (1000 = $10)*
--credits, -c Credits to grant*

mushu pay balance

Check credit balance for a customer.

mushu pay balance

Options

FlagDescription
--tenant, -t Pay tenant ID (uses default if not specified)
--customer, -c Customer ID (uses current org if not specified)

mushu pay transactions

List transactions for a customer.

mushu pay transactions

Options

FlagDescription
--tenant, -t Pay tenant ID (uses default if not specified)
--customer, -c Customer ID (uses current org if not specified)
--limit, -l Number of transactions to show

mushu pay auto-refill

Configure auto-refill for a customer.

mushu pay auto-refill

Options

FlagDescription
--tenant, -t Pay tenant ID (uses default if not specified)
--customer, -c Customer ID (uses current org if not specified)
--enable Enable or disable auto-refill
--product, -p Product to purchase for auto-refill
--threshold Balance threshold to trigger auto-refill

mushu pay api-key

Create an API key for a pay tenant.

mushu pay api-key [tenant_id]

Arguments

NameDescriptionRequired
tenant_id Pay tenant ID (uses default if not specified) No

Options

FlagDescription
--name, -n Key name

media commands

Media management commands

mushu media upload

Upload an image or video file.

mushu media upload <file_path>

Arguments

NameDescriptionRequired
file_path Path to image or video file Yes

Options

FlagDescription
--org, -o Organization ID (uses default if not specified)
--tenant, -t Tenant ID (optional, for tenant-specific media)

mushu media list

List media items for an organization.

mushu media list

Options

FlagDescription
--org, -o Organization ID (uses default if not specified)
--tenant, -t Filter by tenant ID
--type Filter by type (image, video)

mushu media get

Get details for a media item.

mushu media get <media_id>

Arguments

NameDescriptionRequired
media_id Media ID Yes

mushu media delete

Delete a media item.

mushu media delete <media_id>

Arguments

NameDescriptionRequired
media_id Media ID Yes

Options

FlagDescription
--force, -f Skip confirmation

mushu media url

Get download URL for a media item.

mushu media url <media_id>

Arguments

NameDescriptionRequired
media_id Media ID Yes

Options

FlagDescription
--variant, -v Image variant (original, thumbnail, small, medium, large)

device commands

Device management commands

mushu device register

Register a device token.

mushu device register

Options

FlagDescription
--user, -u User ID*
--token APNs device token*
--platform, -p Platform (ios/watchos)
--tenant, -t Tenant ID
--version, -v App version
--api-key, -k Tenant API key

mushu device list

List devices for a user.

mushu device list

Options

FlagDescription
--user, -u User ID*
--tenant, -t Tenant ID
--api-key, -k Tenant API key

mushu device unregister

Unregister a device token.

mushu device unregister

Options

FlagDescription
--user, -u User ID*
--token Device token*
--tenant, -t Tenant ID
--api-key, -k Tenant API key

push commands

Push notification commands

mushu push send

Send a push notification to a user.

mushu push send

Options

FlagDescription
--user, -u Target user ID*
--title Notification title
--body, -b Notification body
--tenant, -t Tenant ID
--badge Badge count
--sound Sound name
--payload, -p Custom JSON payload
--silent, -s Silent/background push
--api-key, -k Tenant API key

mushu push bulk

Send push to multiple users.

mushu push bulk

Options

FlagDescription
--users Comma-separated user IDs*
--title Notification title
--body, -b Notification body
--tenant, -t Tenant ID
--badge Badge count
--silent, -s Silent/background push
--api-key, -k Tenant API key

email commands

Email notification commands

mushu email add-domain

Add a domain for email sending.

mushu email add-domain <domain>

Arguments

NameDescriptionRequired
domain Domain to add (e.g., acme.com) Yes

Options

FlagDescription
--tenant, -t Tenant ID
--from-name Default sender name

mushu email verify-domain

Check domain verification status.

mushu email verify-domain <domain>

Arguments

NameDescriptionRequired
domain Domain to verify Yes

Options

FlagDescription
--tenant, -t Tenant ID

mushu email get-domain

Get domain details including DNS records.

mushu email get-domain <domain>

Arguments

NameDescriptionRequired
domain Domain to get details for Yes

Options

FlagDescription
--tenant, -t Tenant ID

mushu email delete-domain

Remove a domain from the tenant.

mushu email delete-domain <domain>

Arguments

NameDescriptionRequired
domain Domain to delete Yes

Options

FlagDescription
--tenant, -t Tenant ID
--force, -f Skip confirmation

mushu email add-contact

Register an email contact for a user.

mushu email add-contact

Options

FlagDescription
--user, -u User ID*
--email, -e Email address*
--tenant, -t Tenant ID
--api-key, -k Tenant API key

mushu email list-contacts

List email contacts.

mushu email list-contacts

Options

FlagDescription
--user, -u Filter by user ID
--email, -e Filter by email
--tenant, -t Tenant ID
--api-key, -k Tenant API key

mushu email unsubscribe

Unsubscribe an email contact.

mushu email unsubscribe <email_address>

Arguments

NameDescriptionRequired
email_address Email to unsubscribe Yes

Options

FlagDescription
--tenant, -t Tenant ID
--api-key, -k Tenant API key

mushu email send

Send an email notification to a user.

mushu email send

Options

FlagDescription
--user, -u Target user ID*
--subject, -s Email subject*
--html HTML body (or use --file)
--file, -f HTML file to send
--text Plain text body
--from Sender email (must be @verified-domain)
--tenant, -t Tenant ID
--api-key, -k Tenant API key

Environment Variables

The CLI can also be configured using environment variables:

VariableDescription
MUSHU_AUTH_URL Override the auth API URL
MUSHU_NOTIFY_URL Override the notify API URL

Configuration File

The CLI stores configuration in ~/.mushu/config.json. This includes API URLs and your default tenant.

Tokens are stored separately in ~/.mushu/tokens.json. These are refreshed automatically when needed.