Skip to main content

Terminal channel for Zeno — stdin/stdout with streaming.

Project description

zeno-channel-cli

Terminal channel for Zeno. Reads lines from stdin into IncomingMessages and renders the agent's OutgoingMessages to stdout. Doubles as a manual smoke-test harness and as the simplest reference implementation of the Channel protocol.

Install

uv add 'zeno-framework[cli]'
# or, without the AI package:
uv add zeno-channel-cli

Minimal usage

import asyncio

from zeno.agent import Agent
from zeno.app import ZenoApp
from zeno.channels.cli import CliChannel
from zeno.testing import FakeProvider

app = ZenoApp(
    agent=Agent(name="root", instructions="You are Zeno, a helpful assistant."),
    channels=[CliChannel()],
    provider=FakeProvider(),  # swap for OpenAIProvider / ClaudeSDKProvider in production
)

asyncio.run(app.run())

Then run the script. Type a line, hit return, see the reply. Ctrl-D or Ctrl-C exits cleanly. user_id defaults to $USER (or "local" if unset) so a developer running the snippet above gets a sensible tenant scope without configuration. Override explicitly in production:

CliChannel(user_id="alice", prompt=">>> ")

Behavior

  • Capabilities: supports_streaming=False, supports_threading=False. The core StreamBuffer consolidates chunked replies into one send() at finalize-time, which the renderer emits as a single line.
  • Stdin: read via asyncio.to_thread(stream.readline) so the CLI channel stays dependency-free (no aioconsole). At most one line read is in flight at a time, matching REPL semantics.
  • Inbound queue: exposes inbound_put(message) so zeno-scheduler can inject proactive messages without going through stdin.
  • Shutdown: stop() is idempotent and closes the renderer; calling send() after stop() raises ChannelError.

Testing

uv run pytest packages/zeno-channel-cli

Tests use io.StringIO for stdin/stdout — no terminal needed.

Part of the Zeno framework.

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

zeno_channel_cli-1.0.0rc2.tar.gz (8.0 kB view details)

Uploaded Source

Built Distribution

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

zeno_channel_cli-1.0.0rc2-py3-none-any.whl (7.2 kB view details)

Uploaded Python 3

File details

Details for the file zeno_channel_cli-1.0.0rc2.tar.gz.

File metadata

  • Download URL: zeno_channel_cli-1.0.0rc2.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for zeno_channel_cli-1.0.0rc2.tar.gz
Algorithm Hash digest
SHA256 949d1b472ee7270441dbe9828b77f9570ce2e7d3dbead7bb678b1520764319fe
MD5 4f4e93360b4a99bd8c7e3b3a663d0df4
BLAKE2b-256 d24a6d2d5c81eebdf4b2ff8153aa81d9c5ec62a4b06a8c3e5140da76f52039b1

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_channel_cli-1.0.0rc2.tar.gz:

Publisher: publish.yml on nkootstra/zeno

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

File details

Details for the file zeno_channel_cli-1.0.0rc2-py3-none-any.whl.

File metadata

File hashes

Hashes for zeno_channel_cli-1.0.0rc2-py3-none-any.whl
Algorithm Hash digest
SHA256 4cf9642419fb02928b83f2c3f143548342e96c426dc1542527e589225822d7d1
MD5 3c2cff6f5a7717e73dc4d0c81540f920
BLAKE2b-256 1c820d037c6bc9984e695374a19b5d3a6e9325f2f856290ca646f74780d5d43d

See more details on using hashes here.

Provenance

The following attestation bundles were made for zeno_channel_cli-1.0.0rc2-py3-none-any.whl:

Publisher: publish.yml on nkootstra/zeno

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