Rosetta is a service that automatically generates an OpenAPI specification from code.
- Supported Languages: Currently, Rosetta exclusively supports Go. However, we are actively working on expanding language support.
If you want to support another language, please let us know. - Number of Runs: The number of runs allowed is based on your account type.
- Project Size: The maximum project size is based on your account type.
go install github.com/userosettadev/rosetta-cli@latestRosetta can be installed on macOS using Homebrew:
brew tap userosettadev/rosetta
brew install rosettaFor Windows, you can download the Rosetta executable from the releases page.
- Visit the releases page and download the latest version of Rosetta for Windows.
- Extract the downloaded archive.
- Move the
rosetta.exefile to a directory in your system'sPATH.
After the installation is complete, you can verify it by running the following command (or executing the appropriate method for your installation):
rosetta --version
Before using Rosetta, you need to set the ROSETTA_API_KEY environment variable:
export ROSETTA_API_KEY=<your_api_key>
To get a key, signup to Rosetta.
To generate an OpenAPI specification from your code using Rosetta, you can use the gen command followed by the path to your code and the programming language.
rosetta gen /path/to/code -l <language>
To generate an OpenAPI specification from Go code located in the ./myapp directory, you would run:
rosetta gen ./myapp -l go
This command will analyze the Go code in the ./myapp directory and generate an OpenAPI specification based on the code.
Rosetta is also available as a Docker image:
docker run --rm -v $PWD:/app -w /app -e ROSETTA_API_KEY=$ROSETTA_API_KEY ghcr.io/userosettadev/rosetta-cli gen /path/to/code -l go