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/kalshitruffile/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
fgwhen you need direct tool invocation from tasks - use
bgwhen you need periodic monitoring, summaries, or event-driven context - use
bothwhen the same app should both expose tools and continuously feed proactivity/memory
Core Commands
truffile scan
truffile connect <device>
truffile create [app_name]
truffile validate [app_dir]
truffile deploy [app_dir]
truffile deploy --dry-run [app_dir]
truffile list apps
truffile delete
truffile models
truffile chat
truffile create scaffolds a hybrid app starter with:
truffile.yaml(foreground + background process config)- copy-file steps for generated
*_foreground.pyand*_background.py icon.pngcopied fromdocs/Truffle.png(deploy requires an icon)
In truffile chat, runtime controls are slash commands (not launch flags):
/helpfor all chat commands/configto 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>/modelsto switch model/attach <path-or-url>to attach an image for the next user message (local path orhttp(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 modelstruffile 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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file truffile-0.2.5.tar.gz.
File metadata
- Download URL: truffile-0.2.5.tar.gz
- Upload date:
- Size: 171.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a6f924f70cbb86f4beef0c8a327486fcff47d27233529db1e168a50f755cc7ab
|
|
| MD5 |
ed92e922575a8ad1e507e257547c2d82
|
|
| BLAKE2b-256 |
b46c40b34ae9db5ff110760b79a0f4f25ee78a15ad6ea3430ed86dc3711306e2
|
Provenance
The following attestation bundles were made for truffile-0.2.5.tar.gz:
Publisher:
publish-truffile.yml on deepshard/pyfw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
truffile-0.2.5.tar.gz -
Subject digest:
a6f924f70cbb86f4beef0c8a327486fcff47d27233529db1e168a50f755cc7ab - Sigstore transparency entry: 1271001302
- Sigstore integration time:
-
Permalink:
deepshard/pyfw@ceb10c1b769f7fb96d61b0792e46c14b152ec48d -
Branch / Tag:
refs/tags/truffile/v0.2.5 - Owner: https://github.com/deepshard
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-truffile.yml@ceb10c1b769f7fb96d61b0792e46c14b152ec48d -
Trigger Event:
push
-
Statement type:
File details
Details for the file truffile-0.2.5-py3-none-any.whl.
File metadata
- Download URL: truffile-0.2.5-py3-none-any.whl
- Upload date:
- Size: 280.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
28d00989b1cf19b5a3cda2961b05042d898f0f5de483d304112900e79b53aad5
|
|
| MD5 |
f1b0c0d81b7594ef116e8c22cf37de8a
|
|
| BLAKE2b-256 |
b5bbb7b880adbe50f8d5546d72a5a2a1f545f1ad51eeaa9c1b1dd2e418e5081d
|
Provenance
The following attestation bundles were made for truffile-0.2.5-py3-none-any.whl:
Publisher:
publish-truffile.yml on deepshard/pyfw
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
truffile-0.2.5-py3-none-any.whl -
Subject digest:
28d00989b1cf19b5a3cda2961b05042d898f0f5de483d304112900e79b53aad5 - Sigstore transparency entry: 1271001322
- Sigstore integration time:
-
Permalink:
deepshard/pyfw@ceb10c1b769f7fb96d61b0792e46c14b152ec48d -
Branch / Tag:
refs/tags/truffile/v0.2.5 - Owner: https://github.com/deepshard
-
Access:
private
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-truffile.yml@ceb10c1b769f7fb96d61b0792e46c14b152ec48d -
Trigger Event:
push
-
Statement type: