Write your domain logic as Foobara commands and automatically get a Ruby or TypeScript SDK with no additional work! Easily integrate those commands with CLI, HTTP, MCP, AI agents, async job queues/schedulers... whatever integration you can think of. And also automatically be forward compatible with integrations that haven't even been thought of yet!
class Greet < Foobara::Command
inputs do
who :string, default: "World"
end
result :string
def execute
"Hello, #{who}!"
end
end
# using .run!
puts Greet.run!
puts Greet.run!(who: "Fumiko")
# using .run
outcome = Greet.run(who: "Barbara")
puts outcome.success? ? outcome.result : outcome.errors_hash
# using .new #run
command = Greet.new(who: "Basil")
outcome = command.run
puts outcome.success? ? outcome.result : outcome.errors_hash
command_connector = Foobara::CommandConnectors::ShCliConnector.new
command_connector.connect(CreateCapybara)
command_connector.connect(IncrementAge)
command_connector.connect(FindCapybara)
command_connector.run$ gem install foob
Successfully installed foob-0.1.0
1 gem installed
$ foob g
Usage: foob generate [GENERATOR_KEY] [GENERATOR_OPTIONS]
Available Generators:
command
domain
domain-mapper
local-files-crud-driver
mcp-connector
organization
rack-connector
redis-crud-driver
remote-imports
resque-connector
resque-scheduler-connector
ruby-project
sh-cli-connector
type
typescript-react-command-form
typescript-react-project
typescript-remote-commands
Engineers spend more time writing code relevant to the domain and less time on tech-stack or architecture decisions.
Commands form each Domain's public interface and have domain-specific names and implementation, helping with communication and understanding mental models across teams/orgs/systems.
Rearchitect systems without changing interfaces, reducing refactoring and testing requirements.
The champion of Foobara! Encapsulate high-level domain operations and expose them in new ways without refactoring your precious domain logic.
Define discoverable domain models and entities with persistence and transaction support.
Organize commands, types, and errors into Domains and Organizations.
Call commands in TypeScript or Ruby across system boundaries with the same interface as local Ruby commands.
Map concepts between domains to allow commands to focus on one domain.
Create custom data types that other tools and systems can discover.
Integrate commands via CLI, HTTP, MCP, async job queues, and whatever else pops up without changing your domain logic or refactoring your code.
Store entity records with a consistent interface across multiple data stores.
Generate various Foobara components, and even Ruby and TypeScript/React projects from foobara manifest metadata.