@api-now/cli 1.10.0 → 1.11.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.
- package/README.md +32 -16
- package/dist/index.js +30 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -33,53 +33,69 @@ Once installed, the CLI is available as the `apinow` command.
|
|
|
33
33
|
|
|
34
34
|
All commands support the following global options (which can be specified before or after any subcommand):
|
|
35
35
|
|
|
36
|
-
- `--api-url <url>`: Override the target API Server URL (Default: `http://localhost:8080`).
|
|
37
36
|
- `--format <text|json>`: Define the output layout (Default: `text`).
|
|
38
37
|
- `--debug` / `-v, --verbose`: Enable debug/verbose logging.
|
|
39
38
|
|
|
40
39
|
### 1. Configuration (`config`)
|
|
41
40
|
|
|
42
|
-
Read and
|
|
41
|
+
Read and manage CLI configurations stored in the OS settings folder depending on the platform:
|
|
43
42
|
|
|
44
43
|
- **Linux**: `~/.config/apinow-cli/config.json` (or respects `$XDG_CONFIG_HOME`)
|
|
45
44
|
- **macOS**: `~/Library/Preferences/apinow-cli/config.json`
|
|
46
45
|
- **Windows**: `%APPDATA%\apinow-cli\config.json`
|
|
47
46
|
|
|
48
47
|
> [!TIP]
|
|
49
|
-
> **Local Project Configuration**:
|
|
50
|
-
>
|
|
48
|
+
> **Local Project Configuration (Single Source of Truth)**:
|
|
49
|
+
> 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.
|
|
50
|
+
>
|
|
51
|
+
> 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
52
|
|
|
52
53
|
```bash
|
|
53
|
-
# Get a configuration property (e.g. apiUrl, defaultOrg)
|
|
54
|
+
# Get a configuration property (e.g. apiUrl, defaultOrg, activeProfile)
|
|
54
55
|
apinow config get <key>
|
|
55
56
|
|
|
56
|
-
# Set a configuration property
|
|
57
|
-
apinow config set <key> <value>
|
|
58
|
-
|
|
59
|
-
# List all current configuration settings
|
|
60
|
-
apinow config list
|
|
61
|
-
|
|
62
57
|
# Reset configuration to default values
|
|
63
58
|
apinow config reset
|
|
64
59
|
```
|
|
65
60
|
|
|
66
61
|
### 2. Authentication (`auth`)
|
|
67
62
|
|
|
68
|
-
Securely log in to the API platform using OAuth2.
|
|
63
|
+
Securely log in to the API Now platform using OAuth2.
|
|
69
64
|
|
|
70
65
|
```bash
|
|
71
|
-
# Log in using Google, GitHub, or LinkedIn
|
|
66
|
+
# Log in using Google, GitHub, or LinkedIn (defaults to 'default' profile)
|
|
72
67
|
apinow auth login <google|github|linkedin>
|
|
73
68
|
|
|
74
|
-
#
|
|
69
|
+
# Log in under a specific profile alias with an optional custom API URL
|
|
70
|
+
apinow auth login google --profile work --api-url https://api.apinow.app
|
|
71
|
+
|
|
72
|
+
# Verify current authentication status and active profile details
|
|
75
73
|
apinow auth status
|
|
76
74
|
|
|
77
|
-
# Log out and
|
|
78
|
-
apinow auth logout
|
|
75
|
+
# Log out and remove credentials for the active profile (or a specified profile)
|
|
76
|
+
apinow auth logout [--profile <name>]
|
|
79
77
|
```
|
|
80
78
|
|
|
81
79
|
_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
80
|
|
|
81
|
+
#### Authentication Profiles (`auth profile`)
|
|
82
|
+
|
|
83
|
+
Manage multiple authentication profiles to switch seamlessly between organizations or accounts.
|
|
84
|
+
|
|
85
|
+
```bash
|
|
86
|
+
# List all configured authentication profiles (active profile marked with *)
|
|
87
|
+
apinow auth profile list
|
|
88
|
+
|
|
89
|
+
# Switch to a different profile
|
|
90
|
+
apinow auth profile use <profile_name>
|
|
91
|
+
|
|
92
|
+
# Switch to a profile and verify that its authentication token is still valid
|
|
93
|
+
apinow auth profile use <profile_name> --verify
|
|
94
|
+
|
|
95
|
+
# Delete a configured profile
|
|
96
|
+
apinow auth profile delete <profile_name>
|
|
97
|
+
```
|
|
98
|
+
|
|
83
99
|
#### Personal Access Tokens (`auth tokens`)
|
|
84
100
|
|
|
85
101
|
Generate and manage Personal Access Tokens (PATs) for programmatic access.
|