π The official CLI tool for Far Beyond development - streamlining Horizon plugin development and repository management.
- π§ Horizon Plugin Development: Create, build, and manage Horizon game server plugins
- π¦ Repository Management: Easy cloning and management of Far-Beyond-Dev repositories
- π― Cross-Platform: Works on Windows, macOS, and Linux
- β‘ Fast & Reliable: Built with Rust for performance and safety
git clone https://github.com/Far-Beyond-Dev/fb-cli.git
cd fb-cli
cargo build --releaseThe binary will be available at target/release/fbcli (or fbcli.exe on Windows).
Create a new Horizon plugin from the official template:
fbcli horizon plugin new my_awesome_pluginOptions:
--path, -p <PATH>: Specify target directory (defaults to current directory)
This command will:
- Clone the
Horizon-Plugin-Samplerepository - Update the
Cargo.tomlwith your plugin name - Generate a basic plugin template with the correct structure
- Clean up unnecessary files
Build your plugin and optionally copy it to your Horizon server:
fbcli horizon plugin buildOptions:
--horizon-path <PATH>: Path to your Horizon server (defaults to../Horizon)--no-copy: Skip copying the built plugin to Horizon plugins directory
This command will:
- Build your plugin in release mode
- Locate the compiled library (
.dll,.so, or.dylib) - Copy it to
<horizon-path>/plugins/directory
List all repositories in the Far-Beyond-Dev organization:
fbcli repo listOptions:
--public-only: Show only public repositories
Clone a repository from the Far-Beyond-Dev organization:
fbcli repo clone Horizon-ServerOptions:
--path, -p <PATH>: Target directory (defaults to repository name)--ssh: Use SSH instead of HTTPS for cloning
Update all Far-Beyond repositories in the current directory:
fbcli repo updateOptions:
--dry-run: Show what would be updated without making changes
Check the status of all Far-Beyond repositories in the current directory:
fbcli repo statusShows:
- Current branch
- Working directory status (clean/dirty)
- Commits ahead/behind remote
Here's a typical workflow for developing a Horizon plugin:
fbcli horizon plugin new my_game_mode
cd my_game_modeEdit src/lib.rs to implement your plugin logic:
use async_trait::async_trait;
use horizon_event_system::{
create_simple_plugin, register_handlers, EventSystem, LogLevel,
PluginError, ServerContext, SimplePlugin,
};
use std::sync::Arc;
use tracing::info;
pub struct MyGameModePlugin {
name: String,
}
impl MyGameModePlugin {
pub fn new() -> Self {
Self {
name: "my_game_mode".to_string(),
}
}
}
#[async_trait]
impl SimplePlugin for MyGameModePlugin {
fn name(&self) -> &str {
&self.name
}
fn version(&self) -> &str {
"1.0.0"
}
async fn register_handlers(&mut self, events: Arc<EventSystem>) -> Result<(), PluginError> {
register_handlers!(events; core {
"player_connected" => |event: serde_json::Value| {
info!("Player joined the game: {:?}", event);
Ok(())
}
})?;
Ok(())
}
// ... implement other required methods
}
create_simple_plugin!(MyGameModePlugin);fbcli horizon plugin buildYour plugin will be compiled and copied to your Horizon server's plugins directory.
my_plugin/
βββ Cargo.toml # Package configuration
βββ src/
βββ lib.rs # Plugin implementation
The generated Cargo.toml will look like:
[package]
name = "plugin_my_plugin"
version = "0.1.0"
edition = "2021"
[lib]
crate-type = ["cdylib"]
[dependencies]
horizon_event_system = "0.1" # Event system from crates.io
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
tokio = { version = "1.0", features = ["full"] }
async-trait = "0.1"
tracing = { version = "0.1", features = ["log"] }- Horizon Server:
../Horizon(relative to plugin directory) - Plugins Directory:
<horizon-path>/plugins/
FBCLI_HORIZON_PATH: Override default Horizon server pathFBCLI_GITHUB_TOKEN: GitHub personal access token for private repositories
Git not found
Error: Git is not installed or not available in PATH
Solution: Install Git and ensure it's in your system PATH.
Cargo not found
Error: Cargo is not installed or not available in PATH
Solution: Install Rust which includes Cargo.
Plugin build fails
Error: Cargo build failed
Solution: Check your plugin code for compilation errors. Ensure all dependencies are correctly specified in Cargo.toml.
Cannot copy to Horizon plugins directory
Error: Failed to copy plugin to <path>
Solution: Ensure the Horizon path exists and you have write permissions. Use --horizon-path to specify the correct path.
Run any command with RUST_LOG=debug for verbose output:
RUST_LOG=debug fbcli horizon plugin buildThis project is licensed under the MIT License - see the LICENSE file for details.