Using Arxo as a Library
Using Arxo as a Library
Section titled “Using Arxo as a Library”This guide covers how to use the arxo-engine closed-source library in your own applications. The engine is distributed as a pre-compiled shared library and is integrated through a small FFI (C-compatible) or the arxo-loader Rust crate. You run analysis by passing a project path and configuration and receive a JSON result with metrics and policy violations.
Overview
Section titled “Overview”The arxo-engine is the core analysis engine. It is closed-source and distributed as a dynamic library. The public API for library users is:
- FFI — Three C-compatible functions: get version, run analysis (path + config JSON → result JSON), and free returned strings.
- Rust (arxo-loader) — Load the engine, call version() and analyze(path, config, license); analyze returns an AnalysisResult with a single json string that you parse for results and violations.
Configuration uses the arxo-types crate (MIT): the Config schema and related types so you can build or deserialize config in Rust before calling the loader.
Distribution Model
Section titled “Distribution Model”The engine is distributed as:
- Dynamic library —
libarxo_engine.so(Linux),libarxo_engine.dylib(macOS),arxo_engine.dll(Windows) - Rust — The arxo-loader crate loads this library; you depend on arxo-loader and arxo-types (no direct dependency on the engine crate for closed-source use)
License: The engine may require a license for production use depending on your deployment. See Getting Started: License Setup.
Public API Surface (Library End User)
Section titled “Public API Surface (Library End User)”For integrating the closed-source engine into your app:
- arxo-loader (Rust): EngineLibrary (load, load_from_path, version, analyze), AnalysisResult (json), LoadError
- arxo-types: Config and related config types (data, report, policy, run_options, etc.) so you can build or deserialize the config you pass to analyze
- FFI: arxo_version, arxo_analyze(path, config_json, license), arxo_free_string — result is a single JSON string (or null on error)
The engine returns one JSON payload per run (metrics results and policy violations). You parse that JSON in your language; the exact shape is documented in the FFI and Rust API pages.
What You Can Do
Section titled “What You Can Do”With the library, you can:
✅ Load the engine from a path or from default locations (env, cache, CDN)
✅ Run full architecture analysis on a project path with a config (presets, excludes, policy, etc.)
✅ Get a JSON result containing metric results and policy violations
✅ Parse the JSON in your app to drive dashboards, CI gates, or custom tooling
✅ Integrate into CI/CD by calling analyze and failing on violations
✅ Reuse one engine instance for multiple analyses (path/config per call)
What You Cannot Do
Section titled “What You Cannot Do”The closed-source nature means:
❌ No access to internal algorithms or metric implementation
❌ No modification of parsing or analysis behavior
❌ No plugin registration or custom metrics from the library API (the engine has a fixed set of metrics and policies you configure)
❌ No direct graph handles from the FFI/loader — you get JSON only; structure is described in the API docs
❌ No redistribution of the engine binaries beyond the terms of your license
Architecture
Section titled “Architecture”┌─────────────────────────────────────────────────────┐│ Your Application ││ ┌────────────────────────────────────────────────┐ ││ │ Your Code (Rust / C / Go / etc.) │ ││ │ - Load engine (FFI or arxo-loader) │ ││ │ - Build config (arxo-types Config) │ ││ │ - Call analyze(path, config, license) │ ││ │ - Parse result JSON → results & violations │ ││ └────────────────┬───────────────────────────────┘ ││ │ ││ ┌────────────────▼───────────────────────────────┐ ││ │ arxo-loader (Rust) / FFI │ ││ │ - load, load_from_path, version, analyze │ ││ │ - AnalysisResult { json } │ ││ └────────────────┬───────────────────────────────┘ │└───────────────────┼─────────────────────────────────┘ │ Load & call┌───────────────────▼──────────────────────────────────┐│ arxo-engine (Proprietary, Closed Source) ││ - Parsing, graphs, metrics, policy evaluation ││ - Returns single JSON string │└───────────────────────────────────────────────────────┘Getting Started
Section titled “Getting Started”Choose your integration path:
- Rust API — Use arxo-loader and arxo-types (load, version, analyze → JSON)
- FFI API — Use the C-compatible symbols from any language (version, analyze, free string)
- Getting Started — Install and first run
License Requirements
Section titled “License Requirements”The arxo-engine may require a license for:
- Commercial use — Production deployments
- Large teams — e.g. more than 5 developers (see your license terms)
Free tier may be available for:
- Open source projects (verified)
- Personal / non-commercial use
- Evaluation
See Getting Started: License Setup for details.
Support
Section titled “Support”- Getting Started — Install and configure
- Rust API and FFI API — Exact API and result shape
- Configuration — Config schema and options
- Examples — Sample integrations
- Troubleshooting — Common issues
- Enterprise — Email support@arxo.dev for priority support
Next Steps
Section titled “Next Steps”- Getting Started — Install and run your first analysis
- Rust API or FFI API — Use the four operations (load, load_from_path, version, analyze) and parse the JSON result
- Configuration — Customize presets, excludes, policy, and report options
- Examples — Sample code and CI patterns
- Troubleshooting — Common issues and fixes