Skip to main content

The Fruxon SDK is a lightweight Python client for integrating with the Fruxon platform.

Project description

fruxon

PyPI version Python License

Run, build, and orchestrate AI agents from your terminal — the official Python SDK and CLI for the Fruxon platform.

Install

pip install fruxon

Requires Python 3.10+.

30-second quickstart

fruxon login                                 # opens a browser; stores the API key in your OS keychain
fruxon agents list                           # see what's deployed in your org
fruxon agents schema my-agent                # learn what parameters my-agent expects
fruxon run my-agent -p question="hello"      # execute
fruxon chat my-agent                         # interactive multi-turn REPL

fruxon doctor will tell you if anything's misconfigured.

The CLI

Top-level discovery commands — useful whether you're a human or an AI agent driving the CLI:

Command What it does
fruxon describe Dump the entire CLI surface as one JSON document (paths, args, options, types, defaults, choices, examples). The right entry point for an LLM driver — read it once, fluent.
fruxon examples [topic] Curated, pasteable invocations grouped by topic (run, agents, trace, …).
fruxon completion {bash|zsh|fish} Print a shell-completion script. eval "$(fruxon completion zsh)" to install.
fruxon guides list / show <id> Bundled CLI playbooks. Start with fruxon-meet; AI-agent drivers should load fruxon-agent-mode first.
fruxon doctor Diagnose local setup (interpreter, SDK version, credentials, API reachability, auth).

Auth:

Command What it does
fruxon login Browser-based sign-in. API key goes to your OS keychain (Keychain on macOS, Secret Service on Linux, Credential Manager on Windows). --api-key $KEY for headless.
fruxon whoami Show the active key/org and where each value came from (flag, env, keychain, file).
fruxon logout Forget stored credentials.
fruxon config list / get / set / unset Read/edit the persistent CLI config.

Execution:

Command What it does
fruxon run <agent> -p k=v One-shot execution. Streams text by default; pass --output json or --no-stream for the full result envelope. Under agent mode, emits NDJSON on stdout — one JSON record per SSE event.
fruxon chat <agent> Interactive REPL with session continuity.
fruxon trace <agent> <record-id> Inspect a past execution — duration, cost, step-by-step trace.

Agent authoring + management:

Command What it does
fruxon agents list Browse every agent in your org. --output id for shell pipes; --include-disabled (-a) to include disabled ones.
fruxon agents get <id> Inspect one agent — display name, deployed revision, tags, expected parameters.
fruxon agents schema <id> Typed parameter metadata — names, types, required, options. The shape fruxon run will accept.
fruxon agents validate <id> -p k=v Pre-flight a payload against the schema. Catches missing-required / wrong-type / invalid-option client-side, surfacing every finding in one pass.
fruxon agents create --file <body.json> Provision a new agent shell. Pair with --schema to print the JSON schema for the body first.
fruxon agents draft run <id> --file <def.json> Run a draft flow definition against an existing agent without publishing it. A CI gate for agent changes.
fruxon agents revisions create/get/deploy Mint and deploy immutable revisions. create --deploy does both in one step.
fruxon agents draft pull/push/status/undo/redo/reset/discard Local working-copy authoring loop — same draft an open studio tab edits.
fruxon agents draft evaluate <id> --dataset <uuid> Score the draft against a golden dataset (expensive — every sample is a full agent run).
fruxon agents tests list/show/watch/cost/delete Browse + tail the test-chat sessions you've run on an agent (owner-scoped).
fruxon agents budget list/get/set/delete Per-origin (PRODUCTION / TEST) cost caps and spend visibility.

Integrations + tools:

