tine run

tine run either executes a Python script that produces a Run object or wraps an external CLI harness and records its observable events as a .tine graph.

Usage

Terminal
tine run <script.py>
tine run --harness <name> --prompt <task> [--save <path>]

Python Script Mode

Without --harness, the CLI executes the script in-process, scans module-level variables for a Run, and saves it under .tine_runs/.

research.py
1from opentine import Agent
2from opentine.models.anthropic import Anthropic
3from opentine.tools.search import search
4from opentine.tools.web import fetch
5
6agent = Agent(
7    model=Anthropic("claude-sonnet-4-20250514"),
8    tools=[search, fetch],
9)
10
11# tine run looks for a Run object in module scope.
12run = agent.run_sync("Research quantum computing breakthroughs")
Terminal
tine run research.py

Harness Mode

Harness mode starts a supported external CLI, parses JSONL or text output, records model/tool/error/done steps, and saves the resulting run. The current harness names are codex, kimi-code, generic, claude-code, cursor, hermes, openclaw, opencode, and pi.

Codex and Kimi Code are validated targets in the current beta audit environment. The other named profiles are scoped compatibility targets until their local live gates pass.

Terminal
tine run --harness codex --prompt "Inspect this repository" --save codex_run.tine
tine run --harness kimi-code --prompt "Summarize README.md" --harness-login-env
tine run --harness generic --harness-command "your-agent run" --prompt "Fix tests" --cwd .

Harness Options

Options
--harness codex|kimi-code|generic|claude-code|cursor|hermes|openclaw|opencode|pi
--prompt "Task for the harness"
--save run.tine
--cwd /path/to/project
--harness-command "custom executable and base args"
--harness-login-env
--harness-env NAME
--harness-arg VALUE
  • --harness-command overrides the default command. It is required for generic and pi.
  • --harness-login-env passes only login/config variables such as PATH, home directories, XDG directories, and harness-specific config keys.
  • --harness-env NAME allows additional environment variables when login-env mode is enabled. Repeat it for multiple names.
  • --harness-arg VALUE appends one extra argument to the harness command. Repeat it for multiple arguments.
  • --cwd sets the subprocess working directory.

Example Output

Terminal
# Running codex harness...

Saved: codex_run.tine

# 4f1d5aa81392  model=codex  steps=6  cost=$0.0000  completed
|-- # 2b098c7d2a40 model
|-- * 53c2e19a84ac think  "Reading repository files..."
|-- > 12df5bde8831 tool   shell(command="rg --files")
`-- + 0cc7036e16f7 done   "Repository inspected."