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

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 +46 -52
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -8,55 +8,49 @@
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
+
20
+ ## Login
21
+ 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.
22
+ ### Usage
23
+
24
+ #### Login with your Localess from CLI:
25
+ ```bash
26
+ localess login --origin <localess_api_origin> --space <space_id> --token <space_access_token>
27
+ ```
28
+ #### Login with your Localess with environment variables:
29
+ ```bash
30
+ export LOCALESS_ORIGIN=<localess_api_origin>
31
+ export LOCALESS_SPACE=<space_id>
32
+ export LOCALESS_TOKEN=<space_access_token>
33
+ localess login
34
+ ```
35
+
36
+ ## Logout
37
+ The CLI provides a `logout` command to clear your authentication token and log you out of your Localess account.
38
+ ### Usage
39
+ ```bash
40
+ localess logout
41
+ ```
42
+
43
+ ## Generate TypeScript Types
44
+
45
+ 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.
46
+
47
+ ### Usage
48
+
49
+ ```bash
50
+ localess types
51
+ ```
52
+
53
+ - You must be logged in (`localess login`) before running this command.
54
+ - The generated types file will be saved as `./.localess/localess.d.ts` in your current working directory.
55
+
56
+ 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.20260216100707",
4
4
  "description": "Localess Command Line.",
5
5
  "keywords": [
6
6
  "localess",