Command What it does
fruxon integrations list/get/create/update/verify/open Manage external integrations — the connections agents draw tools from. create/update/verify take a --file JSON body; open opens the dashboard.
fruxon integrations configs list/get Inspect the per-integration auth/config records.
fruxon integrations mcp … Inspect and enable the MCP server for an integration.
fruxon tools list/get/create/update/delete/test Manage the tools inside an integration. Integration-scoped. test runs a tool with sample params before wiring it into an agent.
fruxon keys list/mint/revoke/delete/history/scopes Audit and revoke scoped API keys. Minting opens the dashboard so the secret never enters the CLI process.
fruxon llm-providers list/get/models Browse LLM providers and models supported at the tenant level.
fruxon skills list/show Browse the tenant's product-skill catalog (resources that attach to agents at runtime).

fruxon run — examples

fruxon run my-agent -p question="Hello" -p lang=en
fruxon run my-agent -p temp:=0.7 -p tags:='["a","b"]'   # ':=' for typed JSON
fruxon run my-agent -p prompt=@./prompt.md              # '@file' reads from disk
fruxon run my-agent --params ./params.json              # whole-object input
cat params.json | fruxon run my-agent --stdin
fruxon run my-agent --output json                       # full result envelope
fruxon run my-agent --revision 42                       # pin a specific revision

Agent mode (CI, Claude Code, custom orchestrators)

When CLAUDECODE=1, CI=1, or FRUXON_AGENT_MODE=1 is set, the CLI flips to a contract designed for parseability:

  • JSON by default. Every --output flag defaults to json. Every read command emits a stable shape; every write echoes the server's response.
  • NDJSON streaming. fruxon run and fruxon agents tests watch emit one JSON record per line on stdout ({"type":"text","delta":"..."}, {"type":"tool_call",...}, {"type":"done",...}).
  • Typed exit codes. 10 = auth_required, 11 = not_found, 12 = validation, 13 = conflict, 14 = server_error, 15 = network_error, 16 = interactive_required. Match on the number, not on prose.
  • Structured errors. Every failure emits a one-line JSON envelope on stderr: {"error":{"code","message","exit_code","hint"}}.
  • Interactive guards. Any path that would block on stdin (chat REPL, browser login, --edit, missing --yes) fails fast with EXIT_INTERACTIVE_REQUIRED and a hint naming the bypass flag.
  • Cold-start manifest. Bare fruxon invocation emits a one-line JSON manifest with next-step commands so an LLM driver learns the surface without --help walking.

Full contract: fruxon guides show fruxon-agent-mode.

The Python client

from fruxon import FruxonClient

client = FruxonClient(api_key="...", org="acme-corp")

# One-shot
result = client.execute(
    "support-agent",
    parameters={"question": "How do I reset my password?"},
)
print(result.response)
print(f"{result.trace.duration}ms · ${result.trace.total_cost:.4f}")

# Multi-turn — thread the session ID into subsequent calls
followup = client.execute(
    "support-agent",
    parameters={"question": "Tell me more"},
    session_id=result.session_id,
)

# Streaming
for chunk in client.stream_text("support-agent", parameters={"question": "Hi"}):
    print(chunk, end="", flush=True)

# Lower-level: typed SSE events (text, tool_call, tool_result, done, …)
for event in client.stream("support-agent", parameters={"question": "Hi"}):
    ...

# Discovery
for agent in client.list_agents():
    print(agent.id, agent.current_revision)

# Typed parameter metadata — what `fruxon run` will accept
schema = client.get_agent_parameter_metadata("support-agent", revision=1)
for p in schema["metadata"]:
    print(p["name"], p["type"], "required" if p.get("required") else "optional")

# Test a draft flow without publishing it (same result shape as execute)
result = client.test("support-agent", {"flow": {...}, "baseRevision": 3, "parameters": {...}})
for event in client.stream_test("support-agent", {"flow": {...}}):
    ...

# Integrations & tools — the connections + capabilities agents are built from
for integ in client.list_integrations(types=["CUSTOM"]):
    print(integ.id, integ.type)
client.create_integration({"id": "github", "displayName": "GitHub", "configMetadata": {...}})
for tool in client.list_tools("github"):
    print(tool.id, tool.tool_type)
