Skip to main content

🍄‍🟫 Truffile

Python SDK/CLI for Truffle devices.

What It Does

  • discovers and connects to your Truffle (scan, connect, disconnect)
  • copies bundled agent resources into your workspace (load)
  • validates and deploys apps from truffile.yaml (validate, deploy)
  • manages installed apps (list apps, delete)
  • talks to the on-device agent (convo) or inference directly (models, infer)

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/
  • bundled example apps live under truffile/app-store/
  • bundled Codex skills live under truffile/skills/

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 create [app_name]
truffile load all
truffile validate [app_dir]
truffile deploy [app_dir]
truffile deploy --dry-run [app_dir]
truffile list apps --json
truffile delete <app-name>
truffile models
truffile convo

truffile create scaffolds a hybrid app starter with:

  • truffile.yaml (foreground + background process config)
  • copy-file steps for generated *_foreground.py and *_background.py
  • icon.png copied from docs/Truffle.png (deploy requires an icon)

truffile load all copies bundled agent-readable resources into your current workspace:

  • ./truffile/skills/ for CLI/chat/infer/app-creation skills
  • ./truffile/examples/ for bundled example apps such as ArXiv, Exa, Notion, Obsidian, Viator, WHOOP, and Home Assistant

Use truffile load skills or truffile load examples to copy only one group.

Obsidian Bridge Workflow

For a local Obsidian vault on your laptop, truffile can run a small host-side bridge and deploy a bundled foreground app to the device:

truffile obsidian attach --vault ~/Documents/abd-vault
truffile obsidian serve
truffile obsidian deploy

Use truffile obsidian status to inspect the saved bridge configuration. The bridge stores a scoped bearer token in the local truffile state file and the bundled app uses that token to read, write, list, and search notes in the configured vault.

Convo chat

truffile convo opens an interactive REPL backed only by the authenticated user's Convo. It defaults to an unsent new side thread; the first message creates that thread. Use truffile convo --main or /main to opt into Main. /new always starts another unsent side thread.

Useful REPL commands include /threads, /history, /rename <name>, /interrupt, /hide, /restore, /main, and /new. Main is thread 0. System/Bulletin threads, including thread -1, are not shown and cannot be selected for chat.

The same command is first-class for scripts and agents:

# New side thread, wait for the completion fence, print JSON, then exit.
truffile convo --new --rename "QA debug" --json --timeout 120 \
  "Reply with a short device status summary"

# Follow up by exact thread name or decimal id.
truffile convo --thread "QA debug" --json "continue"
truffile convo --thread-id 123 --json "continue"

# Inspect/list/rename/interrupt without entering the REPL.
truffile convo --list-chats --json
truffile convo --thread-id 123 --history --json
truffile convo --thread-id 123 --rename "Release notes"
truffile convo --thread-id 123 --interrupt

One-shot mode writes the final text (or one JSON document with --json) to stdout and exits nonzero for invalid selection, runtime/agent failure, interaction-required state, interruption, lost completion fence, or timeout. --timeout is opt-in; expiry interrupts the selected thread and exits 124. JSON includes canonical thread_id and backend: "convo", plus the one-release task_id compatibility key. The --task-id, --list-tasks, and /tasks spellings remain aliases for one release and accept decimal Convo thread IDs—not legacy Task UUIDs.

Old Task histories are intentionally not listed or migrated. Local hide is reversible and device/user scoped: it never deletes a server thread. Per-chat app restrictions do not exist in the Convo protocol, so --app and dynamic /<app> sends are rejected explicitly; /apps and --list-apps remain available. Setup/OAuth/action cards are reported as interaction required and must be completed in a supported client in v1.

Inference Interfaces

Direct IF2:

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

CLI wrappers:

  • truffile models
  • truffile infer (streaming by default)

Proto Sync

The tracked truffle.*_pb2 packages are pinned by truffle/PROTOCOL_SHA. Refresh them from the generated Python tree and protocol repo:

./scripts/sync_protos.sh

