Look for our command-line tool packaged as a Docker image. It’s perfect if you need a platform-independent way to import and export data with Lokalise. See usage examples below.

Export from Lokalise to local directory

API_TOKEN=<your api token>
PROJECT_ID=<project id>
LOCAL_DIR=/tmp
FILE_FORMAT=json
   
docker run \
    -v /tmp/locale:/opt/dest \
    lokalise/lokalise-cli-2 lokalise2 \
    --token <token> \
    --project-id <project_id:branch> \
    file download \
    --format json \
    --unzip-to /opt/dest

Import local file to Lokalise

API_TOKEN=<your api token>
PROJECT_ID=<project id>
LOCAL_FILE=/tmp/en.json
LANG_ISO=en
   
docker run \
    -v /tmp/en.json:/opt/src/en.json \
    lokalise/lokalise-cli-2 lokalise2 \
    --token <token> \
    --project-id <project_id:branch> \
    file upload \
    --file /opt/src/en.json \
    --lang-iso en
Did this answer your question?