Skip to content

CLI

Install and use the anon.li command-line tool to manage aliases, drops, domains, and more from your terminal.

The anon.li CLI (anonli) lets you manage aliases, encrypted file drops, recipients, and domains directly from your terminal. It authenticates with an API key from your dashboard and supports scripting with --json output and quiet mode.

Installation

Install globally with npm or bun:

Code
npm install -g anonli
Code
bun install -g anonli

Verify the installation:

Code
anonli --version

Quick Start

Authenticate

Log in with an API key from your anon.li dashboard:

Code
anonli login

Alternatively, pass a key directly:

Code
anonli login --token ak_your_api_key

Create an alias

Code
anonli alias new --custom myalias

Upload an encrypted file

Code
anonli drop upload ./secret.pdf --expiry 7

The CLI encrypts the file locally with AES-256-GCM, prompts for your vault password to store a recoverable owner key, uploads it, and returns a share link with the decryption key in the URL fragment.


Global Options

FlagDescription
-q, --quietSuppress spinners, tables, and boxes (only output essential data)
-v, --versionShow CLI version
-h, --helpShow help for any command

Configuration

The CLI stores its config at ~/.config/anonli.json (or $XDG_CONFIG_HOME/anonli.json). The file is created with 0600 permissions (owner-only).

Environment Variables

VariableDescription
ANONLI_API_KEYOverride the stored API key
ANONLI_BASE_URLOverride the API base URL (default: https://anon.li)

Config Commands

Code
# View current config
anonli config

# Set the base URL (e.g. for self-hosted)
anonli config set baseUrl https://my-instance.example.com

# Validate config and test API connectivity
anonli config validate

JSON Output

Most commands support --json for machine-readable output, making the CLI easy to integrate into scripts and pipelines:

Code
anonli alias list --json | jq '.[0].email'

Shell Completions

Generate completions for your shell:

Code
# Bash
source <(anonli completions bash)

# Zsh
source <(anonli completions zsh)

# Fish
anonli completions fish > ~/.config/fish/completions/anonli.fish

Add the appropriate line to your shell profile to load completions on startup.

Exit Codes

CodeMeaning
0Success
1Generic error
2Authentication error
3Rate limit exceeded
4Plan limit exceeded
5Not found

Command Reference


Additional Commands

anonli whoami

Show your account info and usage statistics:

Code
anonli whoami

Displays your email, plan tier, alias usage, recipient count, domain count, drop count, and storage usage.

API keys

Create and revoke API keys from Dashboard -> API Keys. Existing API keys cannot create or delete other API keys.

anonli subscribe

View pricing or subscribe to a plan:

Code
# Show pricing table
anonli subscribe

# Start checkout
anonli subscribe --product bundle --tier plus --frequency yearly

anonli update

Update the CLI to the latest version:

Code
anonli update

Next Steps