client.create_tool("github", {"id": "list_commits", "integrationId": "github", "descriptor": {...}})
client.test_tool("github", {"descriptor": {...}, "parameters": {"repo": "fruxon-sdk"}})

The client picks up FRUXON_API_KEY, FRUXON_ORG, and FRUXON_BASE_URL only if you read them yourself — the constructor takes explicit values. The CLI resolves them automatically (flags → env → stored config).

Credentials & storage

The CLI resolves auth in this order (first non-empty wins):

  1. Explicit flags — --api-key / --org / --base-url
  2. Environment — FRUXON_API_KEY / FRUXON_ORG / FRUXON_BASE_URL
  3. Stored credentials (managed by fruxon login)

The stored layer is split:

  • API key → OS keychain via keyring. Set FRUXON_NO_KEYRING=1 or let the keyring be unavailable to fall back to a 0600 JSON file.
  • Non-secrets (org, base_url) → plain JSON under ~/.fruxon/credentials.

fruxon config list shows both sources side by side.

Environment variables

Var Effect
FRUXON_API_KEY Default API key.
FRUXON_ORG Default organization.
FRUXON_BASE_URL Override the API base URL (staging / self-hosted).
FRUXON_CONFIG_DIR Override the credentials directory (default ~/.fruxon).
FRUXON_DASHBOARD_URL Override where fruxon login points the browser.
FRUXON_AGENT_MODE=1 Opt into the agent-mode contract (JSON outputs, NDJSON streams, typed exits, structured errors). Also auto-detected from CLAUDECODE=1 / CI=1.
FRUXON_NO_KEYRING=1 Force the JSON-file fallback for the API key.
FRUXON_CA_BUNDLE Path to a PEM file of extra trusted CAs (corporate TLS proxies).
FRUXON_INSECURE=1 Disable TLS verification (dev/staging only — never production).
FRUXON_NO_BANNER=1 Suppress all branding chrome.
FRUXON_NO_UPDATE_CHECK=1 Opt out of the "newer version available" notifier.
NO_COLOR=1 Standard convention — disables color output.

Docs

In-CLI:

  • fruxon describe — the whole command tree as JSON
  • fruxon guides list — bundled procedural playbooks (orientation, build-agent, agent-mode contract, debug-revision, …)

License

MIT — 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

fruxon-0.8.5.tar.gz (257.6 kB view details)

Uploaded Source

Built Distribution

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

fruxon-0.8.5-py3-none-any.whl (215.0 kB view details)

Uploaded Python 3

File details

Details for the file fruxon-0.8.5.tar.gz.

File metadata

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

File hashes

Hashes for fruxon-0.8.5.tar.gz
Algorithm Hash digest
SHA256 ef2ac4cfb6a0340b6dd7cf309aa2e8a8b8764406be976dfb924f95592573b372
MD5 502cfbc3a11910dbea3def4ae6311d36
BLAKE2b-256 8b1654f0ce0dfa16aae288d5a3b73a7c6b1626d0a23dec4a4dce69823f6349e6

See more details on using hashes here.

Provenance

The following attestation bundles were made for fruxon-0.8.5.tar.gz:

Publisher: release.yml on fruxon-ai/fruxon-sdk

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

File details

Details for the file fruxon-0.8.5-py3-none-any.whl.

File metadata

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

File hashes

Hashes for fruxon-0.8.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f074089107e385f3725e8b2a0362295137c2e802532ab331f0806a671ab5ad1a
MD5 e62397d1a24e70e1a9aa094cc1d7cd0f
BLAKE2b-256 b42ee40e59c14d6b377afa5cfc46d3f665ad9a9d3e1f83bb7ada16a383424d95

See more details on using hashes here.

Provenance

The following attestation bundles were made for fruxon-0.8.5-py3-none-any.whl:

Publisher: release.yml on fruxon-ai/fruxon-sdk

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