AxioDB CLI
Command line interface for AxioDB. Connect to any AxioDB server via TCP, run queries, manage databases — all from your terminal with MongoDB shell syntax.
Connection & Services
The CLI connects over TCP 27019 by default for all operations: database, collection, document CRUD, aggregation, indexes, transactions, archive export/import, telemetry (info, stats), and user/role administration. Optional HTTP fallback for export/import is available via --http (port 27018).
Quick Install
Linux / macOS
1curl -fsSL https://raw.githubusercontent.com/nexoral/AxioDB/main/cli/Scripts/install.sh | bashWindows (PowerShell)
1irm https://raw.githubusercontent.com/nexoral/AxioDB/main/cli/Scripts/install.ps1 | iexChoose what to install: The installer prompts interactively (1) CLI, (2) GUI, (3) Both. When piped (curl | bash), it defaults to CLI. Set CHOICE for non-interactive selection:
CHOICE=1 → CLI onlyCHOICE=2 → GUI onlyCHOICE=3 → CLI + GUISee Installation for full details.
Start a Temporary Server
Use serve for local development. The CLI creates a temporary AxioDBdata folder, installs the published npm package, and keeps the server attached to your terminal. Press Ctrl+Cto stop it and remove the temporary data.
1# Start a temporary HTTP API server2axiodb serve http3
4# Start a temporary unauthenticated TCP server5axiodb serve tcp6
7# Start TCP authentication only (password required)8axiodb serve tcp-auth9
10# Start a temporary native MCP server (port 27020)11axiodb serve mcp12
13# Start full stack: HTTP + authenticated TCP + Dashboard GUI + MCP server14axiodb serve full15
16# Choose the admin password instead of admin/admin17axiodb serve tcp-auth my-secret-password # required for tcp-auth18axiodb serve full my-secret-password # optional for http/fullPresets
http— HTTP API only on port 27018tcp— unauthenticated TCP on port 27019tcp-auth— authenticated TCP onlymcp— native Model Context Protocol server on port 27020full— HTTP + authenticated TCP + Dashboard GUI + MCP server
Admin password
tcp-auth requires it — it has no HTTP surface, so the seeded admin/admin could never be rotated and every TCP login would be rejected. http and full take it optionally, since the control server can rotate the password. tcp and mcp reject it (no admin account).
Powered by Bun (or auto-installed if missing). The command uses fixed ports 27018 (HTTP), 27019 (TCP), and 27020 (MCP), and reports the temporary data path and enabled endpoints when startup succeeds.
Connection String
Format: axiodb://host:port
The CLI uses a custom axiodb:// scheme — not mongodb:// or http://. Credentials and TLS are passed as separate flags, not embedded in the URL.
1# Format: axiodb://host:port2
3# Local server (default)4axiodb://localhost:270195
6# Remote server7axiodb://192.168.1.100:270198
9# Custom domain10axiodb://mydb.example.com:27019Components
axiodb://— scheme (required, always this value)host— hostname or IP (required, default:localhost)port— TCP port (required, default:27019)
Not supported in URL
- ❌ Path segments (
axiodb://host:27019/db) - ❌ Query parameters (
axiodb://host:27019?auth=true) - ❌ Credentials (
axiodb://user:pass@host:27019) - ❌ TLS variant (
axiodbs://) — use--tlsflag instead
MongoDB users: AxioDB's connection string is simpler than MongoDB's. There is no mongodb:// format, no replica set syntax, no auth source query params. Just axiodb://host:port — all options go in flags.
Global Flags
These flags work with all commands. Pass them before the subcommand or after it.
| Flag | Short | Default | Description |
|---|---|---|---|
| --connection-string | -c | "" | Connection string (axiodb://host:port) |
| --host | — | localhost | Server host |
| --port | — | 27019 | Server port |
| --username | -u | "" | Username for TCP authentication |
| --password | -p | "" | Password for TCP authentication |
| --tls | — | false | Enable TLS encryption |
| --tls-cert | — | "" | Path to CA certificate (for self-signed) |
| --tls-skip-verify | — | false | Skip TLS certificate verification |
| --output | -o | table | Output format: table | json |
| --timeout | — | 30 | Request timeout in seconds |
| --db | — | "" | Database name (for single commands) |
| --collection | — | "" | Collection name (for single commands) |
| --http | — | false | Use HTTP API instead of TCP for export/import |
| --http-host | — | localhost | HTTP server host (when using --http) |
| --http-port | — | 27018 | HTTP server port (when using --http) |
Note: -c overrides --host and --port when both are provided. Auth flags (-u/-p) are only sent if the server has TCPAuth: true enabled. Export/import route over TCP (port 27019) by default; passing --http uses the HTTP API (port 27018 with --http-host / --http-port).
Usage
Single Commands
1# Test connection2axiodb -c axiodb://127.0.0.1:27019 ping3
4# Check service health5axiodb -c axiodb://127.0.0.1:27019 health6
7# List databases8axiodb -c axiodb://127.0.0.1:27019 db list9
10# Insert a document11axiodb -c axiodb://127.0.0.1:27019 document insert '{"name":"Alice","age":30}' \12 --db mydb --collection users13
14# Query documents (JSON output)15axiodb -c axiodb://127.0.0.1:27019 document query '{"age":{"$gt":25}}' \16 --db mydb --collection users --output json17
18# Query using an index hint19axiodb -c axiodb://127.0.0.1:27019 document query '{"email":"[email protected]"}' \20 --db mydb --collection users --hint email21
22# Vector search over TCP23axiodb -c axiodb://127.0.0.1:27019 document vector-search \24 --db mydb --collection items --field embedding \25 --vector '[0.023, -0.41, 0.88, 0.12]' --top-k 5 --metric cosine26
27# Vector search with embedding loaded from a file and metadata query filter28axiodb -c axiodb://127.0.0.1:27019 document vector-search \29 --db mydb --collection items --field embedding \30 --vector-file ./query_vector.json --query '{"category":"electronics"}' --min-score 0.731
32# Find several documents by ID33axiodb -c axiodb://127.0.0.1:27019 document find-by-ids '["id1","id2"]' \34 --db mydb --collection users35
36# With authentication37axiodb -c axiodb://127.0.0.1:27019 -u admin -p secret db list38
39# With TLS40axiodb -c axiodb://127.0.0.1:27019 --tls --tls-cert ./cert.pem db list41
42# Using --host and --port instead of connection string43axiodb --host 192.168.1.100 --port 27019 pingInteractive REPL (MongoDB Shell Style)
1# Start with connection string2axiodb connect -c axiodb://127.0.0.1:270193
4# Start with auth5axiodb connect -c axiodb://127.0.0.1:27019 -u admin -p secret6
7# Start with TLS8axiodb connect -c axiodb://127.0.0.1:27019 --tls --tls-cert ./cert.pem9
10# Start with host/port flags (no connection string)11axiodb connect --host 192.168.1.100 --port 2701912
13# Start with defaults (localhost:27019)14axiodb connect15
16# Once connected — MongoDB shell syntax:17axiodb> use mydb18axiodb:mydb> show dbs19axiodb:mydb> show collections20axiodb:mydb> use mydb.users21axiodb:mydb:users> db.users.find({})22axiodb:mydb:users> db.users.find({age: {$gt: 25}})23axiodb:mydb:users> db.users.insert({name: "Bob", age: 25})24axiodb:mydb:users> db.users.updateOne({name: "Bob"}, {$set: {age: 26}})25axiodb:mydb:users> db.users.deleteOne({name: "Bob"})26axiodb:mydb:users> db.users.countDocuments()27axiodb:mydb:users> db.users.vectorSearch("embedding", [0.1, 0.2, 0.3], {"topK": 5, "metric": "cosine"})28axiodb:mydb:users> exitExport & Import (via TCP / HTTP)
Export and import default to the TCP protocol (port 27019) with chunked transfer. Pass --http to route through the HTTP Dashboard API (port 27018). Tab completes .tar.gz file paths automatically.
1# Export database over TCP (:27019 default, saves mydb.tar.gz in current directory)2axiodb export mydb -u admin -p secret3
4# Export from remote server over TCP5axiodb export mydb --host prod.example.com --port 27019 -u admin -p secret6
7# Optional HTTP export via --http flag8axiodb export mydb --http --http-host localhost --http-port 27018 -u admin -p secret9
10# Import database from file over TCP (:27019 default, tab completes .tar.gz files)11axiodb import ./backups/mydb.tar.gz -u admin -p secret12
13# Import overwrites if database already exists — delete first via GUI or CLI14axiodb db delete mydb -u admin -p secret15axiodb import ./backups/mydb.tar.gz -u admin -p secret16
17# Optional HTTP import via --http flag18axiodb import ./backups/mydb.tar.gz --http --http-host localhost --http-port 27018 -u admin -p secretUser & Role Administration
Manage users, roles, and permissions over TCP (port 27019, default) or HTTP (port 27018 with --http).
1# User and role administration via TCP (port 27019, default)2axiodb user list -u admin -p secret3axiodb user create analyst analyst123 View -u admin -p secret4axiodb user change-password oldpass newpass -u admin -p oldpass5axiodb role list -u admin -p secret6axiodb role create Auditor db:view,document:view -u admin -p secret7
8# Or over HTTP port 27018 using --http flag9axiodb user list --http -u admin -p secret10
11# Server runtime diagnostics and stats12axiodb info -u admin -p secret13axiodb stats -u admin -p secretTransactions
Transaction steps run in order on one TCP connection and commit together. Updates are flat merges; operators such as $inc are not supported.
1# Run transaction steps from a JSON file on one TCP connection2cat > transfer.json <<'EOF'3[4 {"operation":"update-by-id","id":"sender","updateData":{"balance":500}},5 {"operation":"update-by-id","id":"receiver","updateData":{"balance":1500}},6 {"operation":"savepoint","savepointName":"checked"}7]8EOF9
10axiodb transaction run transfer.json --db mydb --collection accounts \11 -c axiodb://127.0.0.1:27019 -u admin -p secretSelf-Removal (Destroy)
Safely removes the AxioDB CLI executable from the system. Aliases: distory, uninstall.
1# Self-remove the AxioDB CLI executable from the system2axiodb destroy3
4# Skip interactive confirmation prompt5axiodb destroy -y6# or7axiodb destroy --forceFeatures
TCP Data Operations
Database, collection, document CRUD, aggregation, indexing, vector similarity search, counts, hints, find-by-IDs, and transactions
Health & Telemetry
Check TCP health and retrieve instance diagnostics and stats with 'axiodb info' and 'axiodb stats'
User & Role Administration
Manage users, roles, and permissions directly over TCP or HTTP with shared RBAC
Interactive REPL
MongoDB shell syntax with tab autocomplete
Export & Import
Backup/restore databases via TCP (default) or HTTP API, tab-completes file paths
TLS Encryption
--tls, --tls-cert, --tls-skip-verify flags
TCP Authentication
-u / -p flags, shared RBAC with GUI
Self-Removal (Destroy)
One-line clean uninstallation with 'axiodb destroy' (-y / --force)
JSON & Table Output
--output json for scripting, --output table for reading
Supported Platforms
| OS | Architectures |
|---|---|
| Linux | amd64, arm64, 386, armv7 |
| macOS | amd64 (Intel), arm64 (Apple Silicon) |
| Windows | amd64, arm64, 386 |
| FreeBSD | amd64 |
| OpenBSD | amd64 |
| NetBSD | amd64 |
Version Compatibility
| CLI Version | Server Version | Protocol |
|---|---|---|
| cli-v1.x | AxioDB >= 15.0.0 | TCP (port 27019) |
Note: The CLI operates over TCP (port 27019) for all database operations, administration, and chunked archive export/import. HTTP (port 27018) is optionally supported via the --http flag. TCPAuth and TLS features require AxioDB server version 15.0.0 or later.
See also: Docker · AxioDBCloud · Installation
