Skip to main content

truffile the TruffleOS SDK - Connect and deploy apps to Truffle devices

Project description

🍄‍🟫 Truffile

Python SDK/CLI for Truffle devices.

What It Does

  • discovers and connects to your Truffle (scan, connect, disconnect)
  • validates and deploys apps from truffile.yaml (validate, deploy)
  • manages installed apps (list apps, delete)
  • talks to inference directly (models, chat)

Start making your Own Apps

  • app schema and validation: truffile/truffile/schema/app_config.py
  • schedule parsing: truffile/truffile/schedule.py
  • deploy planning + builder flow: truffile/truffile/deploy/builder.py
  • generated TruffleOS protos vendored in: truffile/truffle/
  • app store examples:
    • truffile/app-store/kalshi
    • truffile/app-store/reddit

truffile.yaml defines:

  • metadata (name, description, type)
  • process (cmd, working_directory, environment)
  • files to upload
  • optional run/build commands
  • background schedule policy (for BG apps)

App Types and Runtime Model

Apps can be:

  • foreground (fg): exposes MCP tools that tasks/agents can call during active execution
  • background (bg): runs on schedule and emits context for proactivity, enabling the device to trigger actions and write/update memory
  • both (fg + bg): one app package can provide MCP tools and scheduled context emission

How to think about it:

  • FG path is tool-serving: app process is used as a callable capability surface (MCP)
  • BG path is context/proactivity: scheduled runs feed the proactive agent with fresh signals
  • Proactivity can take actions and persist memory based on BG outputs

In practice:

  • use fg when you need direct tool invocation from tasks
  • use bg when you need periodic monitoring, summaries, or event-driven context
  • use both when the same app should both expose tools and continuously feed proactivity/memory

Core Commands

truffile scan
truffile connect <device>
truffile validate [app_dir]
truffile deploy [app_dir]
truffile deploy --dry-run [app_dir]
truffile list apps
truffile delete
truffile models
truffile chat

In truffile chat, runtime controls are slash commands (not launch flags):

  • /help for all chat commands
  • /config to show current chat config
  • /reasoning on|off
  • /stream on|off
  • /json on|off
  • /tools on|off
  • /max_tokens <int>, /temperature <float|off>, /top_p <float|off>, /max_rounds <int>
  • /models to switch model
  • /attach <path-or-url> to attach an image for the next user message (local path or http(s) URL)
  • /system <text|clear>
  • /mcp connect <http(s)://...>, /mcp tools, /mcp status, /mcp disconnect

Inference Interfaces

Direct IF2:

  • list models: GET /if2/v1/models
  • chat completions: POST /if2/v1/chat/completions

CLI wrappers:

  • truffile models
  • truffile chat (streaming by default)

Proto Sync

Refresh vendored protos from firmware repo:

./scripts/sync_protos.sh

Contributors

Contributors are welcome to submit apps to the Truffle App Store.

To submit:

  • open a PR with your app under the app-store/ folder
  • include a screen recording of your app in action

The Truffle team will deploy accepted apps to the App Store for everyone with Truffle to use and your name will be featured there! There may be small changes needed to make the app run optimally, but most features and the credit will remain yours.

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

truffile-0.1.25.tar.gz (568.8 kB view details)

Uploaded Source

Built Distribution

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

truffile-0.1.25-py3-none-any.whl (151.3 kB view details)

Uploaded Python 3

File details

Details for the file truffile-0.1.25.tar.gz.

File metadata

  • Download URL: truffile-0.1.25.tar.gz
  • Upload date:
  • Size: 568.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for truffile-0.1.25.tar.gz
Algorithm Hash digest
SHA256 ecf66427d1ee648412cb1431cd2e8520710dea0d1446977bb7f5e36b1080b5e3
MD5 f5a3cb9ded925c3cd25be75d74b42c25
BLAKE2b-256 4ce38895ad9147b5b699a138f837da637bc31a8703208d3e6e6004122053e119

See more details on using hashes here.

Provenance

The following attestation bundles were made for truffile-0.1.25.tar.gz:

Publisher: publish_pip.yml on deepshard/truffile

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

File details

Details for the file truffile-0.1.25-py3-none-any.whl.

File metadata

  • Download URL: truffile-0.1.25-py3-none-any.whl
  • Upload date:
  • Size: 151.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for truffile-0.1.25-py3-none-any.whl
Algorithm Hash digest
SHA256 6941c0a5d240e3962ac843c0bc2cb5c564b2867b07f4313c71aba64ef2ea23e6
MD5 97b24f673f225c11578bddd747e31bf6
BLAKE2b-256 3b4589769122e750e0f121a3c0964cde7d9499d0eea9d04278b4786e0214a524

See more details on using hashes here.

Provenance

The following attestation bundles were made for truffile-0.1.25-py3-none-any.whl:

Publisher: publish_pip.yml on deepshard/truffile

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