Console App to add / update a Swift ServiceStack Reference
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


swiftref is an OSX command-line utility for quickly Adding or Updating a Swift ServiceStack Reference for consuming Typed Web Services in a Swift v3 Xcode project.

Install swiftref

The easiest way to install swiftref is to download the OSX binary and save it to your /usr/local/bin:

 sudo curl > /usr/local/bin/swiftref
 sudo chmod +x /usr/local/bin/swiftref


Add a new ServiceStack Reference:

To Add a new ServiceStack Reference you just need to provide the Base URL for the remote ServiceStack Service you wish to generate Typed Swift DTOs for:

swiftref {BaseUrl}
swiftref {BaseUrl} {FileName}

If the FileName is not provided it's inferred from the host name of the remote URL, e.g:


Which will download the Typed Swift DTOs for and save them to techstacks.dtos.swift or if preferred, you can specify a different FileName to save to, e.g:

swiftref TechStacks

Which will save the Typed Swift DTOs to TechStacks.dtos.swift.

swiftref also downloads ServiceStack's Swift Client and saves it to JsonServiceClient.swift which together with the Server DTOs contains all the dependencies required to consume Typed Web Services in Swift.

Update an existing ServiceStack Reference:

To Update an existing ServiceStack Reference provide its Filename as the first argument:

swiftref {FileName.dtos.swift}

As an example you can Update the Server DTOs added in the previous command with:

swiftref TechStacks.dtos.swift

This will also include any Customization Options that were manually added.


To learn more, see Documentation for Swift Add ServiceStack Reference.