Skip to main content

Python SDK and CLI for building skills on the Synax agentic platform.

Project description

synax-sdk

CI PyPI version Python versions License: Apache 2.0

The Python SDK and synax-sdk CLI for building skills on the Synax agentic platform. Skill developers use this SDK to define skills in Python, generate the manifest automatically, sign artifacts with Ed25519, and publish them to a Synax platform instance.

Install

pip install synax-sdk

That gives you both the synax_sdk Python library and the synax-sdk CLI.

Quick start

synax-sdk keys generate                 # one-time, creates ~/.synax/keys/<fp>.key
synax-sdk skill init my-first-skill     # scaffold a new project
cd my-first-skill
uv sync                              # install deps (synax-sdk pinned)
uv run synax-sdk skill test              # run the bundled declarative test case
uv run synax-sdk skill build             # produce a signed artifact in build/signed_bundle/

To publish:

export SYNAX_PUBLISH_TOKEN=spt_...
uv run synax-sdk skill publish --target https://synax.your-company.com

What a skill looks like

from synax_sdk import Skill, secrets, logger

skill = Skill(
    name="github-pr-summary",
    version="1.0.0",
    description="Fetch and summarize GitHub pull requests",
    capabilities=["network:api.github.com", "secrets:GITHUB_TOKEN"],
    secrets=[{"name": "GITHUB_TOKEN", "type": "oauth_token", "description": "..."}],
)


@skill.tool(description="Fetch a PR and return a structured summary")
async def summarize_pr(repo: str, pr_number: int) -> dict:
    """Summarize a pull request.

    Args:
        repo: Repository in format owner/name.
        pr_number: Pull request number.
    """
    token = await secrets.get("GITHUB_TOKEN")
    logger.info("Summarizing PR", extra={"repo": repo, "pr_number": pr_number})
    # ... call the GitHub API, summarize, return ...
    return {"title": "...", "summary": "...", "files_changed": 7}

The SDK derives a full manifest from this code at build time. Type hints become JSON Schema parameter definitions. The Google-style docstring's Args: section becomes per-parameter descriptions. Capabilities and secrets get validated against the skill's declarations.

Testing locally

Two complementary patterns ship out of the box.

Declarative — drop a YAML case under test_inputs/<tool>/:

# test_inputs/summarize_pr/case_basic.yaml
input:
  repo: "owner/name"
  pr_number: 42
secrets:
  GITHUB_TOKEN: "test-token"
expected_output_schema:
  type: object
  properties:
    title: {type: string}
expected_secret_accesses: ["GITHUB_TOKEN"]

Run with synax-sdk skill test. See docs/testing_skills.md for the full schema.

Pytest-based — the SDK auto-registers two fixtures:

async def test_summarize_pr(synax_mock_platform, synax_skill_under_test):
    synax_mock_platform.secrets.set("GITHUB_TOKEN", "test-token")

    tool = next(t for t in synax_skill_under_test.tools if t.name == "summarize_pr")

    from synax_sdk.testing import run_tool_async
    result = await run_tool_async(tool, repo="owner/name", pr_number=42)

    assert "title" in result

CLI commands

synax-sdk keys
  generate / list / export / import / set-default / register

synax-sdk skill
  init <name>     scaffold a new project
  validate        check the manifest against the v1.0 schema
  test            run declarative test cases under test_inputs/
  info            show the loaded skill's metadata
  build           sign + package into build/signed_bundle/
  verify <yaml>   verify the signatures on a manifest
  publish         upload a signed bundle to a Synax platform

Run any command with --help for full options.

Status

This is the initial 0.1.0 release. The public API may change between minor versions until 1.0 — see CHANGELOG.md for what's new and breaking.

Documentation

Development

uv sync                                           # install deps + create .venv
uv run pytest                                     # run tests
uv run ruff check .                               # lint
uv run black --check . && uv run isort --check .  # format check
uv run mypy synax_sdk synax_skill_cli             # type check

License

Apache License 2.0 — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

synax_sdk-0.4.0.tar.gz (222.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

synax_sdk-0.4.0-py3-none-any.whl (87.0 kB view details)

Uploaded Python 3

File details

Details for the file synax_sdk-0.4.0.tar.gz.

File metadata

  • Download URL: synax_sdk-0.4.0.tar.gz
  • Upload date:
  • Size: 222.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synax_sdk-0.4.0.tar.gz
Algorithm Hash digest
SHA256 a1fead46eefa2c2b8d919a2b393e6ebc7fb19e80804d73b3ffce65a3fa487535
MD5 3963b233b6daad322696b9c87a75a942
BLAKE2b-256 953edac61a976f52d668bd8f2440f12f28050b33154fad3cf342f195ae26a125

See more details on using hashes here.

Provenance

The following attestation bundles were made for synax_sdk-0.4.0.tar.gz:

Publisher: publish.yml on synergentic/synax-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file synax_sdk-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: synax_sdk-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 87.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for synax_sdk-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 1860ee87874c16c62b208b6f4eccffcf554966a31a9e18e31332ce9235c6ef3d
MD5 3444d3d78bcd2b2abeefc8d02fe14d59
BLAKE2b-256 6b3ea9c3f055bd5e341446381548e247fd64a39e1f1050861b4e005811a98885

See more details on using hashes here.

Provenance

The following attestation bundles were made for synax_sdk-0.4.0-py3-none-any.whl:

Publisher: publish.yml on synergentic/synax-sdk-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page