i18nexus-cli
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -10,2 +10,3 @@ #!/usr/bin/env node | ||
const importJson = require('../commands/importJson'); | ||
const addNamespace = require('../commands/addNamespace'); | ||
@@ -197,2 +198,24 @@ // Using Next's env variable loader because | ||
program | ||
.command('add-namespace <namespaceTitle>') | ||
.alias('a-ns') | ||
.description('Add a new namespace to your project') | ||
.requiredOption( | ||
'-k, --api-key <apiKey>', | ||
'The API key for your project', | ||
process.env.I18NEXUS_API_KEY | ||
) | ||
.requiredOption( | ||
'-t, --pat <personalAccessToken>', | ||
'A personal access token generated for your account in i18nexus', | ||
process.env.I18NEXUS_PERSONAL_ACCESS_TOKEN | ||
) | ||
.action((namespaceTitle, options) => { | ||
addNamespace({ | ||
title: namespaceTitle, | ||
apiKey: options.apiKey, | ||
pat: options.pat | ||
}); | ||
}); | ||
program.parse(process.argv); |
{ | ||
"name": "i18nexus-cli", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "Command line interface (CLI) for accessing the i18nexus API", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -228,1 +228,26 @@ # i18nexus-cli | ||
If any keys already exist in the target namespace, overwrite the values with the imported values. | ||
## Adding new namespaces | ||
`i18nexus add-namespace <namespaceTitle>` | ||
```sh | ||
i18nexus add-namespace common -k <PROJECT_API_KEY> -t <YOUR_PERSONAL_ACCESS_TOKEN> | ||
``` | ||
The above snippet will create a new namespace in your i18nexus project with the title `common`. | ||
### Options | ||
| Option | Required? | | ||
| ------------------- | --------- | | ||
| `--api-key` or `-k` | ✔ | | ||
| `--pat` or `-t` | ✔ | | ||
### Notes | ||
`--api-key` | ||
Your project API key (Can also be set using environment variable `I18NEXUS_API_KEY`) | ||
`--pat` | ||
A personal access token that you have generated in your i18nexus account (Can also be set using environment variable `I18NEXUS_PERSONAL_ACCESS_TOKEN`) |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
23288
13
460
253
2
20