CLI tool to sync and execute Triform projects
Project description
Triform CLI
A command-line tool to sync and execute Triform projects locally. Perfect for integrating with Cursor or any IDE.
Installation
From PyPI (Recommended)
pip install triform-cli
Or using pipx (isolated environment):
pipx install triform-cli
From GitHub
pip install git+https://github.com/triform/triform-cli.git
Development Install
git clone https://github.com/triform/triform-cli.git
cd triform-cli
pip install -e ".[dev]"
Quick Start
1. Authenticate
# Login with your session token from the browser
triform auth login --token YOUR_SESSION_TOKEN
To get your session token:
- Login to https://app.triform.ai
- Open browser DevTools (F12)
- Go to Application > Cookies
- Copy the value of
__Secure-better-auth.session_token
2. Pull a Project
# List your projects
triform projects list
# Pull a project to local files
triform projects pull <project-id>
This creates a local directory structure:
Triform/ # Root directory
└── OrgName/ # Organization
└── my-project/ # Project
├── .triform/
│ ├── config.json # Project & org ID mapping
│ └── state.json # Sync state
├── project.json # Project metadata & environment
├── requirements.json # Project requirements
├── actions/
│ └── my-action/
│ ├── source.py # Action code
│ ├── meta.json # Component metadata
│ ├── requirements.txt
│ ├── requirements.json # Component requirements
│ └── readme.md
├── flows/
│ └── my-flow/
│ ├── flow.json # Flow definition
│ ├── meta.json
│ ├── requirements.json
│ └── readme.md
└── agents/
└── my-agent/
├── agent.json # Agent configuration
├── meta.json
├── requirements.json
└── readme.md
Options:
--flat- Skip theTriform/Orgstructure--dir <path>- Specify a custom directory
3. Edit Locally
Edit your action code in actions/my-action/source.py or any other files.
4. Push Changes
# Push changes back to Triform
triform projects push
# Or watch for changes and auto-sync
triform projects watch
5. Execute Components
# Execute by component ID
triform execute <component-id> --payload '{"input": "value"}'
# Execute from local project by node key
triform execute my-action --payload '{"input": "value"}'
# Execute with real-time tracing
triform execute my-action --trace
# Execute by project path
triform execute <project-id>/my-action --payload '{}'
Commands
Authentication
triform auth login # Login with session token
triform auth logout # Clear authentication
triform auth status # Check auth status
triform auth whoami # Show user & organization info
Projects
triform projects list # List all projects
triform projects pull <id> # Pull project to local
triform projects push # Push local changes
triform projects watch # Watch and auto-sync
triform projects deploy # Deploy project
triform projects status # Show sync status
Components
triform component get <id> # Get component details
triform component build <id> # Build action dependencies
Execution
triform execute <target> # Execute a component
triform executions # List recent executions
Utilities
triform diff # Show local vs remote changes
Local Development Workflow
- Pull your project:
triform projects pull <id> - Open in Cursor/VS Code
- Edit action code locally
- Watch for auto-sync:
triform projects watch - Execute to test:
triform execute my-action --trace - Deploy when ready:
triform projects deploy
Environment Variables
You can also configure authentication via environment variables:
export TRIFORM_AUTH_TOKEN="your-session-token"
export TRIFORM_API_URL="https://app.triform.ai/api"
File Structure Details
Actions
source.py- Main Python coderequirements.txt- pip dependenciesmeta.json- Name, intention, runtime, I/O schemasreadme.md- Documentation
Flows
flow.json- Nodes, connections, I/Ometa.json- Name, intentionreadme.md- Documentationcomponents/- Resolved nested components (read-only)
Agents
agent.json- Model, prompts, settings, toolsmeta.json- Name, intentionreadme.md- Documentationcomponents/- Resolved nested components (read-only)
Contributing
Contributions welcome! See CONTRIBUTING.md for guidelines.
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file triform_cli-0.1.0.tar.gz.
File metadata
- Download URL: triform_cli-0.1.0.tar.gz
- Upload date:
- Size: 23.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c528521a0b96b4b059fa7f63f1336ff0320291c266a84821edf1e943864b2853
|
|
| MD5 |
0dfc9f4a9f3971f6e36e152da98fcb53
|
|
| BLAKE2b-256 |
798e68a43cf476a19294ac3f49c3f351264b83b7dd2f2836e6527e4153234dc7
|
File details
Details for the file triform_cli-0.1.0-py3-none-any.whl.
File metadata
- Download URL: triform_cli-0.1.0-py3-none-any.whl
- Upload date:
- Size: 25.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f5452fe499b73c102200348ffc1dd90927c2fc5189921fdbfd80466642273524
|
|
| MD5 |
838bfdbb513319f9fe8fde335ff03a7c
|
|
| BLAKE2b-256 |
00a6a80017fcb5da685babf3566493826f90033a9e10997ae6c7656d0e679b60
|