# Tapioca

> The swiss army knife of RBI generation

Source: https://talira.ai/catalog/tapioca-mqtavm7c
Every listing: https://talira.ai/catalog.md

- Kind: Open source
- Types: Command-line tool, Library
- Categories: [developer tools / type checking / rbi generation](https://talira.ai/categories/developer-tools/type-checking/rbi-generation), [languages / ruby](https://talira.ai/categories/languages/ruby)
- Platforms: linux, macos, windows
- Licence: MIT
- Pricing: Free and open source
- Free tier: yes
- Self-hostable: yes
- Plugins: yes
- Backed by: [Shopify](https://talira.ai/orgs/shopify.md)

Tapioca makes [Sorbet](https://talira.ai/catalog/sorbet-7qt3f670.md) usable in a real Ruby app by generating RBI files for what Sorbet can't see on its own. `tapioca gem` writes RBIs for every gem in the Gemfile, importing signatures and documentation from their source, and `tapioca annotations` pulls hand-written ones from the community rbi-central repository. `tapioca dsl` loads the app and writes the methods that meta-programming creates (Rails models' columns, associations and scopes, Protobuf, SmartProperties and more), with an interface for writing your own DSL compilers. It also finds unneeded shims, rewrites RBS comments into Sorbet signatures, and checks in CI that the RBIs are up to date. It's pre-1.0, so its interface may still change.

## Links

- GitHub: https://github.com/Shopify/tapioca

## Problems it solves

- Sorbet says every method from my gems doesn't exist
- get type signatures for third-party gems so the type checker stops complaining
- Sorbet can't see the column methods Rails generates on my models
- the methods ActiveRecord adds at runtime need type definitions
- fail CI when someone adds a gem or a column and forgets to regenerate the type files
- write type stubs for my own DSL that defines methods with metaprogramming
- start adding gradual typing to an existing Rails app
- share hand-written type signatures for a popular gem with other teams
- use RBS comment syntax but check it with Sorbet
- find which constants Sorbet still can't resolve in my codebase

## Features

- RBIs for every gem in the Gemfile
- signatures and docs imported from gem source
- community annotations from rbi-central
- DSL RBIs for Rails, Protobuf, SmartProperties and more
- custom DSL compilers and gem extensions
- unneeded shim detection
- RBS comment rewriting
- CI checks that RBIs are in sync
- tapioca todo for unresolved constants
- editor integration via Ruby LSP

## Capabilities

- Has a command line tool: plan not known
- Takes plugins: plan not known

## Trust

Overall: 0.67 out of 1.
Signals: maintenance 1.00, adoption 0.59, momentum 0.31, community 0.89, backing 0.30, extensibility 0.40.

- last commit 10 days ago
- 102 commits in the last 90 days
- latest release v0.20.0 2 months ago
- 877 GitHub stars
- 163 contributors
- backed by Shopify
- has a plugin system

## Related

- Works with [Sorbet](https://talira.ai/catalog/sorbet-7qt3f670.md)

## Alternatives

- [Sorbet for Rails](https://talira.ai/catalog/sorbet-for-rails-gqfgx58c.md): A Sorbet build for Rails apps that type-checks specs, factories, and ERB views
