CLI Reference

Complete reference for all Ebla client commands with examples and options.

Authentication

ebla login

Authenticate with an Ebla server.

ebla login <server-url> [flags]

Flags:
  --password    Use password prompt instead of browser auth
  --token       Use API token directly (for automation)

Examples:
  # Browser-based login (recommended)
  ebla login https://files.example.com

  # Password prompt (for headless servers)
  ebla login https://files.example.com --password

  # Token-based (CI/CD)
  ebla login https://files.example.com --token $EBLA_TOKEN

ebla logout

Clear stored credentials.

ebla logout

# Clears all stored credentials for the current server

ebla whoami

Show current user information.

ebla whoami

Output:
  Email: user@example.com
  User ID: usr_abc123
  Server: https://files.example.com
  Token expires: 2026-01-22 10:30:00

Libraries

ebla library list

List all accessible libraries.

ebla library list [flags]

Flags:
  --json        Output as JSON
  --team <id>   Filter by team

Examples:
  ebla library list
  ebla library list --team team_abc123
  ebla library list --json | jq '.[] | .name'

ebla library create

Create a new library.

ebla library create <name> [flags]

Flags:
  --team <id>          Assign to team
  --description <text> Library description

Examples:
  ebla library create "My Documents"
  ebla library create "Team Files" --team team_abc123
  ebla library create "Project X" --description "Project X documentation"

ebla library delete

Delete a library (soft delete with 30-day retention).

ebla library delete <name-or-id> [flags]

Flags:
  --id       Treat argument as ID prefix
  -f, --force Skip confirmation prompt

Examples:
  ebla library delete "My Documents"      # By name (prompts for confirmation)
  ebla library delete e299620b --id       # By ID prefix
  ebla library delete "Old Stuff" -f      # Skip confirmation

ebla library deleted

List deleted libraries pending permanent deletion.

ebla library deleted

Output:
  ID        NAME           DELETED        PERMANENT DELETION
  e299620b  Old Stuff      2026-01-15     2026-02-14

ebla library restore

Restore a deleted library.

ebla library restore <name-or-id> [flags]

Flags:
  --id       Treat argument as ID prefix

Examples:
  ebla library restore "Old Stuff"
  ebla library restore e299620b --id

Sync

ebla sync add

Add a local folder to sync with a library.

ebla sync add <library-id> <path> [flags]

Flags:
  --read-only   Sync in read-only mode (no uploads)

Examples:
  ebla sync add e299620b ~/Documents
  ebla sync add e299620b /data/shared --read-only

ebla sync remove

Stop syncing a folder.

ebla sync remove <path>

Examples:
  ebla sync remove ~/Documents

# Does not delete local files

ebla sync list

List all sync configurations.

ebla sync list

Output:
  LIBRARY      PATH                    STATUS       MODE
  e299620b     /home/user/Documents    up-to-date   read-write
  f3a8b21c     /home/user/Photos       syncing      read-write
  a1c2d3e4     /data/shared            pending      read-only

ebla sync now

Force immediate sync.

ebla sync now [flags]

Flags:
  --library <id>   Sync specific library only

Examples:
  ebla sync now                     # Sync all libraries
  ebla sync now --library e299620b  # Sync specific library

Daemon

ebla daemon start

Start the sync daemon (runs in foreground by default).

ebla daemon start [flags]

Flags:
  --background   Run in background (daemonize)
  --log-level    Set log level (debug, info, warn, error)

Examples:
  ebla daemon start                     # Run in foreground
  ebla daemon start --background        # Run as background process
  ebla daemon start --log-level debug   # Verbose logging

ebla daemon status

Check daemon status.

ebla daemon status

Output (running):
  Status: running
  PID: 12345
  Uptime: 2h 15m
  Libraries syncing: 3
  WebSocket: connected
  P2P: enabled (2 peers)

Output (stopped):
  Status: not running

ebla daemon stop

Stop the background daemon.

