Repository navigation
Closed
Labels
Description
Summary
Implement the simplest possible onboarding flow for deploying an agent to a hosted Trinity instance:
pip install trinity-cli
trinity init
trinity deploy .No GitHub knowledge required. No manual MCP configuration. Three commands from zero to deployed agent.
Requirements
1. trinity deploy . CLI command
File: src/cli/trinity_cli/commands/deploy.py (new)
- Tar + base64 encode local directory (respecting
.gitignore, excluding.git/,node_modules/,.env) - POST to
/api/agents/deploy-local(endpoint already exists) - On first deploy: create agent, write
.trinity-remote.yamltracking file - On subsequent deploys: detect
.trinity-remote.yaml, redeploy to same instance/agent (idempotent update) - Add
.trinity-remote.yamlto.gitignoreautomatically if git repo detected - Support
--nameflag to override agent name (default: directory name) - Support
--repo user/repoflag to use an existing public GitHub repo instead of file-based deploy
Tracking file format (.trinity-remote.yaml):
# Auto-generated by trinity deploy — do not edit
instance: https://trinity.example.com
agent: my-agent
profile: production
deployed_at: 2026-04-03T15:45:00Z2. Agent limit enforcement (3 per user default)
Files: src/backend/services/agent_service/crud.py, src/backend/services/agent_service/deploy.py
- Add per-user agent count check in
create_agent_internal()(after duplicate name check, ~line 89) - Add same check in
deploy_local_agent_logic()(before callingcreate_agent_fn()) - Use existing
get_agents_by_owner()for count - Default limit: 3 agents per user
- Make configurable via settings (e.g.,
MAX_AGENTS_PER_USERin settings table) - Return HTTP 429 with clear message: "Agent quota exceeded. Maximum 3 agents per user. Delete an agent to create a new one."
- No database schema changes needed —
agent_ownershiptable already tracks this
3. MCP key auto-provisioning in trinity init
File: src/cli/trinity_cli/commands/auth.py
After successful login in trinity init / trinity login:
- Call
POST /api/mcp/keys/ensure-default(endpoint already exists) - Store MCP API key in the profile within
~/.trinity/config.json - Optionally write/merge Trinity MCP server config into local
.mcp.jsonso Claude Code can connect immediately
Result: After trinity init, the user's local Claude Code automatically has MCP access to Trinity. Zero manual configuration.
4. Abilities plugin uses CLI credentials
Repo: abilityai/abilities (trinity-onboard plugin)
trinity-onboard:onboardshould check~/.trinity/config.jsonfor active profile before prompting for credentials- Credential resolution:
TRINITY_API_KEYenv var →~/.trinity/config.jsonactive profile → prompt user - Deploy step should call
trinity deploy .(the CLI command) instead of reimplementing tar+upload via MCP - Plugin reads/writes
.trinity-remote.yamlas the shared tracking file
Architecture
User's local machine Hosted Trinity instance
┌─────────────────────┐ ┌──────────────────────┐
│ ~/my-agent/ │ │ │
│ CLAUDE.md │ trinity │ POST /api/agents/ │
│ .claude/ │ deploy . │ deploy-local │
│ template.yaml │ ──────────────>│ │
│ .trinity-remote.yaml (tracking) │ Agent container │
│ │ │ created & running │
│ ~/.trinity/ │ │ │
│ config.json │ trinity init │ POST /api/access/ │
│ (JWT + MCP key) │ <────────────> │ request + verify │
└─────────────────────┘ └──────────────────────┘
Existing infrastructure (no changes needed)
| Component | Status |
|---|---|
POST /api/agents/deploy-local |
✅ Exists |
POST /api/mcp/keys/ensure-default |
✅ Exists |
POST /api/access/request (auto-whitelist) |
✅ Exists |
get_agents_by_owner() DB method |
✅ Exists |
~/.trinity/config.json profile system |
✅ Exists |
trinity-cli on PyPI |
✅ Published |
Acceptance criteria
-
pip install trinity-cli && trinity init && trinity deploy .works end-to-end on a hosted instance - Second
trinity deploy .updates the same agent (idempotent via.trinity-remote.yaml) - User cannot create more than 3 agents (clear error message with count)
- After
trinity init, MCP key is stored in profile and.mcp.jsonis configured - Abilities plugin detects CLI credentials and skips auth prompts
- No GitHub account or knowledge required for the default flow
Implementation order
- Agent limit enforcement (backend, small)
- MCP key provisioning in
trinity init(CLI, small) trinity deploy .command (CLI, medium).trinity-remote.yamltracking file (CLI, small)- Abilities plugin credential sharing (abilities repo, small)
Activity
feat(cli): trinity deploy . — file-based agent deployment with tracki…
feat(cli): trinity deploy . — file-based deployment with tracking, li…
Add CLI credential sharing and deploy delegation to trinity-onboard
feat(grid): widget chassis — InfoTile, GRID_WIDGETS registry, layout …
fix(grid): point tile components at tokens that exist, in both themes…
feat(grid): widget chassis — InfoTile, GRID_WIDGETS registry, layout …
fix(grid): point tile components at tokens that exist, in both themes…
fix(grid): the fleet tile linked to a route that does not exist (ent#…
feat(grid): widget chassis — InfoTile, GRID_WIDGETS registry, layout …