Configuration and State
Generate files with init
You can generate both config and state files interactively with init.
traduora init
Configuration file
Supported config files:
traduora.config.jsontraduora.config.tstraduora.config.jstraduora.config.mjstraduora.config.cjs
JSON example
{
"baseUrl": "https://app.traduora.co",
"auth": {
"grantType": "client_credentials",
"clientId": "your-client-id",
"clientSecret": "your-client-secret"
}
}
TypeScript example
export default ({ env }: { env: NodeJS.ProcessEnv }) => ({
baseUrl: env.TRADUORA_BASE_URL ?? "https://app.traduora.co",
auth: {
grantType: "client_credentials",
clientId: env.TRADUORA_CLIENT_ID,
clientSecret: env.TRADUORA_CLIENT_SECRET,
},
});
Environment variables
TRADUORA_BASE_URLTRADUORA_GRANT_TYPE(client_credentialsorpassword)TRADUORA_CLIENT_IDTRADUORA_CLIENT_SECRETTRADUORA_USERNAMETRADUORA_PASSWORDTRADUORA_ACCESS_TOKEN
State file
Default state file: .traduora.state.json
Example:
{
"currentProjectId": "0f5d...",
"currentLocale": "en_GB"
}
You can override state path per command with --state <path>.
Why commands sometimes do not require --locale
- Project-scoped commands use
currentProjectIdfrom state. --localeis optional ifcurrentLocaleis already set.
If required state is missing, the command fails with guidance.