@customerio/cli 0.0.12 → 0.0.13
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 +34 -0
- package/package.json +7 -7
package/README.md
CHANGED
|
@@ -93,6 +93,39 @@ cio auth logout
|
|
|
93
93
|
When you use `CIO_TOKEN` or `--token` directly on normal commands, you may
|
|
94
94
|
also need `CIO_REGION=us|eu` or `--api-url`.
|
|
95
95
|
|
|
96
|
+
### Profiles
|
|
97
|
+
|
|
98
|
+
Keep multiple credential sets — production, staging, several client accounts —
|
|
99
|
+
in one config file and switch between them. Each profile has its own token,
|
|
100
|
+
region, and optional custom base URL.
|
|
101
|
+
|
|
102
|
+
```bash
|
|
103
|
+
# Log into a named profile (custom --api-url is remembered; switches to it)
|
|
104
|
+
echo "$STAGING_TOKEN" | cio auth login --profile staging --with-token --api-url https://<staging-host>
|
|
105
|
+
|
|
106
|
+
# List profiles (the saved default is marked current)
|
|
107
|
+
cio profile list
|
|
108
|
+
|
|
109
|
+
# Use a profile for one command…
|
|
110
|
+
cio --profile staging api /v1/campaigns
|
|
111
|
+
# …or a whole session
|
|
112
|
+
export CIO_PROFILE=staging
|
|
113
|
+
|
|
114
|
+
# Change the default, or remove a profile
|
|
115
|
+
cio profile use default
|
|
116
|
+
cio profile remove staging
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
Profile resolution: `--profile` flag → `CIO_PROFILE` → stored `current_profile`
|
|
120
|
+
→ `default`. An existing single-credential config is migrated to a `default`
|
|
121
|
+
profile automatically. Profile names may contain letters, digits, `.`, `-`,
|
|
122
|
+
and `_`.
|
|
123
|
+
|
|
124
|
+
`cio auth login` without `--profile` re-authenticates whichever profile is
|
|
125
|
+
currently selected, not always `default` — pass `--profile <name>` to target a
|
|
126
|
+
specific one. `cio profile list` marks the saved default (`current_profile`),
|
|
127
|
+
which a per-command `--profile` / `CIO_PROFILE` override does not change.
|
|
128
|
+
|
|
96
129
|
### How It Works
|
|
97
130
|
|
|
98
131
|
1. You provide a service account token (`sa_live_...` from Customer.io UI → Account Settings → Manage API Credentials → Service Accounts, or `sa_sandbox_...` returned by Builder sandbox signup)
|
|
@@ -189,6 +222,7 @@ cio api /v1/environments/{environment_id}/campaigns \
|
|
|
189
222
|
| Flag | Env Var | Description |
|
|
190
223
|
|---|---|---|
|
|
191
224
|
| `--token <value>` | `CIO_TOKEN` | Service account token override |
|
|
225
|
+
| `--profile <name>` | `CIO_PROFILE` | Configuration profile to use |
|
|
192
226
|
| `-X, --method` | | HTTP method override (default: GET, or POST if --json) |
|
|
193
227
|
| `--json <payload>` | | Raw JSON request body or `@filename` to read from file |
|
|
194
228
|
| `--params <json>` | | Query parameters as JSON → query string |
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@customerio/cli",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.13",
|
|
4
4
|
"description": "Agent-first CLI for Customer.io APIs",
|
|
5
5
|
"bin": {
|
|
6
6
|
"cio": ".npm/run.js"
|
|
@@ -11,12 +11,12 @@
|
|
|
11
11
|
"README.md"
|
|
12
12
|
],
|
|
13
13
|
"optionalDependencies": {
|
|
14
|
-
"@customerio/cli-darwin-arm64": "0.0.
|
|
15
|
-
"@customerio/cli-darwin-x64": "0.0.
|
|
16
|
-
"@customerio/cli-linux-arm64": "0.0.
|
|
17
|
-
"@customerio/cli-linux-x64": "0.0.
|
|
18
|
-
"@customerio/cli-win32-arm64": "0.0.
|
|
19
|
-
"@customerio/cli-win32-x64": "0.0.
|
|
14
|
+
"@customerio/cli-darwin-arm64": "0.0.13",
|
|
15
|
+
"@customerio/cli-darwin-x64": "0.0.13",
|
|
16
|
+
"@customerio/cli-linux-arm64": "0.0.13",
|
|
17
|
+
"@customerio/cli-linux-x64": "0.0.13",
|
|
18
|
+
"@customerio/cli-win32-arm64": "0.0.13",
|
|
19
|
+
"@customerio/cli-win32-x64": "0.0.13"
|
|
20
20
|
},
|
|
21
21
|
"publishConfig": {
|
|
22
22
|
"access": "public",
|