@terros-inc/cli 1.0.3 → 1.0.5

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 (4) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +121 -0
  3. package/package.json +24 -15
  4. package/terros.yml +1664 -1673
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Terros Inc
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,121 @@
1
+ # Terros CLI
2
+
3
+ Command-line interface for the Terros Sales platform.
4
+
5
+ ## Requirements
6
+
7
+ - Node.js 24 or newer
8
+ - A Terros account with access to the platform
9
+
10
+ ## Install
11
+
12
+ Install the CLI globally with your package manager:
13
+
14
+ ```sh
15
+ npm install -g @terros-inc/cli
16
+ ```
17
+
18
+ After installation, verify that the `terros` command is available:
19
+
20
+ ```sh
21
+ terros help
22
+ ```
23
+
24
+ ## Sign In
25
+
26
+ Authenticate before running Terros API commands:
27
+
28
+ ```sh
29
+ terros auth login
30
+ ```
31
+
32
+ The CLI opens a browser-based device login flow. Confirm that the code shown in
33
+ your browser matches the code printed in the terminal, then finish signing in.
34
+
35
+ To print the current API access token (for usage in scripts):
36
+
37
+ ```sh
38
+ terros auth token
39
+ ```
40
+
41
+ ## Find Commands
42
+
43
+ Terros CLI uses the pattern:
44
+
45
+ ```sh
46
+ terros <command> <subcommand> [parameters]
47
+ ```
48
+
49
+ List available commands:
50
+
51
+ ```sh
52
+ terros help
53
+ ```
54
+
55
+ List subcommands for a command:
56
+
57
+ ```sh
58
+ terros <command> help
59
+ ```
60
+
61
+ Show parameters for a subcommand:
62
+
63
+ ```sh
64
+ terros <command> <subcommand> help
65
+ ```
66
+
67
+ ## Run a Command
68
+
69
+ Pass parameters as flags:
70
+
71
+ ```sh
72
+ terros <command> <subcommand> --name "Acme Inc." --active true
73
+ ```
74
+
75
+ Parameter values are validated based on the Terros API schema. Supported values
76
+ include strings, numbers, booleans, arrays, and JSON objects.
77
+
78
+ Examples:
79
+
80
+ ```sh
81
+ terros <command> <subcommand> --count 10
82
+ terros <command> <subcommand> --active true
83
+ terros <command> <subcommand> --ids id_1,id_2,id_3
84
+ terros <command> <subcommand> --metadata '{"source":"cli"}'
85
+ ```
86
+
87
+ Responses are printed as formatted JSON.
88
+
89
+ ## Local Development
90
+
91
+ Install dependencies:
92
+
93
+ ```sh
94
+ pnpm install
95
+ ```
96
+
97
+ Build the CLI:
98
+
99
+ ```sh
100
+ pnpm build
101
+ ```
102
+
103
+ Run the CLI locally:
104
+
105
+ ```sh
106
+ node dist/index.js help
107
+ ```
108
+
109
+ The published `terros` executable loads the compiled code from `dist/index.js`,
110
+ so run `pnpm build` after changing TypeScript files.
111
+
112
+ ## Troubleshooting
113
+
114
+ If a command says the CLI is not authorized, sign in again:
115
+
116
+ ```sh
117
+ terros auth login
118
+ ```
119
+
120
+ If a token cannot be refreshed, the saved login may have expired. Run
121
+ `terros auth login` to create a new session.
package/package.json CHANGED
@@ -3,6 +3,15 @@
3
3
  "bin": {
4
4
  "terros": "./cli.js"
5
5
  },
6
+ "bugs": {
7
+ "url": "https://github.com/terros-inc/cli/issues"
8
+ },
9
+ "dependencies": {
10
+ "luxon": "^3.7.2",
11
+ "minimist": "^1.2.8",
12
+ "open": "^11.0.0",
13
+ "yaml": "^2.9.0"
14
+ },
6
15
  "description": "Command-line interface for Terros Sales platform",
7
16
  "devDependencies": {
8
17
  "@types/minimist": "^1.2.5",
@@ -10,13 +19,6 @@
10
19
  "typescript": "^6.0.3",
11
20
  "@types/luxon": "^3.7.1"
12
21
  },
13
- "keywords": [
14
- "terros",
15
- "cli"
16
- ],
17
- "license": "MIT",
18
- "main": "./dist/index.js",
19
- "name": "@terros-inc/cli",
20
22
  "engines": {
21
23
  "node": ">=24"
22
24
  },
@@ -25,19 +27,26 @@
25
27
  "terros.yml",
26
28
  "dist"
27
29
  ],
28
- "type": "module",
29
- "version": "1.0.3",
30
- "dependencies": {
31
- "luxon": "^3.7.2",
32
- "minimist": "^1.2.8",
33
- "open": "^11.0.0",
34
- "yaml": "^2.9.0"
35
- },
30
+ "homepage": "https://github.com/terros-inc/cli#readme",
31
+ "keywords": [
32
+ "terros",
33
+ "cli"
34
+ ],
35
+ "license": "MIT",
36
+ "main": "./dist/index.js",
37
+ "name": "@terros-inc/cli",
36
38
  "publishConfig": {
37
39
  "access": "public",
38
40
  "tag": "latest"
39
41
  },
42
+ "repository": {
43
+ "type": "git",
44
+ "url": "git+https://github.com/terros-inc/cli.git"
45
+ },
46
+ "type": "module",
47
+ "version": "1.0.5",
40
48
  "scripts": {
49
+ "fetch-openapi": "wget https://docs.terros.com/openapi/terros.yml",
41
50
  "build": "tsc",
42
51
  "start": "node src/index.ts"
43
52
  }