CLI Tool Guide¶
The ZeroIPC CLI tool provides a powerful interface for inspecting, debugging, and monitoring shared memory segments. With support for all 16 data structures and a virtual filesystem interface, it's an essential tool for development and operations.
Overview¶
The zeroipc tool offers two modes of operation:
- Command-line mode: Execute single commands and exit
- REPL mode: Interactive exploration with virtual filesystem navigation
Key Features¶
- Structure Inspection: View contents of all 16 data structure types
- Virtual Filesystem: Navigate shared memory like a directory structure
- Real-time Monitoring: Watch structures update in real-time
- Cross-Language Debugging: Inspect structures created by any language
- JSON Output: Machine-readable output for scripting
Quick Examples¶
List All Shared Memory¶
Output:
Show Segment Details¶
Inspect an Array¶
Interactive REPL Mode¶
Installation¶
The CLI tool is built with the C++ library:
cd cpp
cmake -B build .
cmake --build build
# The tool is at build/tools/zeroipc
./build/tools/zeroipc --help
# Optional: install system-wide
sudo cp build/tools/zeroipc /usr/local/bin/
Documentation Sections¶
- Basic Commands - Core CLI commands and usage
- Virtual Filesystem - Navigate shared memory interactively
- Structure Inspection - Detailed structure viewing
- Monitoring and Debugging - Real-time monitoring and troubleshooting
Supported Structures¶
The CLI tool supports all ZeroIPC data structures:
Traditional Structures¶
- Array - View elements with indices
- Queue - Show queue state and contents
- Stack - Display stack contents
- Ring - Ring buffer inspection
- Map - Key-value pair listing
- Set - Set member listing
- Pool - Pool allocation state
- Table - Metadata table inspection
Synchronization Primitives¶
- Semaphore - Current count and waiters
- Barrier - Participants and state
- Latch - Countdown state
Codata Structures¶
- Future - Value and state
- Lazy - Computed state
- Stream - Stream contents
- Channel - Channel state and buffer
Common Workflows¶
Development Workflow¶
# 1. Run your application
./myapp &
# 2. Inspect what it created
zeroipc list
zeroipc show /myapp_data
# 3. Check specific structures
zeroipc array /myapp_data sensor_readings
zeroipc queue /myapp_data task_queue
# 4. Monitor in real-time
zeroipc monitor /myapp_data sensor_readings
Debugging Workflow¶
# 1. Interactive exploration
zeroipc -r
# 2. Navigate to segment
zeroipc> cd /myapp_data
# 3. List structures
/myapp_data> ls
# 4. Inspect suspicious structure
/myapp_data> cat problematic_array
# 5. Check raw memory if needed
/myapp_data> dump --offset 1024 --size 256
Next Steps¶
- Basic Commands - Learn all available commands
- Virtual Filesystem - Master interactive navigation
- Structure Inspection - Deep dive into structure viewing
- Monitoring - Real-time monitoring techniques