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.
Enable HTTP & TCP on the server first
The CLI needs TCP 27019 enabled (new AxioDB({ TCP: true }) or AXIODB_TCP=true) for data commands: db, collection, document, index, transaction, ping, health, connect. Management commands (user, role, user change-password, export/import) need HTTP 27018 enabled (GUI: true / AXIODB_GUI=true). TCP is data-plane only by design — no user/role management over TCP.
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 HTTP + authenticated TCP + Dashboard (GUI enabled)11axiodb serve full12
13# Choose the admin password instead of admin/admin14axiodb serve tcp-auth my-secret-password # required for tcp-auth15axiodb serve full my-secret-password # optional for http/fullPresets
http— HTTP API only on port 27018tcp— unauthenticated TCP on port 27019tcp-auth— authenticated TCP onlyfull— HTTP + authenticated TCP, GUI disabled
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 rejects it (no admin account).
Node.js 20+ and npm are required. The command uses fixed ports 27018 (HTTP) and 27019 (TCP), 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-host | — | localhost | HTTP server host (for export/import) |
| --http-port | — | 27018 | HTTP server port (for export/import) |
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 use the HTTP API (port 27018) — --http-host and --http-port are separate from the TCP flags.
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# Find several documents by ID23axiodb -c axiodb://127.0.0.1:27019 document find-by-ids '["id1","id2"]' \24 --db mydb --collection users25
26# With authentication27axiodb -c axiodb://127.0.0.1:27019 -u admin -p secret db list28
29# With TLS30axiodb -c axiodb://127.0.0.1:27019 --tls --tls-cert ./cert.pem db list31
32# Using --host and --port instead of connection string33axiodb --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> exitExport & Import (via HTTP API)
Export and import use the HTTP Dashboard API (port 27018), not the TCP protocol. They require -u/-p flags for HTTP session authentication. Tab completes .tar.gz file paths automatically.
1# Export database (saves mydb.tar.gz in current directory)2axiodb export mydb \3 --http-host localhost --http-port 27018 \4 -u admin -p secret5
6# Export from remote server7axiodb export mydb \8 --http-host prod.example.com --http-port 27018 \9 -u admin -p secret10
11# Import database from file (tab completes .tar.gz files)12axiodb import ./backups/mydb.tar.gz \13 --http-host localhost --http-port 27018 \14 -u admin -p secret15
16# Import overwrites if database already exists — delete first via GUI or CLI17axiodb db delete mydb -c axiodb://localhost:27019 -u admin -p secret18axiodb import ./backups/mydb.tar.gz \19 --http-host localhost --http-port 27018 \20 -u admin -p secretUser & Role Administration (via HTTP API)
Management commands use HTTP port 27018. The TCP protocol remains data-plane only.
1# User and role administration uses the HTTP API (port 27018)2axiodb user list --http-host localhost --http-port 27018 -u admin -p secret3axiodb user create analyst analyst123 View --http-host localhost --http-port 27018 -u admin -p secret4axiodb role list --http-host localhost --http-port 27018 -u admin -p secret5axiodb role create Auditor document:view,document:query --http-host localhost --http-port 27018 -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 secretFeatures
TCP Data Operations
Database, collection, document CRUD, aggregation, indexing, counts, hints, find-by-IDs, and transactions
Health & Diagnostics
Check TCP service health and retrieve instance information
HTTP Administration
Manage users and roles without adding management commands to the TCP client
Interactive REPL
MongoDB shell syntax with tab autocomplete
Export & Import
Backup/restore databases via HTTP API, tab-completes file paths
TLS Encryption
--tls, --tls-cert, --tls-skip-verify flags
TCP Authentication
-u / -p flags, shared RBAC with GUI
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 uses two protocols: TCP (port 27019) for queries/CRUD, and HTTP (port 27018) for export/import. They are separate surfaces — TCP commands cannot talk to the HTTP API and vice versa. TCPAuth and TLS features require AxioDB server version 15.0.0 or later.
See also: Docker · AxioDBCloud · Installation