ebla daemon stop

Stopping daemon (PID 12345)...
Daemon stopped.

Status

ebla status

Show overall sync status.

ebla status [flags]

Flags:
  --json   Output as JSON

Examples:
  ebla status

Output:
  Sync Status
  ===========

  Server: https://files.example.com (connected)
  User: user@example.com

  Libraries:
    My Documents (e299620b)
      Status: up-to-date
      Local path: /home/user/Documents
      Files: 156
      Size: 23.4 MB
      Last sync: 2 minutes ago

    Photos (f3a8b21c)
      Status: syncing (45%)
      Local path: /home/user/Photos
      Files: 2,341
      Size: 8.2 GB
      Uploading: IMG_1234.jpg

  Daemon: running (PID 12345)
  P2P: enabled (2 peers discovered)

Config

ebla config show

Show all configuration values.

ebla config show

Output:
  [server]
  url = "https://files.example.com"

  [daemon]
  poll_interval = "5m"
  log_level = "info"

  [p2p]
  enabled = true
  lan_only = false

ebla config get

Get a specific configuration value.

ebla config get <key>

Examples:
  ebla config get server.url
  ebla config get p2p.enabled
  ebla config get daemon.poll_interval

ebla config set

Set a configuration value.

ebla config set <key> <value>

Examples:
  ebla config set daemon.poll_interval 10m
  ebla config set p2p.enabled true
  ebla config set p2p.lan_only true

P2P

ebla p2p status

Show P2P status and discovered peers.

ebla p2p status

Output:
  P2P Status: enabled

  NAT Type: Port Restricted Cone
  Public Address: 203.0.113.45:54321

  Discovered Peers:
    PEER ID       DEVICE         IP              LIBRARIES  STATUS
    peer_abc123   MacBook Pro    192.168.1.10    3          online (LAN)
    peer_def456   Linux Server   192.168.1.20    2          online (LAN)
    peer_ghi789   iPhone         203.0.113.80    1          online (NAT)

ebla p2p enable

Enable P2P transfers.

ebla p2p enable

P2P enabled. Restart daemon for changes to take effect.

ebla p2p disable

Disable P2P transfers.

ebla p2p disable

P2P disabled. All transfers will go through server.

ebla search query

Search files using hybrid (keyword + semantic) search.

ebla search query <library-id> <query> [flags]

Flags:
  --limit <n>   Maximum results (default: 10)
  --mode        Search mode: hybrid, semantic, keyword

Examples:
  ebla search query e299620b "quarterly revenue"
  ebla search query e299620b "security audit" --limit 20
  ebla search query e299620b "budget" --mode keyword

ebla search ask

Ask a question with AI-powered answer and citations.

ebla search ask <library-id> <question>

Examples:
  ebla search ask e299620b "What was our Q1 revenue growth?"
  ebla search ask e299620b "Summarize the project status"

Output:
  Question: What was our Q1 revenue growth?

  Answer:
  Based on the Q1 2026 Report, quarterly revenue increased by 15%
  year-over-year, exceeding projections by 8%.

  Sources:
    [1] documents/Q1-2026-Report.pdf (page 5)
    [2] documents/financial-summary.md (section: Revenue)

ebla search index

Trigger library indexing.

ebla search index <library-id> [flags]

Flags:
  --force   Force re-index all files

Examples:
  ebla search index e299620b
  ebla search index e299620b --force  # Re-index everything

ebla search status

Check index status.

ebla search status <library-id>

Output:
  Library: My Documents
  Indexed: 152/156 files (97%)
  Chunks: 2,341
  Last indexed: 2 minutes ago
  Status: up-to-date

Teams

ebla team list

List teams you belong to.

ebla team list

Output:
  ID           NAME          ROLE     MEMBERS  LIBRARIES
  team_abc123  Engineering   owner    5        3
  team_def456  Marketing     member   12       7

ebla team create

Create a new team.

ebla team create <name> [flags]

