CLI Clients

Master the ph and mdb command-line tools to manage your people and infrastructure.

:::tip[Quick Install] Looking to get the Pharos Toolbelt set up in seconds? Check out our Automated Installation Guide. :::

While the Pharos Web Console serves as the primary Agent-Native Control Plane and Human/AI interface, the specialized CLI clients remain the high-performance heart of the engineer’s daily terminal workflow. These tools are designed for speed, scriptability, and seamless integration into your daily DevSecOps pipelines.

Meet the Clients

Pharos provides two specialized clients to handle different types of data, both utilizing the high-performance RFC 2378 protocol.

ph: The People Registry

The ph tool is optimized for human contact management. Use it to quickly find colleagues, team members, or external partners.

  • Primary Use Case: Directory lookups, contact management, and team attribution.
  • Authentication: Read operations are open; updates require an authorized SSH key.

mdb: The Machine Database

The mdb tool is your infrastructure’s source of truth. It manages everything from physical servers and LXC containers to cloud instances and network equipment.

  • Primary Use Case: Infrastructure inventory, automated provisioning, and service discovery.
  • Authentication: Read operations are open; updates require an authorized SSH key.

Basic Usage

Both clients share a similar syntax. If you don’t specify a command, Pharos assumes you are performing a query.

Querying Data

To find a record, simply provide the field you are searching for.

# Search for a person by name
ph name="John Doe"

# Search for a machine by hostname
mdb hostname="srv-web-01"

# Search by IP address
mdb ip="192.168.1.50"

Adding Records

Adding records requires authorized write access. Pharos will automatically handle the SSH challenge-response if your key is enrolled.

# Add a new person
ph add name="Jane Smith" email="jane@lab.local" type="person"

# Add a new machine
mdb add hostname="db-01" ip="10.0.0.5" type="machine" status="up"

Modifying & Deleting

Keep your registry accurate with the change and delete commands.

# Update a machine's status
mdb change hostname="db-01" status="maintenance"

# Remove a decommissioned node
mdb delete hostname="old-server"

Advanced Automation

The true power of the Pharos CLIs lies in their scriptability. Since they are lightweight binaries with zero dependencies, they can be deployed anywhere—from your local workstation to a minimal CI/CD runner.

Environment Variables

Configure your client behavior without passing repetitive flags.

VariableDescriptionDefault
PHAROS_HOSTThe IP or hostname of your Pharos server.127.0.0.1
PHAROS_PORTThe port the server is listening on.2378
SSH_KEY_PATHPath to your private SSH key for authentication.~/.ssh/id_ed25519

Pipe-Friendly Output

Pharos clients output clean, structured text that is easy to parse with standard Unix tools like grep, awk, or jq.

# Find the IP of a database and use it in a script
DB_IP=$(mdb hostname="prod-db" | grep "ip:" | awk '{print $2}')
ssh "admin@$DB_IP"

Next Steps

Now that you’ve mastered the basic clients, see how you can automate your network discovery with Pharos-Scan.