# ros2ai — ROS 2 CLI Extension with LLMs > ros2ai is a ROS 2 CLI extension that answers ros2 questions and runs common tasks using OpenAI-compatible APIs or Ollama (local). ## Install Save as a script file and run: ## Quick Use ```bash # Docker quick start (OpenAI API key optional if using Ollama): docker run -it --rm --net=host -e OPENAI_API_KEY=$OPENAI_API_KEY tomoyafujita/ros2ai:rolling # Inside container: try a status check ros2 ai status -v ``` ## Intro ros2ai is a ROS 2 CLI extension that answers ros2 questions and runs common tasks using OpenAI-compatible APIs or Ollama (local). **Best for:** ROS 2 learners who want a command-first assistant for ros2cli **Works with:** ROS 2, Docker (optional), OpenAI API or Ollama (OpenAI-compatible endpoint) **Setup time:** 8-20 minutes ### Key facts (verified) - GitHub: 319 stars · 23 forks · pushed 2026-04-13. - License: Apache-2.0 · owner avatar + repo URL verified via GitHub API. - README-verified entrypoint: `pip install openai ollama validators --break-system-packages --ignore-installed`. ## Main - Use it as a ros2cli copilot: ask questions, generate commands, and run common ROS 2 tasks without switching contexts. - Prefer Ollama for local-first experimentation: set `OPENAI_ENDPOINT` to the local OpenAI-compatible endpoint and unset the API key. - Validate configuration with `ros2 ai status -v` before relying on it in tutorials or live robot sessions. ### Source-backed notes - README calls ros2ai a ROS 2 CLI extension that works with OpenAI and Ollama via the OpenAI Python API. - README lists supported ROS distributions (Rolling, Jazzy, Humble, etc.) and provides an apt-based install for some distros. - README includes a Docker quickstart and documents env vars like `OPENAI_API_KEY`, `OPENAI_ENDPOINT`, and model selection. ### FAQ - **Do I need OpenAI?**: No — README notes Ollama works via an OpenAI-compatible endpoint; the API key can be unset. - **Is it production-safe?**: Treat it as an assistant; validate commands before running on real hardware. - **How do I pick a model?**: README documents `OPENAI_MODEL_NAME`; choose a smaller local model first for fast iteration. ## Source & Thanks > Source: https://github.com/fujitatomoya/ros2ai > License: Apache-2.0 > GitHub stars: 319 · forks: 23 --- ## Quick Use ```bash # Docker quick start (OpenAI API key optional if using Ollama): docker run -it --rm --net=host -e OPENAI_API_KEY=$OPENAI_API_KEY tomoyafujita/ros2ai:rolling # Inside container: try a status check ros2 ai status -v ``` ## Intro ros2ai 是 ROS 2 的命令行增强:用 OpenAI 兼容 API 或 Ollama(本地)回答 ros2 问题、生成命令并执行常见操作。支持 Rolling/Jazzy/Humble 等发行版,README 提供 apt 包与 Docker 镜像快速启动。 **Best for:** 想用“命令行问答”快速学 ROS 2/ros2cli 的新手与学生 **Works with:** ROS 2;Docker(可选);OpenAI API 或 Ollama(OpenAI 兼容端点) **Setup time:** 8-20 minutes ### Key facts (verified) - GitHub:319 stars · 23 forks;最近更新 2026-04-13。 - 许可证:Apache-2.0;作者头像与仓库链接均已通过 GitHub API 复核。 - README 中核对过的入口命令:`pip install openai ollama validators --break-system-packages --ignore-installed`。 ## Main - 把它当作 ros2cli 的副驾驶:直接在终端提问、生成命令并执行常见 ROS 2 操作,减少来回查文档。 - 想本地优先就用 Ollama:把 `OPENAI_ENDPOINT` 指到本地 OpenAI 兼容地址,并取消 API key。 - 在真正用到教程/机器人现场前,先用 `ros2 ai status -v` 验证配置是否正常。 ### Source-backed notes - README 将 ros2ai 定位为 ROS 2 CLI 扩展,并说明通过 OpenAI Python API 同时支持 OpenAI 与 Ollama。 - README 列出支持的 ROS 发行版,并提供部分发行版的 apt 安装方式。 - README 提供 Docker 快速启动,并说明 `OPENAI_API_KEY`、`OPENAI_ENDPOINT` 等环境变量配置。 ### FAQ - **必须用 OpenAI 吗?**:不必。README 提到可通过 OpenAI 兼容端点接入 Ollama,本地时可不设 API key。 - **适合直接上生产吗?**:把它当作助手:在真实硬件上执行前先人工校验命令与参数。 - **模型怎么选?**:README 有 `OPENAI_MODEL_NAME`;建议先用小一些的本地模型快速迭代。 ## Source & Thanks > Source: https://github.com/fujitatomoya/ros2ai > License: Apache-2.0 > GitHub stars: 319 · forks: 23 --- Source: https://tokrepo.com/en/workflows/ros2ai-ros-2-cli-extension-with-llms Author: Script Depot