Simple command line tool to pull and push projects to and from Thunkable.
Thunkd requires Python 3.8, 3.9, 3.10 or 3.11. Python can be installed from here. Verify that the Python version by executing
python --version
If the Python version is incorrect, try
python3 --version
Pip is required to install the required dependencies. To install pip, execute
python -m ensurepip
After installing pip, execute the command
python -m pip install -r requirements.txt
in the top level of the repository to install the other dependencies.
In order to use Thunkd, you will need to configure your Thunk token. Execute the command
python thunkd.py set thunk_token <thunk_token>
where <thunk_token> is your Thunk token. See the FAQ for information on how to find your Thunk token.
To download a project, execute the command
python thunkd.py pull <project_id> <file_path>
where <project_id> is your project ID and <file_path> is the desired output directory. See the FAQ for information on how to find the project ID.
To push to a project, execute the command
python thunkd.py push <project_id> <file_path>
where <project_id> is your project ID and <file_path> is the project directory. See the FAQ for information on how to find the project ID.
The Thunk token can be found in the "https://x.thunkable.com/" cookie under the field "thunk_token". On Chrome, this can be found via the following procedure.
- Open a Thunkable project.
- Press F12 to open the developer console.
- On the top bar, click on the Application tab.
- On the side bar, click on Cookies and then "https://x.thunkable.com/".
- Scroll to find the "thunk_token" field. The value is your Thunk token.
Open your Thunkable project and examine the URL. The project ID appears after the "https://x.thunkable.com/projects/" portion of the project URL. For example, if the project URL is "https://x.thunkable.com/projects/1234567890abcdef12345678/12345678-90ab-cdef-1234-567890abcdef/designer", the project ID is "1234567890abcdef12345678".
Thunkable caches generated code in the project file. By default, thunkd strips this generated code when downloading to enable version control. This means that when you push to Thunkable, it cannot find the cached code. To regenerate the cached code, click through each screen on the blocks tab and everything should work fine.
After a push, some changes such as adding a Firebase API key might not be visible in the Thunkable UI. However, those values will be a part of the project as long as they are present in the JSON. It is important to test the functionality of your app frequently to address any problems as soon as they arise.