Transposit CLI
CLI for interacting with Transposit Hosted Applications.
Requirements
NodeJS >= 14.x
Installation / Upgrading
$ 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 themaster
branch currently pushed to your repository.For example, if you have a script
execute.py
, which callsapi.run("this.another_op")
, and you editexecute.py
andanother_op.py
, and then dotransposit run execute.py
, only the edits toexecute.py
will be picked up. To test both together, you'll need to push your changes by committing & pushing them tomaster
usinggit
before doing thetransposit run
. -
If you edit the
manifest.json
, e.g. to change the parameters that an operation takes, you likewise will need to commit and push before running.