@api-now/cli 1.10.0 → 1.12.0

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 (3) hide show
  1. package/README.md +103 -22
  2. package/dist/index.js +34 -34
  3. package/package.json +1 -1
package/README.md CHANGED
@@ -10,7 +10,8 @@ The **API NOW! CLI** is a robust, cross-platform command-line tool designed to m
10
10
  - **Interactive Onboarding**: Guided setup prompts for first-time users to configure organization names and slugs (validated against reserved keywords/taken values).
11
11
  - **Default Organization Management**: List organizations and pin a default workspace ID.
12
12
  - **Metadata and Media Uploads**: Create, list, and read blueprints, domains, and multimedia assets.
13
- - **Data Domain Management & Publishing**: Mutate data domains via declarative JSON patch diffing, transition data domain lifecycles (`draft`, `committed`, `published`), bump versions, run pre-publish validation, and publish domains directly to the Data Catalog.
13
+ - **Data Domain Management & Publishing**: Search, list, create, mutate via declarative JSON patch diffing, transition lifecycles (`draft`, `committed`, `published`), bump versions, run pre-publish validation, and publish domains directly to the Data Catalog.
14
+ - **API Model Management**: Search, list, create, and read API Model files and schemas with immediate parent folder resolution.
14
15
  - **Local & Remote Schema Validation**: Validate Data Domain and API Model schemas from local files, STDIN, or directly from remote organization files.
15
16
  - **Data Catalog Publishing**: Publish schemas and datasets to the global/private catalog with automatic semantic versioning support, deprecation, and unpublishing.
16
17
  - **Developer Formatting Options**: Toggle outputs between human-friendly ASCII tables and machine-readable JSON.
@@ -33,53 +34,69 @@ Once installed, the CLI is available as the `apinow` command.
33
34
 
34
35
  All commands support the following global options (which can be specified before or after any subcommand):
35
36
 
36
- - `--api-url <url>`: Override the target API Server URL (Default: `http://localhost:8080`).
37
37
  - `--format <text|json>`: Define the output layout (Default: `text`).
38
38
  - `--debug` / `-v, --verbose`: Enable debug/verbose logging.
39
39
 
40
40
  ### 1. Configuration (`config`)
41
41
 
42
- Read and write persistent CLI configurations stored in the OS settings folder depending on the platform:
42
+ Read and manage CLI configurations stored in the OS settings folder depending on the platform:
43
43
 
44
44
  - **Linux**: `~/.config/apinow-cli/config.json` (or respects `$XDG_CONFIG_HOME`)
45
45
  - **macOS**: `~/Library/Preferences/apinow-cli/config.json`
46
46
  - **Windows**: `%APPDATA%\apinow-cli\config.json`
47
47
 
48
48
  > [!TIP]
49
- > **Local Project Configuration**:
50
- > The CLI and MCP server both support local project-level configuration overrides. If a file named `apinow.json` or `.apinowrc.json` is found in the current working directory or any parent directories, its settings are loaded and merged, with local keys overriding global config settings. This is useful for project-specific settings (like pointing to a local development API URL) without changing global config files.
49
+ > **Local Project Configuration (Single Source of Truth)**:
50
+ > When a file named `apinow.json` or `.apinowrc.json` is found in the current working directory or any parent directories, it is treated as the complete, authoritative single source of truth (SSOT) configuration for the project, replacing the global configuration. This allows project-local test environments with dedicated endpoints, tokens, or organizations without polluting your global configuration.
51
+ >
52
+ > Note that CLI write commands (such as `apinow auth login` and `apinow orgs set-default`) persist updates to your global configuration and will not modify tracked project files.
51
53
 
52
54
  ```bash
53
- # Get a configuration property (e.g. apiUrl, defaultOrg)
55
+ # Get a configuration property (e.g. apiUrl, defaultOrg, activeProfile)
54
56
  apinow config get <key>
55
57
 
56
- # Set a configuration property
57
- apinow config set <key> <value>
58
-
59
- # List all current configuration settings
60
- apinow config list
61
-
62
58
  # Reset configuration to default values
63
59
  apinow config reset
64
60
  ```
65
61
 
66
62
  ### 2. Authentication (`auth`)
67
63
 
68
- Securely log in to the API platform using OAuth2.
64
+ Securely log in to the API Now platform using OAuth2.
69
65
 
70
66
  ```bash
71
- # Log in using Google, GitHub, or LinkedIn
67
+ # Log in using Google, GitHub, or LinkedIn (defaults to 'default' profile)
72
68
  apinow auth login <google|github|linkedin>
73
69
 
74
- # Verify current authentication status and user identity details
70
+ # Log in under a specific profile alias with an optional custom API URL
71
+ apinow auth login google --profile work --api-url https://api.apinow.app
72
+
73
+ # Verify current authentication status and active profile details
75
74
  apinow auth status
76
75
 
77
- # Log out and erase stored authentication tokens
78
- apinow auth logout
76
+ # Log out and remove credentials for the active profile (or a specified profile)
77
+ apinow auth logout [--profile <name>]
79
78
  ```
80
79
 
81
80
  _Note: On your first login or checking status with no registered organization, an interactive step will automatically guide you through creating your first organization with live slug verification._
82
81
 
