Skip to main content

emagine

The command line for agents hosted on Emagine. Build an agent with any Python framework, run emagine deploy, and call it at POST https://ai-api.emaginest.com/v1/agents/{slug}/invocations.

Install

uv tool install emagine

uv installs emagine in an environment of its own and puts the command on your PATH (if the shell does not find it, run uv tool update-shell). Upgrade with uv tool upgrade emagine. Without uv, pip install emagine works too, ideally in a virtual environment.

Python 3.10 or newer. It depends on click, httpx and pathspec only, with no AWS SDK.

Log in

emagine login

This asks for an API key with hidden input, checks it, and saves it to ~/.config/emagine/credentials with mode 0600 (under $XDG_CONFIG_HOME if that is set). Use a live key with the deploy permission to manage agents, and chat to invoke them. EMAGINE_API_KEY overrides the saved key, and EMAGINE_BASE_URL overrides https://ai-api.emaginest.com.

Quickstart

emagine init --template langgraph my-agent
cd my-agent
emagine agents create
emagine deploy
emagine invoke "hi"

init writes emagine.toml:

agent = "my-agent"      # the slug
python = "3.12"         # 3.10 to 3.14
entrypoint = "main.py"

Commands that act on an agent take its slug from emagine.toml, or from --agent (or an argument) when run elsewhere.

Commands

Command
login Save an API key
init --template NAME [DIR] Start a project from a template
agents create [SLUG] [--name] [--health-use] Create a hosted agent. --health-use (PHI, needs a BAA) cannot be changed later
agents list Your hosted agents
agents delete SLUG [--yes] Delete one, after you type its slug
deploy [--no-activate] Zip, upload, build and make live, polling every 3 seconds. Ctrl-C stops watching, not the deploy
status [N] The agent and its newest deployment, or deployment N with its build log
versions Recent deployments; * marks the live one
activate N Make deployment N live. Activating an older one is the rollback
logs [--since 10m] [--follow] Recent log lines
env list / env set NAME [--value-stdin] / env unset NAME Environment variables. Values are asked for with hidden input (or read from stdin), never taken as an argument, and take effect on the next deploy
invoke [PROMPT] [--data JSON|@file] [--stream] [--session ID] Call the agent. The answer goes to stdout and the session id to stderr. --stream goes through ai-stream
kb upload KB FILES... Upload PDF, DOCX, TXT or Markdown files to a knowledge base

What deploy sends

deploy packages the project directory, leaving out .git, .venv, venv, __pycache__, node_modules, and anything the root .gitignore or .emagineignore excludes. It refuses, naming each file, any symlink and any file that looks like a secret (.env*, *.pem, *.key, id_rsa*). There is no override: keep secrets in emagine env set. The zip may be at most 50 MB. It must contain a requirements.txt or pyproject.toml and the entrypoint. Every dependency must have a prebuilt Linux arm64 wheel.

Templates

Template Framework Python
plain none: httpx only, streams token by token 3.12
langgraph LangChain create_agent (LangGraph) with langchain-mcp-adapters 3.12
strands Strands Agents 3.12
crewai CrewAI (telemetry off) 3.11
openai-agents OpenAI Agents SDK (tracing off) 3.12

Every template has the same main.py, an HTTP shell on port 8080 serving GET /ping and POST /invocations. Your code goes in agent.py. The agent reads MODEL (default anthropic.claude-haiku-4-5) and, optionally, KNOWLEDGE_BASE, a slug whose documents it can search through MCP. Each template's README shows how to run it locally first.

Development

pip install -e '.[test]'
pytest
python scripts/check_templates.py   # every template resolves to arm64 wheels (needs uv)
python scripts/smoke_templates.py   # every template installs and answers a local stand-in gateway

Metadata

Release files for emagine 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for emagine 0.1.0
File Size Uploaded Provenance Actions
emagine-0.1.0.tar.gz 34.6 kB Without provenance Details for emagine-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for emagine 0.1.0
File Interpreter ABI Platform Actions
emagine-0.1.0-py3-none-any.whl Python 3 none any Details for emagine-0.1.0-py3-none-any.whl

Total release size: 74.0 kB

Release files / emagine-0.1.0.tar.gz

Download URL emagine-0.1.0.tar.gz
Size 34.6 kB
Tags Source
SHA-256 checksum
How to use checksums
cc78bee6f12a0ee9de1646298a05e1d600c40dd8069421f6421436d19052cd5e
BLAKE2b-256 checksum
How to use checksums
5b3939dff4b3a1e5bf54fdb787338fed04782055463e4cb7a1454db210303912
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Release files / emagine-0.1.0-py3-none-any.whl

Download URL emagine-0.1.0-py3-none-any.whl
Size 39.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
1bb3354f8b0ff1d479bab140f60b53e031ada471e429900a2fdccf3577c33deb
BLAKE2b-256 checksum
How to use checksums
8bb6c31c6187f7f295223631f50659b09add7f85d96df7fdbc52c04778622bb6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.10.4 {"installer":{"name":"uv","version":"0.10.4","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for emagine 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files No provenance

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