Flags:
  --description <text>   Team description

Examples:
  ebla team create "Engineering"
  ebla team create "Sales" --description "Sales team files"

ebla team get

Show team details.

ebla team get <team-id>

Output:
  Name: Engineering
  ID: team_abc123
  Description: Core engineering team
  Owner: admin@example.com
  Members: 5
  Libraries: 3
  Created: 2026-01-01

ebla team invite

Invite a user to a team.

ebla team invite <team-id> <email> [flags]

Flags:
  --role <role>   Role: admin, member, viewer (default: member)

Examples:
  ebla team invite team_abc123 alice@example.com
  ebla team invite team_abc123 bob@example.com --role admin

ebla team members list

List team members.

ebla team members list <team-id>

Output:
  USER                 ROLE      JOINED
  admin@example.com    owner     2026-01-01
  alice@example.com    admin     2026-01-15
  bob@example.com      member    2026-01-20

ebla team members role

Change a member's role.

ebla team members role <team-id> <user-email> --role <role>

Examples:
  ebla team members role team_abc123 alice@example.com --role admin
  ebla team members role team_abc123 bob@example.com --role viewer

ebla team audit

View team audit log.

ebla team audit <team-id> [flags]

Flags:
  --since <time>   Filter by time (24h, 7d, 2026-01-01)
  --user <email>   Filter by user
  --limit <n>      Maximum entries

Examples:
  ebla team audit team_abc123
  ebla team audit team_abc123 --since 7d
  ebla team audit team_abc123 --user alice@example.com

Version Control

ebla log

Show commit history.

ebla log [flags]

Flags:
  --oneline      Compact one-line format
  -n <count>     Limit number of commits
  --local        Show only local commits
  --server       Show only server commits

Examples:
  ebla log
  ebla log --oneline
  ebla log -n 20
  ebla log --local

Output:
  commit abc123 (HEAD)
  Author: user@example.com (MacBook Pro)
  Date:   2026-01-15 10:30:00

      Added quarterly reports

      A documents/Q1-2026.pdf
      M documents/summary.md

ebla show

Show commit details.

ebla show <commit> [flags]

Flags:
  --stat   Show file statistics only

Examples:
  ebla show abc123
  ebla show abc123 --stat

Output:
  commit abc123
  Author: user@example.com (MacBook Pro)
  Date:   2026-01-15 10:30:00

  Added quarterly reports

  Files:
    A documents/Q1-2026.pdf      5.2 MB (3 blocks)
    M documents/summary.md       12 KB  (1 block)

  Total: 2 files, 5.2 MB

ebla diff

Compare changes.

ebla diff [<commit>] [flags]

Flags:
  --stat        Show summary statistics
  --name-only   List changed files only

Examples:
  ebla diff                    # Working tree vs HEAD
  ebla diff abc123             # Specific commit vs parent
  ebla diff xyz789..abc123     # Between two commits
  ebla diff --stat

Output:
  M documents/summary.md

  --- a/documents/summary.md
  +++ b/documents/summary.md
  @@ -5,3 +5,5 @@
   ## Q1 Summary

  +Revenue increased 15% YoY.
  +
   See detailed report.

ebla checkout

Restore files from a commit.

ebla checkout <commit> <path> [flags]

Flags:
  -o, --output <path>   Restore to different location
  --force               Overwrite dirty file
  --dry-run             Preview without writing

Examples:
  ebla checkout abc123 documents/report.pdf
  ebla checkout abc123 documents/report.pdf -o /tmp/old-report.pdf
  ebla checkout abc123 documents/ --dry-run   # Restore entire folder (preview)

Global Flags

These flags work with all commands:

--config <path>   Path to config file (default: ~/.ebla/config.toml)
--server <url>    Override server URL
--help, -h        Show help for command
--version, -v     Show version

Examples:
  ebla --config /etc/ebla/client.toml library list
  ebla --server https://alt.example.com status