Skip to main content

ROSForge

AI-driven ROS1 to ROS2 migration CLI tool.

CI PyPI License

Why ROSForge?

ROS1 reached end-of-life in May 2025. Migrating a production codebase to ROS2 by hand is tedious and error-prone: API namespaces changed, CMakeLists.txt rules are different, launch files moved to Python, and hundreds of ros:: calls need one-by-one replacement. ROSForge automates this work by combining a static knowledge base of known API mappings with an AI backend that handles the cases rules alone cannot cover. The result is a complete, confidence-scored migration in minutes rather than days.

Features

  • Full pipeline — analyze, transform, validate, and report in a single command
  • BYOM (Bring Your Own Model) — Claude, Gemini, and OpenAI backends; CLI or API mode
  • Auto-fix loop — runs colcon build, feeds errors back to the AI, retries up to N times
  • Interactive mode — per-file diff review; accept or skip each transformed file
  • Batch workspace migration — migrate an entire catkin workspace in one pass
  • Custom transformation rules — override or extend mappings with a YAML file
  • Static knowledge base — built-in C++/Python API mappings, CMake rules, and launch conversion patterns
  • Cost estimation — token and USD estimates shown before any API calls are made
  • Confidence scoring — every output file is rated HIGH / MEDIUM / LOW; low-confidence files are flagged for manual review

Quick Start

# Install
pip install rosforge

# Set your preferred AI backend (stored in ~/.config/rosforge/config.toml)
rosforge config set engine.name gemini
rosforge config set engine.mode cli

# Migrate a single ROS1 package
rosforge migrate ./my_ros1_package -o ./my_ros1_package_ros2

The migrated package and a migration_report.md are written to the output directory.

Commands

Command Description
rosforge migrate <path> Migrate a single ROS1 package to ROS2
rosforge migrate-workspace <path> Migrate all packages in a catkin workspace
rosforge analyze <path> Analyze a package and report migration complexity without transforming
rosforge config set <key> <value> Set a configuration value and persist it
rosforge config get <key> Get a single configuration value
rosforge config list Print all current configuration values as JSON
rosforge config reset Reset configuration to defaults
rosforge config path Show the path to the configuration file
rosforge status Show the status of an in-progress or completed migration

AI Engine Configuration

ROSForge supports three AI backends. Each can run in cli mode (calls a locally installed CLI tool, no API key required) or api mode (calls the provider's REST API directly, requires an API key).

Claude

# CLI mode — requires the Anthropic Claude CLI installed and authenticated
rosforge config set engine.name claude
rosforge config set engine.mode cli

# API mode — requires ANTHROPIC_API_KEY
pip install "rosforge[claude]"
rosforge config set engine.name claude
rosforge config set engine.mode api
export ANTHROPIC_API_KEY=sk-ant-...

Gemini

# CLI mode — requires the Google Gemini CLI installed and authenticated
rosforge config set engine.name gemini
rosforge config set engine.mode cli

# API mode — requires GOOGLE_API_KEY
pip install "rosforge[gemini]"
rosforge config set engine.name gemini
rosforge config set engine.mode api
export GOOGLE_API_KEY=AIza...

OpenAI

# API mode — requires OPENAI_API_KEY
pip install "rosforge[openai]"
rosforge config set engine.name openai
rosforge config set engine.mode api
export OPENAI_API_KEY=sk-...

Install all backends at once:

pip install "rosforge[all]"

Advanced Usage

Interactive review

Review each transformed file before it is written:

rosforge migrate ./my_package --interactive

Press a to accept, s to skip, q to quit and accept all remaining files.

Auto-fix loop

Build the output with colcon build after migration, feed any errors back to the AI, and retry:

rosforge migrate ./my_package --max-fix-attempts 3

Custom rules

Supply additional or overriding transformation mappings:

rosforge migrate ./my_package --rules custom_rules.yaml

Skip confirmation

Skip the cost-estimate confirmation prompt (useful in CI):

rosforge migrate ./my_package --yes

Target ROS2 distribution

The default target is humble. To target a different distribution:

rosforge migrate ./my_package --distro jazzy

Workspace migration

rosforge migrate-workspace ./catkin_ws -o ./ros2_ws --engine gemini --yes

Analyze without migrating

# Rich table output in the terminal
rosforge analyze ./my_package

# Machine-readable JSON
rosforge analyze ./my_package --json

# Save JSON report to file
rosforge analyze ./my_package -o analysis.json

CI/CD Integration

ROSForge provides ready-made templates for GitHub Actions and GitLab CI so you can automatically verify ROS1→ROS2 migration in your pipeline.

GitHub Actions

Use the reusable composite action:

# .github/workflows/rosforge.yml
name: ROSForge Migration Check
on: [push, pull_request]

jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: Rlin1027/ROSForge/ci-templates/github@main
        with:
          source: ./src/my_ros1_package
          mode: analyze            # "analyze" or "migrate"

For a full migration dry-run with auto-fix:

      - uses: Rlin1027/ROSForge/ci-templates/github@main
        with:
          source: ./src/my_ros1_package
          mode: migrate
          engine: claude
          engine-mode: api
          max-fix-attempts: "2"
          fail-on-warnings: "true"
        env:
          ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}

