The SourceKittenDaemon binary has to be started with the following parameters:
action verb
: either start
or help
--port
: the port number on which the web server should open
--project=
: the absolute path to the .xcodeproj
file you wish to load
An example would look like this:
SourceKittenDaemon start --port 44876 --project /private/tmp/abcde/abcde.xcodeproj
After that, the daemon can be queried using the REST api outlined below
This is the Protocol definition for the protocol between an editor and the SourceKittenDaemon
The protocol uses simple HTTP GET calls for communication. The following endpoints are supported.
Request a completion. In order to successfuly complete the request, the server needs the following parameters as request headers:
X-Offset
: An integer number of the current byte offset for which a completion is requested
X-Path
: The path to the temporarily written buffer that contains the current state of the editing of the file
X-File
: The name of the currently edited file as it is known in the project. I.e. AppDelegate.swift
Stops the server. This can be used to restart the server for a different target afterwards.
Returns “OK”
Returns the currently loaded project file path
Returns a list of all Swift files in the current project