82
+ #### Authentication Profiles (`auth profile`)
83
+
84
+ Manage multiple authentication profiles to switch seamlessly between organizations or accounts.
85
+
86
+ ```bash
87
+ # List all configured authentication profiles (active profile marked with *)
88
+ apinow auth profile list
89
+
90
+ # Switch to a different profile
91
+ apinow auth profile use <profile_name>
92
+
93
+ # Switch to a profile and verify that its authentication token is still valid
94
+ apinow auth profile use <profile_name> --verify
95
+
96
+ # Delete a configured profile
97
+ apinow auth profile delete <profile_name>
98
+ ```
99
+
83
100
  #### Personal Access Tokens (`auth tokens`)
84
101
 
85
102
  Generate and manage Personal Access Tokens (PATs) for programmatic access.
@@ -137,20 +154,32 @@ Manage Data Domain files, lifecycles, and catalog publications.
137
154
 
138
155
  #### List Data Domains (`domain list`)
139
156
 
140
- List all Data Domain files in an organization.
157
+ List all Data Domain files in an organization (flat listing across all folders with immediate parent folder resolution).
141
158
 
142
159
  ```bash
143
160
  # List all domain files in an organization
144
161
  apinow domain list [--org <org_id>] [--parent <parent_id>]
145
162
  ```
146
163
 
164
+ #### Search Data Domains (`domain search`)
165
+
166
+ Search for Data Domain files by name or keyword across the organization.
167
+
168
+ ```bash
169
+ # Search for domain files matching a query keyword
170
+ apinow domain search "Billing" [--org <org_id>]
171
+
172
+ # Search with explicit query keywords and folder/result limits
173
+ apinow domain search --query Billing Payments --parent <parent_id> --limit 10
174
+ ```
175
+
147
176
  #### Create Data Domain (`domain create`)
148
177
 
149
178
  Create a new Data Domain file record in your organization, with optional local schema or STDIN upload.
150
179
 
151
180
  ```bash
152
181
  # Create a data domain metadata record
153
- apinow domain create --name "Billing Domain" [--org <org_id>]
182
+ apinow domain create --name "Billing Domain" [--org <org_id>] [--parent <parent_id>]
154
183
 
155
184
  # Create a data domain and upload local schema media
156
185
  apinow domain create --name "Billing Domain" --media ./domain.json [--org <org_id>]
@@ -232,7 +261,59 @@ apinow domain publish --file <file_id> --ver 1.0.0 --scope public --name "Billin
232
261
  # --changelog <changelog> Changelog description for this version
233
262
  ```
234
263
 
235
- ### 6. Schema Validation (`validate`)
264
+ ### 6. API Models (`api`)
265
+
266
+ Manage API model files and schema definitions.
267
+
268
+ #### List API Models (`api list`)
269
+
270
+ List all API model files in an organization (flat listing across all folders with immediate parent folder resolution).
271
+
272
+ ```bash
273
+ # List all API model files in an organization
274
+ apinow api list [--org <org_id>] [--parent <parent_id>]
275
+ ```
276
+
277
+ #### Search API Models (`api search`)
278
+
279
+ Search for API model files by name or keyword across the organization.
280
+
281
+ ```bash
282
+ # Search for API model files matching a query keyword
283
+ apinow api search "Payments" [--org <org_id>]
284
+
285
+ # Search with explicit query keywords and folder/result limits
286
+ apinow api search --query Payments Billing --parent <parent_id> --limit 10
287
+ ```
288
+
289
+ #### Create API Model (`api create`)
290
+
291
+ Create a new API model file record in your organization, with optional local schema or STDIN upload.
292
+
293
+ ```bash
294
+ # Create an API model metadata record
295
+ apinow api create --name "Payments API" [--org <org_id>] [--parent <parent_id>]
296
+
297
+ # Create an API model and upload local schema media (validates Core#ApiModel schema)
298
+ apinow api create --name "Payments API" --media ./api.json [--org <org_id>]
299
+
300
+ # Create an API model with schema piped from STDIN
301
+ cat ./api.json | apinow api create --name "Piped API" --stdin [--org <org_id>]
302
+ ```
303
+
304
+ #### Read API Model (`api read`)
305
+
306
+ Read API model file metadata or schema media content.
307
+
308
+ ```bash
309
+ # Read API model file metadata
310
+ apinow api read --file <file_id> [--org <org_id>]
311
+
312
+ # Read API model schema media content (JSON)
313
+ apinow api read --file <file_id> --media [--org <org_id>]
314
+ ```
315
+
316
+ ### 7. Schema Validation (`validate`)
236
317
 
237
318
  Validate local or remote Data Domain and API Model schemas against syntax, modeling rules, and naming conventions.
238
319
 
@@ -250,7 +331,7 @@ cat domain.json | apinow validate --stdin
250
331
  apinow validate --org <org_id> --fid <file_id>
251
332
  ```
252
333
 
253
- ### 7. Data Catalog (`catalog`)
334
+ ### 8. Data Catalog (`catalog`)
254
335
 
255
336
  Publish, inspect, and manage published catalog items.
256
337
 
@@ -274,7 +355,7 @@ apinow catalog deprecate <catalog_key> --reason "Superseded by v2" [--ver <versi
274
355
  apinow catalog unpublish <catalog_key> [--ver <version>]
275
356
  ```
276
357
 
277
- ### 8. Runtime (`runtime`)
358
+ ### 9. Runtime (`runtime`)
278
359
 
279
360
  Administrative operations for the API runtime. This command allows API Now! platform managers and administrators to modify runtime users directly.
280
361