diff --git a/src/content/changelog/account-and-auth-status.md b/src/content/changelog/account-and-auth-status.md new file mode 100644 index 00000000..d0485c14 --- /dev/null +++ b/src/content/changelog/account-and-auth-status.md @@ -0,0 +1,26 @@ +--- +title: See which credential the CLI is using +date: 2026-10-17 +version: 1.6.130 +area: CLI +type: New +docLink: + label: Check which credential is active + href: /account/cli/#check-which-credential-is-active +--- + +`shorebird auth status` shows which credential the CLI signed in with and who it +acts as, and `shorebird auth token` prints the access token it sends. + +- The credential is an API key from `SHOREBIRD_TOKEN`, GitHub Actions OIDC, or + your `shorebird login`, tried in that order. +- `shorebird account whoami` adds a `Credential` line, and `credential` in + `--json`. +- Bare `shorebird account` now runs `shorebird account whoami`. +- Treat the output of `shorebird auth token` as a secret. It's left out of the + run's log file. + +```sh +shorebird auth status +shorebird account +``` diff --git a/src/content/changelog/account-apps-moved.md b/src/content/changelog/account-apps-moved.md new file mode 100644 index 00000000..a725b2a9 --- /dev/null +++ b/src/content/changelog/account-apps-moved.md @@ -0,0 +1,20 @@ +--- +title: Apps are listed with apps list, not account apps +date: 2026-10-17 +version: 1.6.130 +area: CLI +type: Changed +docLink: + label: List apps + href: /account/cli/#list-apps +--- + +`shorebird account apps` no longer lists apps. It prints `shorebird apps list`, +which shows the same list, and exits with a usage error. + +- Scripts that call `shorebird account apps` need to switch to + `shorebird apps list`. Its output, including `--json`, is the same. + +```sh +shorebird apps list +``` diff --git a/src/content/changelog/account-update-and-notifications.md b/src/content/changelog/account-update-and-notifications.md new file mode 100644 index 00000000..8efe25c7 --- /dev/null +++ b/src/content/changelog/account-update-and-notifications.md @@ -0,0 +1,23 @@ +--- +title: Change your display name and email settings from the CLI +date: 2026-10-17 +version: 1.6.130 +area: CLI +type: New +docLink: + label: Change your display name + href: /account/cli/#change-your-display-name +--- + +`shorebird account update --name` changes your display name, and +`shorebird account notifications` shows or changes whether Shorebird emails you. + +- The emails Shorebird sends today warn that an app is near or over its plan's + patch install limit. +- `--email on` and `--email off` change the setting. With `--json`, the output + includes `email` set to `true` or `false`. + +```sh +shorebird account update --name "Jane Doe" +shorebird account notifications --email off +``` diff --git a/src/content/changelog/api-method-and-paginate.md b/src/content/changelog/api-method-and-paginate.md new file mode 100644 index 00000000..a71df311 --- /dev/null +++ b/src/content/changelog/api-method-and-paginate.md @@ -0,0 +1,25 @@ +--- +title: The api command takes the method first and reads every page +date: 2026-10-17 +version: 1.6.130 +area: CLI +type: New +docLink: + label: Calling the API from the command line + href: /account/api/#calling-the-api-from-the-command-line +--- + +`shorebird api` accepts the HTTP method before the endpoint, and `--paginate` +reads a whole paged list in one call. + +- The method can be GET, POST, PUT, PATCH, DELETE, or HEAD, in any case. If you + also pass `-X`, it must name the same method. +- `--paginate` follows `next_cursor` and prints the pages as one JSON object, + with list fields joined. `--jq` runs on the joined result. +- `--paginate` works only with GET. A failed page stops the command with exit + status 1 instead of printing part of the list. + +```sh +shorebird api GET /apps +shorebird api /apps -f per_page=100 --paginate --jq '.apps[].app_id' +``` diff --git a/src/content/changelog/channel-flag-alias.md b/src/content/changelog/channel-flag-alias.md new file mode 100644 index 00000000..b2e11018 --- /dev/null +++ b/src/content/changelog/channel-flag-alias.md @@ -0,0 +1,21 @@ +--- +title: Use --channel wherever --track works +date: 2026-10-17 +version: 1.6.130 +area: CLI +type: New +docLink: + label: Publishing a patch to a track + href: /code-push/tracks/#publishing-a-patch-to-a-track +--- + +`--channel` is now another name for `--track`. + +- It works on `shorebird patch`, `shorebird preview`, + `shorebird patches set-track`, and `shorebird patches promote`. +- The two flags mean the same thing, so existing scripts that use `--track` keep + working. + +```sh +shorebird patch android --channel staging +``` diff --git a/src/content/changelog/patches-promote-shortcut.md b/src/content/changelog/patches-promote-shortcut.md new file mode 100644 index 00000000..f6763a87 --- /dev/null +++ b/src/content/changelog/patches-promote-shortcut.md @@ -0,0 +1,23 @@ +--- +title: The patches promote command is back as a set-track shortcut +date: 2026-10-17 +version: 1.6.130 +area: CLI +type: Changed +docLink: + label: Promote a patch + href: /code-push/patch/#promote-a-patch +--- + +`shorebird patches promote` appears in help again and now runs +`shorebird patches set-track` with the track defaulting to `stable`. + +- It takes the same options as `set-track`, including `--track` for a track + other than `stable`, `--app-id`, and `--json`. +- A patch that's already on the track now succeeds instead of failing. +- If the app has no `stable` channel yet, it offers to create it, as `set-track` + does. + +```sh +shorebird patches promote --release-version 1.0.0+1 --patch-number 1 +``` diff --git a/src/content/docs/account/api.mdx b/src/content/docs/account/api.mdx index 5fd89a63..e059be4f 100644 --- a/src/content/docs/account/api.mdx +++ b/src/content/docs/account/api.mdx @@ -46,7 +46,29 @@ output. Find endpoints in shorebird api /organizations/ORG_ID/users --jq '.users[].user.email' ``` -Run `shorebird api --help` for all options. For walking a paged list, see +The HTTP method can go before the endpoint, or in `-X`. Without one, the request +is a GET, or a POST when you pass fields with `-f` or `-F`: + +```sh +shorebird api GET /apps +shorebird api DELETE /apps/APP_ID/releases/RELEASE_ID +``` + +To read a whole paged list in one call, add `--paginate`. It keeps requesting +the next page and prints the pages as one JSON object, with the list fields +joined. It works only with GET, and on an endpoint that doesn't page it makes a +single request: + +```sh +shorebird api /apps -f per_page=100 --paginate --jq '.apps[].app_id' +``` + +Because `--paginate` always sends a GET, the `-f` fields here go in the query +string. + +The method before the endpoint and `--paginate` need Shorebird 1.6.130 or newer. + +Run `shorebird api --help` for all options. For how paging works, see [Pagination](#common-patterns) below. ## Base URL @@ -116,9 +138,11 @@ parameter and response detail on each: `next_cursor` when there is another page; pass it as `cursor` to fetch the next one. Without `per_page` or `cursor`, these lists return every item. Some newer list endpoints page by default, with the same parameters. + `shorebird api --paginate` follows `next_cursor` for you. - This script prints every app ID, one page of 50 at a time, stops when a page - has no `next_cursor`, and exits with status 1 if a request fails: + On a CLI older than 1.6.130, this script prints every app ID, one page of 50 + at a time, stops when a page has no `next_cursor`, and exits with status 1 if + a request fails: ```bash cursor="" diff --git a/src/content/docs/account/cli.mdx b/src/content/docs/account/cli.mdx index b2487473..55db1059 100644 --- a/src/content/docs/account/cli.mdx +++ b/src/content/docs/account/cli.mdx @@ -44,17 +44,56 @@ from your machine, run: shorebird logout ``` +### Check which credential is active + +The CLI signs in with the first credential it finds: an API key in +`SHOREBIRD_TOKEN`, then GitHub Actions OIDC, then your `shorebird login`. To see +which one it's using and who it acts as, run: + +```sh +shorebird auth status +``` + +**Example output:** + +``` +Credential: Login (shorebird login) +Acting as: user@example.com (ID 42) +Expires: 2026-10-17T01:00:00.000Z +``` + +`Expires` is when the current access token expires. A login and GitHub Actions +OIDC get a new token automatically. An API key has no access token to expire, so +that line is left out. A personal API key and a service account key both show as +`API key (SHOREBIRD_TOKEN)`; the `Acting as` line tells them apart. + +### Print an access token + +To call the Shorebird API from another tool with your current credentials, print +the access token the CLI would send: + +```sh +curl -H "Authorization: Bearer $(shorebird auth token)" \ + https://api.shorebird.dev/api/v1/users/me +``` + +The token may expire soon after you get it, so run `shorebird auth token` each +time rather than storing the output. With an API key in `SHOREBIRD_TOKEN`, it +prints the key. Treat the output as a secret. + +These `auth` commands need Shorebird 1.6.130 or newer. + ## Account management commands -The `shorebird account` command provides several subcommands to inspect your -account details, apps, and organizations. +The `shorebird account` command shows who you're signed in as, and its +subcommands list your organizations and change your account settings. ### Current account To see the currently authenticated user's details, run: ```sh -shorebird account whoami +shorebird account ``` **Example output:** @@ -65,19 +104,55 @@ Email: user@example.com Display name: Example User Plan: pro Overage limit: 10000 +Credential: Login (shorebird login) ``` This command is useful for verifying which account you are logged into and -checking your plan level and your patch overage limit. +checking your plan level and your patch overage limit. `Credential` is how the +command signed in; see +[Check which credential is active](#check-which-credential-is-active). + +`shorebird account whoami` prints the same thing. Bare `shorebird account` and +the `Credential` line need Shorebird 1.6.130 or newer. + +### Change your display name + +To change the name on your account, run: + +```sh +shorebird account update --name "Jane Doe" +``` + +### Turn email notifications on or off + +The emails Shorebird sends today warn you when an app is near or over its plan's +patch install limit. To see whether they're on, run: + +```sh +shorebird account notifications +``` + +To turn them off, or back on: + +```sh +shorebird account notifications --email off +shorebird account notifications --email on +``` + +`account update` and `account notifications` need Shorebird 1.6.130 or newer. ### List apps To list all the Shorebird apps that your current account has access to, run: ```sh -shorebird account apps +shorebird apps list ``` +On Shorebird 1.6.129 and older, `shorebird account apps` prints the same list. +From 1.6.130 it prints the `shorebird apps list` command instead and exits with +an error. + **Example output:** ``` @@ -111,8 +186,8 @@ of, but where you collaborate on one of its apps, shows the role `none`. ## App management commands As of Shorebird 1.6.121, the `shorebird apps` commands list, rename, delete, and -transfer your apps. `shorebird apps list` shows the same output as -[`shorebird account apps`](#list-apps). +transfer your apps. `shorebird apps list` is covered under +[List apps](#list-apps). `rename`, `delete`, and `transfer` act on the app in `shorebird.yaml` in the current directory. Pass `--app-id` to pick a different app or to run the command @@ -201,7 +276,6 @@ flag, making them easy to integrate into scripts and automation workflows. ```sh shorebird account whoami --json -shorebird account apps --json shorebird account orgs --json shorebird apps list --json ``` diff --git a/src/content/docs/code-push/ci/scripting.mdx b/src/content/docs/code-push/ci/scripting.mdx index 6e6850af..46f387b5 100644 --- a/src/content/docs/code-push/ci/scripting.mdx +++ b/src/content/docs/code-push/ci/scripting.mdx @@ -56,10 +56,11 @@ These commands return structured JSON: | Group | Commands | | ---------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------- | -| [`shorebird account`](/account/cli#account-management-commands) | `whoami`, `apps`, `orgs` | +| [`shorebird account`](/account/cli#account-management-commands) | `whoami`, `update`, `notifications`, `orgs` | +| [`shorebird auth`](/account/cli#check-which-credential-is-active) | `status`, `token` | | [`shorebird apps`](/account/cli#app-management-commands) | `list`, `rename`, `delete`, `transfer` | | [`shorebird channels`](/code-push/tracks#managing-tracks-from-the-cli) | `list`, `create`, `delete` | -| [`shorebird patches`](/code-push/patch#manage-patches) | `list`, `info`, `set-track`, `rollback`, `rollforward` | +| [`shorebird patches`](/code-push/patch#manage-patches) | `list`, `info`, `set-track`, `promote`, `rollback`, `rollforward` | | [`shorebird releases`](/code-push/release) | `list`, `info`, `delete` | | `shorebird metrics` | `active-hours`, `adoption`, `downloads`, `heatmap`, `installs`, `new-devices`, `users`, `versions` | | Other | `shorebird release`, `shorebird patch`, `shorebird doctor`, `shorebird flutter versions list`, `shorebird --version` | diff --git a/src/content/docs/code-push/patch.mdx b/src/content/docs/code-push/patch.mdx index 63adbf6d..e77a9036 100644 --- a/src/content/docs/code-push/patch.mdx +++ b/src/content/docs/code-push/patch.mdx @@ -230,11 +230,12 @@ If you published a patch to a staging track (e.g., `staging`) and verified it works correctly, you can promote it directly to the `stable` track using: ```sh -shorebird patches set-track --release-version 1.0.0+1 --patch-number 1 --track stable +shorebird patches promote --release-version 1.0.0+1 --patch-number 1 ``` -This command needs Shorebird 1.6.128 or newer. See -[Set patch track](#set-patch-track) for older CLIs. +`promote` is `set-track` with the track defaulting to `stable`. Older CLIs run +the same command but print a deprecation warning, and its `--track`, +`--channel`, `--app-id`, and `--json` flags need Shorebird 1.6.130 or newer. ### Set patch track diff --git a/src/content/docs/code-push/tracks.mdx b/src/content/docs/code-push/tracks.mdx index 803280ff..e458c519 100644 --- a/src/content/docs/code-push/tracks.mdx +++ b/src/content/docs/code-push/tracks.mdx @@ -68,7 +68,9 @@ built-in names, so those tracks can't be deleted. /> Pass the `--track` flag to any `shorebird patch` command. If you omit the flag, -the patch is published to `stable` by default. +the patch is published to `stable` by default. With Shorebird 1.6.130 or newer, +`--channel` works as another name for `--track` here and on `shorebird preview`, +`shorebird patches set-track`, and `shorebird patches promote`. @@ -113,14 +115,6 @@ applying the latest patch available on the specified track. Once you've validated a patch on a staging track, you can promote it to `stable` without rebuilding. This pushes the patch to all production users. -:::note - -`shorebird patches promote` is deprecated. Use -`shorebird patches set-track --track stable` instead. Existing scripts that call -`promote` still work. - -::: - ### Via the Shorebird console Navigate to the release details page, click the **⋮** context menu next to the @@ -130,19 +124,18 @@ the same way. ### Via the CLI -The `--release-version` and `--patch-number` flags of `set-track` need Shorebird -1.6.128 or newer. On an older CLI, use `--release` and `--patch` instead, or run -`shorebird upgrade` first. - Promote a patch directly to `stable`: ```bash -shorebird patches set-track \ +shorebird patches promote \ --release-version 1.0.0+1 \ - --patch-number 1 \ - --track stable + --patch-number 1 ``` +`promote` is `set-track` with the track defaulting to `stable`. Older CLIs run +the same command but print a deprecation warning, and its `--track`, +`--channel`, `--app-id`, and `--json` flags need Shorebird 1.6.130 or newer. + To move a patch to any other track, pass that track's name to `--track`: ```bash @@ -152,6 +145,10 @@ shorebird patches set-track \ --track beta ``` +The `--release-version` and `--patch-number` flags of `set-track` need Shorebird +1.6.128 or newer. On an older CLI, use `--release` and `--patch` instead, or run +`shorebird upgrade` first. + ## Subscribing a device to a track By default, devices always subscribe to the `stable` track. To have a device