Expand description
Plugin system for IPFRS CLI
This module provides a plugin system that allows users to extend the IPFRS CLI with custom commands. Plugins can be written in any language and interfaced via a simple executable-based protocol.
§Plugin Discovery
Plugins are discovered in the following locations (in order):
~/.ipfrs/plugins/- User plugins/usr/local/lib/ipfrs/plugins/- System-wide plugins (Unix)$IPFRS_PLUGIN_PATH- Custom plugin directories (colon-separated)
§Plugin Protocol
Plugins are executables that follow this naming convention:
ipfrs-plugin-<name>for the executable
When invoked, plugins receive:
- Arguments passed after the plugin name
- Environment variables:
IPFRS_API_URL- Daemon API endpointIPFRS_DATA_DIR- Repository data directoryIPFRS_CONFIG- Config file path
§Examples
use ipfrs_cli::plugin::PluginManager;
// Discover all available plugins
let mut manager = PluginManager::new();
let plugins = manager.discover_plugins();
for plugin in plugins {
println!("Found plugin: {}", plugin.name());
}§Creating a Plugin
Create an executable named ipfrs-plugin-hello:
#!/bin/bash
# ipfrs-plugin-hello
echo "Hello from plugin!"
echo "API URL: $IPFRS_API_URL"Make it executable and place in ~/.ipfrs/plugins/:
chmod +x ipfrs-plugin-hello
mv ipfrs-plugin-hello ~/.ipfrs/plugins/Then use it:
ipfrs plugin helloStructs§
- Plugin
- Represents a single plugin
- Plugin
Manager - Plugin manager for discovering and executing plugins