Install
NightshiftApp, AgentConfig) and the CLI (nightshift command).
CLI workflow
Initialize a project
You’ll need a pyproject.toml in the root of your directory. This is how Nightshift knows your agent’s depedancies
Create the agent
Create a Python file with a
NightshiftApp and one or more @app.agent() functions:my_agent.py
- The function must be
async defand useyield(async generator) prompt: stris the only parameter it’s what the user passes to your function at runtime- Each
yieldsends an SSE event back to the caller - Yielded values can be dicts, dataclasses, or Pydantic models; they’re auto-serialized with a
typefield andtimestampadded if missing - Inside the VM, the workspace is always at
/workspaceYou’ll need a pyproject.toml in the root of your directory. This is how Nightshift knows your agent’s depedancies
Login
~/.nightshift/config.toml.If you’re running a self-hosted platform, replace
api.nightshift.sh with your server’s hostname or http://<IP>:3000.Deploy
@app.agent() functions, finds the project root (walks up to pyproject.toml)
, creates a tar.gz archive, and uploads to the platform.Run an agent
-f/--followstreams events to stdout in real time- Without
-f, prints the run ID and exits
Multiple agents per file
nightshift deploy uploads both. Each gets its own registry entry and can be run independently.
Custom agent names
my-custom-name, not internal_fn.