Development Loop

The supported app development loop is CLI-first:

truffile create my-app --path ./apps
truffile validate ./apps/my-app
truffile deploy --dry-run ./apps/my-app
truffile deploy ./apps/my-app

After deploy, use truffile convo to exercise the on-device agent. Convo v1 cannot enforce a per-thread app allowlist; inspect installed apps with truffile convo --list-apps. Use truffile delete to remove test apps from the connected device.

Clean package verification

python3.12 -m venv /tmp/truffile-convo-clean
/tmp/truffile-convo-clean/bin/python -m pip install -e .
/tmp/truffile-convo-clean/bin/python -c \
  'from truffile.transport.client import TruffleClient; print("ok")'
/tmp/truffile-convo-clean/bin/truffile convo --help

/tmp/truffile-convo-clean/bin/python -m pip wheel --no-deps -w /tmp/truffile-wheel .
python3.12 -m venv /tmp/truffile-convo-wheel
/tmp/truffile-convo-wheel/bin/python -m pip install /tmp/truffile-wheel/truffile-*.whl
/tmp/truffile-convo-wheel/bin/truffile convo --help

For the owner device acceptance sequence, run scripts/smoke_convo_6272.sh after connecting an already approved truffle-6272 session. The script uses safe text-only prompts and covers list/new/rename/history/one-shot/interrupt; finish with the printed manual REPL check for streaming interruption.

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.3.13.tar.gz (1.3 MB view details)

Uploaded Source

Built Distribution

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

truffile-0.3.13-py3-none-any.whl (1.4 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: truffile-0.3.13.tar.gz
  • Upload date:
  • Size: 1.3 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for truffile-0.3.13.tar.gz
Algorithm Hash digest
SHA256 7d90b65b4633fed1863c2207496e45441b7c6e039b4328065675c00f68611e99
MD5 bce2509de21ec38eba4ea04597dfa3c7
BLAKE2b-256 5bb9dd3bf0eb5fb8ca075327c8318c57c363a54274e0558ea9cf23279d61e49b

See more details on using hashes here.

Provenance

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

Publisher: publish-truffile.yml on deepshard/pyfw

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.3.13-py3-none-any.whl.

File metadata

  • Download URL: truffile-0.3.13-py3-none-any.whl
  • Upload date:
  • Size: 1.4 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for truffile-0.3.13-py3-none-any.whl
Algorithm Hash digest
SHA256 35392beb98530da1d90505ab55fd62284fc87552ba912654cc8c8c9500749bc2
MD5 b65effcd2882c2348288d8226132dbb3
BLAKE2b-256 9997afb55360fc6407838c27dade486fb0ce88108676cbf987b1c0fd7749dc7f

See more details on using hashes here.

Provenance

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

Publisher: publish-truffile.yml on deepshard/pyfw

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

Release history Release notifications | RSS feed

0.3.21

2 files

0.3.20

2 files

0.3.19

2 files

0.3.18

2 files

0.3.17

2 files

0.3.16

2 files

0.3.15

2 files

0.3.14

2 files

This release

0.3.13 This release

2 files

0.3.11

2 files

0.3.10

2 files

0.3.9

2 files

0.3.8

2 files

0.3.7

2 files

0.3.6

2 files

0.3.5

2 files

0.3.4

2 files

0.3.3

2 files

0.3.2

2 files

0.3.1

2 files

0.3.0

2 files

0.2.7

2 files

0.2.6

2 files

0.2.5

2 files

0.2.4

2 files

0.2.3

2 files

0.2.2

2 files

0.2.1

2 files

0.2.0

2 files

0.1.35

2 files

0.1.33

2 files

0.1.31

2 files

0.1.29

2 files

0.1.27

2 files

0.1.25

2 files

0.1.23

2 files

0.1.21

2 files

0.1.19

2 files

0.1.17

2 files

0.1.14

2 files

0.1.12

2 files

0.1.11

2 files

0.1.8

2 files

0.1.7

2 files

0.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page