@localess/cli 0.0.1-dev.20260216094809 → 0.0.1-dev.20260216101417

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +51 -52
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,55 +8,54 @@
8
8
 
9
9
  # Localess Command Line
10
10
 
11
- This client SDK is designed to work with the Localess API. It provides a simple way to interact with the Localess API from your JavaScript or TypeScript application.
12
-
13
- > **Important:**
14
- > The Client is designed to be used on the server side only, as it requires your **Localess API Token** to be kept secret.
15
- > Do not use this client in your frontend application, as it exposes your API Token to the public.
16
-
17
- ## Installation
18
-
19
- ### NPM
20
- ````bash
21
- npm install @localess/js-client@latest
22
- ````
23
-
24
- ### Yarn
25
- ````bash
26
- yarn add @localess/js-client@latest
27
- ````
28
-
29
- ## Client
30
-
31
- ````ts
32
- import {localessClient} from "@localess/js-client";
33
-
34
- const llClient = localessClient({
35
- // A fully qualified domain name with protocol (http/https) and port.
36
- origin: 'https://my-localess.web.app',
37
- // Localess space ID, cna be found in the Localess Space settings
38
- spaceId: 'I1LoVe2LocaLess4Rever',
39
- // Localess API token, can be found in the Localess Space settings
40
- token: 'Baz00KaT0KeN8S3CureLL'
41
- });
42
-
43
- // Fetch all Content Links
44
- llClient.getLinks()
45
- // Fetch content by SLUG
46
- llClient.getContentBySlug('docs/overview')
47
- // Fetch content by ID
48
- llClient.getContentById('FRnIT7CUABoRCdSVVGGs')
49
- // Fetch translations by locale
50
- llClient.getTranslations('en')
51
- ````
52
-
53
- ## Sync with Visual Editor
54
-
55
- It will automatically inject Localess Sync Script in to the HTML page.
56
-
57
- ````ts
58
- import {loadLocalessSync} from "@localess/js-client";
59
-
60
- // A fully qualified domain name with protocol (http/https) and port.
61
- loadLocalessSync('https://my-localess.web.app')
62
- ````
11
+ A powerful CLI tool to interact with your Localess spaces.
12
+
13
+ ## Features
14
+
15
+ - 🔐 **Authentication** - Secure login system and CI environments.
16
+ - 🛡️ **Type Safety** - Generate TypeScript type definitions for your Localess content schemas, ensuring type safety in your frontend applications.
17
+ - 🌐 **Translations** - Sync and manage translations for your Localess space.
18
+
19
+ ## Setup
20
+
21
+ ```bash
22
+ npm install @localess/cli -D
23
+ ```
24
+
25
+ ## Login
26
+ The CLI provides a `login` command to authenticate with your Localess account. This command prompts you for your email and password, and securely stores an authentication token for future API requests.
27
+ ### Usage
28
+
29
+ #### Login with your Localess from CLI:
30
+ ```bash
31
+ localess login --origin <localess_api_origin> --space <space_id> --token <space_access_token>
32
+ ```
33
+ #### Login with your Localess with environment variables:
34
+ ```bash
35
+ export LOCALESS_ORIGIN=<localess_api_origin>
36
+ export LOCALESS_SPACE=<space_id>
37
+ export LOCALESS_TOKEN=<space_access_token>
38
+ localess login
39
+ ```
40
+
41
+ ## Logout
42
+ The CLI provides a `logout` command to clear your authentication token and log you out of your Localess account.
43
+ ### Usage
44
+ ```bash
45
+ localess logout
46
+ ```
47
+
48
+ ## Generate TypeScript Types
49
+
50
+ The CLI provides a `types` command to generate TypeScript definitions for your Localess content schemas. This command fetches your space's OpenAPI schema and writes a `localess.d.ts` file to your project, allowing for strong typing in your codebase.
51
+
52
+ ### Usage
53
+
54
+ ```bash
55
+ localess types
56
+ ```
57
+
58
+ - You must be logged in (`localess login`) before running this command.
59
+ - The generated types file will be saved as `./.localess/localess.d.ts` in your current working directory.
60
+
61
+ You can then import these types in your TypeScript project for improved type safety when working with Localess content.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@localess/cli",
3
- "version": "0.0.1-dev.20260216094809",
3
+ "version": "0.0.1-dev.20260216101417",
4
4
  "description": "Localess Command Line.",
5
5
  "keywords": [
6
6
  "localess",