Skip to content
Luna
Esc
↑↓navigate↵open⌘Jpreview
On this page

luna sdk

Write out Luna's TypeScript, Python or Swift SDK at this CLI's version, and print how to add it to your app.

luna sdk writes out one of Luna’s SDKs, at the version of this CLI, and prints how to add it to your app.

npm install --install-links "$(luna sdk ts --path)"

Reference

luna sdk [OPTIONS] <LANG> [DIR]
Option Type Default Does
<LANG> text Required Which SDK: ts, python or swift. typescript also means ts.
[DIR] path ~/.luna/sdk/<VERSION>/<LANG>/luna Where to write it. Name the folder luna, since a Swift package takes its name from its folder.
--path flag Off Prints only the folder’s path on standard output, for scripts.

Without --path, the CLI prints the folder and the line that adds the SDK to your app on standard error.

SDK How it is added
ts npm install --install-links <DIR> in your app’s folder
python pip install <DIR>, or <DIR> on PYTHONPATH
swift In Xcode, File > Add Package Dependencies > Add Local, or .package(path: "<DIR>") in Package.swift with the product Luna of the package luna

Good to know

  • The SDKs are not published anywhere else. The copy always matches the CLI that deploys your app.
  • luna sdk works on this machine only and never reaches Luna.
  • Writing again replaces the files an earlier copy wrote and leaves any other file in the folder alone.
  • The Python SDK comes with a pyproject.toml, so pip install works on the folder. It has no dependencies.
  • The default folder is named after this CLI’s version, so a CLI installed by luna upgrade writes its SDK to a new folder.

Examples

Install the TypeScript SDK

npm install --install-links "$(luna sdk ts --path)"

Keep the Swift package in your repository

luna sdk swift vendor/luna

Install the Python SDK

pip install "$(luna sdk python --path)"

Was this page helpful?