See ci-templates/github/example-workflow.yml for a complete example.

GitLab CI

Include the remote template and extend the hidden jobs:

# .gitlab-ci.yml
include:
  - remote: "https://raw.githubusercontent.com/Rlin1027/ROSForge/main/ci-templates/gitlab/.gitlab-ci-rosforge.yml"

variables:
  ROSFORGE_SOURCE: ./src/my_ros1_package
  ROSFORGE_ENGINE: claude
  ROSFORGE_TARGET_DISTRO: humble

rosforge-analyze:
  extends: .rosforge-analyze

rosforge-migrate:
  extends: .rosforge-migrate
  variables:
    ROSFORGE_ENGINE_MODE: api
    ROSFORGE_MAX_FIX_ATTEMPTS: "2"

Exit Codes

Code Meaning
0 Success
1 Failure
2 Completed with warnings (set fail-on-warnings to treat as failure)

Custom Rules

Create a YAML file to add or override transformation mappings:

# custom_rules.yaml
version: 1

api_mappings:
  cpp:
    "ros::NodeHandle": "rclcpp::Node"
    "ros::Publisher": "rclcpp::Publisher"
  python:
    "rospy.init_node": "rclpy.init"
    "rospy.Publisher": "rclpy.create_publisher"

package_mappings:
  "roscpp": "rclcpp"
  "rospy": "rclpy"

cmake_mappings:
  "find_package(catkin REQUIRED": "find_package(ament_cmake REQUIRED"

Pass the file with --rules custom_rules.yaml. Custom mappings take precedence over the built-in knowledge base.

Development

git clone https://github.com/Rlin1027/ROSForge.git
cd ROSForge
pip install -e ".[dev,all]"
pytest tests/

Lint and type-check:

ruff check src/
mypy src/

Contributing

Contributions are welcome. Please open an issue before submitting a pull request for significant changes. See CONTRIBUTING.md for guidelines.

License

Apache 2.0 — see LICENSE for details.

Metadata

Release files for rosforge 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rosforge 0.2.0
File Size Uploaded Provenance Actions
rosforge-0.2.0.tar.gz 133.3 kB With provenance Details for rosforge-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for rosforge 0.2.0
File Interpreter ABI Platform Actions
rosforge-0.2.0-py3-none-any.whl Python 3 none any Details for rosforge-0.2.0-py3-none-any.whl

Total release size: 245.4 kB

Release files / rosforge-0.2.0.tar.gz

Download URL rosforge-0.2.0.tar.gz
Size 133.3 kB
Tags Source
SHA-256 checksum
How to use checksums
93930905f4c5627566ba9e2f991234f1f1896ba6b9ef4e44fa7d637615f27086
BLAKE2b-256 checksum
How to use checksums
b51c0eb7620f995e30fff4d101477d6cf0122b6ac48bdccf67b60a6606aaaf9d
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2026.

Transparency log

Release files / rosforge-0.2.0-py3-none-any.whl

Download URL rosforge-0.2.0-py3-none-any.whl
Size 112.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bea7df137c9efa6aeb884324e8cb3bd2a5f01f0b8d0784558ef30cdbce2e0f0d
BLAKE2b-256 checksum
How to use checksums
190aa933973df6441e5090666ccf36ee1069935425143a9f104e5c0963df3449
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.7

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2026.

Transparency log

Security for rosforge 0.2.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for rosforge-0.2.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Feb 24, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page