Skip to content

userosettadev/rosetta-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

59 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CI Go Report Card codecov Latest Git Tag

Getting Started

Rosetta is a service that automatically generates an OpenAPI specification from code.

Limitations

  • 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.

Installation

Install with Go

go install github.com/userosettadev/rosetta-cli@latest

macOS

Rosetta can be installed on macOS using Homebrew:

brew tap userosettadev/rosetta
brew install rosetta

Windows

For Windows, you can download the Rosetta executable from the releases page.

  1. Visit the releases page and download the latest version of Rosetta for Windows.
  2. Extract the downloaded archive.
  3. Move the rosetta.exe file to a directory in your system's PATH.

Verify Installation

After the installation is complete, you can verify it by running the following command (or executing the appropriate method for your installation):

rosetta --version

Setup

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.

Running Rosetta - Generating an OpenAPI Spec

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>

Example

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.

Docker

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