Skip to content
Arxo Arxo

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.

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:

  1. FFI — Three C-compatible functions: get version, run analysis (path + config JSON → result JSON), and free returned strings.
  2. 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.

The engine is distributed as:

  • Dynamic librarylibarxo_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.

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.

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)

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

┌─────────────────────────────────────────────────────┐
│ 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 │
└───────────────────────────────────────────────────────┘

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

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.

  1. Getting Started — Install and run your first analysis
  2. Rust API or FFI API — Use the four operations (load, load_from_path, version, analyze) and parse the JSON result
  3. Configuration — Customize presets, excludes, policy, and report options
  4. Examples — Sample code and CI patterns
  5. Troubleshooting — Common issues and fixes