babli
v0.1.0
Published
Use Babli.ai from your commandline. Sync your project with Babli.
Readme
Babli CLI
Use Babli.ai from your commandline. Sync your project with Babli.
Use
When you have new keys to translate. Add them to one of your translation files. And then
- run
babli loginif you haven't already babli push- push new keys/translations to Babli.ai- translate them on babli.ai
babli pull- pull the new translations to your project
Install
npm install -g babliWorkspace development
Terminal 1:
cd apps/cli
npm link
cd ../..
pnpm cli:watchTerminal 2:
chmod +x apps/cli/dist/index.js
hash -r
babli --versionbabli --version should show a -dev suffix while you are using the local watch build, plus the repo root folder name so you can tell which worktree is linked.
If you see zsh: permission denied: babli, rerun chmod +x apps/cli/dist/index.js.
If you only need a one-time local install snapshot, use:
pnpm cli:install-localRelease
CLI releases are published from GitHub Actions with npm trusted publishing.
- Bump
apps/cli/package.jsonversion in a normal PR. - Merge to
main. - Create and push a tag that matches the CLI version:
git tag cli-v0.0.18
git push origin cli-v0.0.18The publish workflow:
- only runs for
cli-v*tags - verifies the tag matches
apps/cli/package.json - runs CLI and shared-package checks
- publishes
apps/clito npm from CI
Before this works, configure npm trusted publishing for the babli package to trust:
- repository: this repo
- workflow file:
publish-cli.yml - environment:
npm-publish
If the version is a prerelease such as 0.1.0-beta.1, CI publishes it under the matching npm dist-tag such as beta.
Use in CI
- set
BABLI_API_KEYenv variable (find it in your project settings) - run
babli pullto pull translations from babli.ai
Automatic Setup (coming soon)
create new Babli.ai project and connect it to your local project
babli create-projectManual Setup
- Create a
babli.jsonorbabli.yamlfile in the root of your project - Create an empty project in babli.ai and get your projectId
- Add your projectId and translation file path pattern
{ "projectId": "<your projectId>", "translationFiles": [{ "path": "src/translations/{{lang}}.json" }] } - Then you can push your keys from your project
babli push
