Transposit CLI
CLI for interacting with Transposit Hosted Applications.
Requirements
NodeJS >= 14.x
Installation
$ npm i -g @transposit/cli
Setup
- Go to https://console.transposit.com/dev/settings and login
- Note your "Username" at the top of the page
- Copy (Generating a new one if needed) your "User Api Key" at the bottom
of the page
- Run
transposit login $username $token
using the values from steps 2 & 3 - The first time you clone a repo, you will need to login separately to git,
using the same username, and the "Git access token" near the top of the page
Usage
$ transposit help
...
$ transposit clone myteam hello_world
🐙 $ git clone https://console.transposit.com/git/myteam/hello_world
Cloning into 'hello_world'...
remote: Counting objects: 231, done
remote: Finding sources: 100% (231/231)
remote: Getting sizes: 100% (54/54)
remote: Total 231 (delta 116), reused 231 (delta 116)
Receiving objects: 100% (231/231), 27.34 KiB | 756.00 KiB/s, done.
Resolving deltas: 100% (116/116), done.
$ cd hello_world
$ transposit login myuser *****
$ transposit run src/input_prompt.py
{
"type": "section",
"text": {
"type": "plain_text",
"text": "This action is going to output 'Hello world'"
}
}
Important Notes
-
If you edit multiple operation files at the same time, only the one
passed as an argument to transposit run
(the "entry point") will run the
code from your local directory. All other operations which that script
invokes will be run from the master
branch currently pushed to
your repository.
For example, if you have a script execute.py
, which calls
api.run("this.another_op")
, and you edit execute.py
and another_op.py
,
and then do transposit run execute.py
, only the edits to execute.py
will be picked up. To test both together, you'll need to push your changes
by committing & pushing them to master
using git
before doing the
transposit run
.