Getting Started
This guide walks through installing the Targon SDK, configuring credentials, writing your first app, and deploying it to the platform.
Prerequisites
- Python 3.9 or later
- pip for installing packages
- A Targon account and API key
Install the SDK in editable mode:
git clone https://github.com/manifold-inc/targon-sdk.git
cd targon-sdk
pip install -e .
Verify the CLI:
targon --version
Configure Credentials
Run the setup command to store your API key securely:
targon setup
Follow the prompts to paste your key. The SDK stores it using the system keyring so future commands can authenticate automatically.
Create Your First App
The repository ships with a minimal example in examples/gettin_started/getting_started.py:
# targon-sdk/examples/gettin_started/getting_started.py
import targon
app = targon.App("getting-started", image=targon.Image.debian_slim("3.12"))
@app.function()
def hello(message: str) -> dict[str, str]:
return {"message": message, "status": "success"}
@app.local_entrypoint()
def main(message: str):
return hello.remote(message)
Appgroups remote functions and supplies the base image.@app.function()registers a deployable function.@app.local_entrypoint()exposes a CLI entrypoint for local testing.
Run Locally
Use targon run to invoke the entrypoint without creating a deployment:
targon run targon-sdk/examples/gettin_started/getting_started.py --message "Hello Targon"
You should see a JSON panel with the greeting result.
Deploy to Targon
When you are ready to make the app persistent, deploy it:
targon deploy targon-sdk/examples/gettin_started/getting_started.py --name getting-started-demo
This command builds the container image, provisions compute, and prints the deployment status. Use targon app list to confirm that the app is active.
Next Steps
- Explore web endpoints for publishing HTTP handlers.
- Choose the right compute tier for your workload.
- Learn how deployments work with the
targon deployreference.
You now have a working Targon environment and a live application. Iterate locally with targon run, deploy updates with targon deploy, and manage running apps with targon app.