Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions .claude/skills/scalar-galaxy-cli-sdk/SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Generated CLI client for Scalar Galaxy API, published as `@scalar/galaxy-cli`. U
npm install -g @scalar/galaxy-cli

# Homebrew — standalone binary, no Node.js required
brew install scalar/galaxy-cli-tap/galaxy
brew install --cask scalar/galaxy-cli-tap/galaxy
# Had the `galaxy` formula installed? Run `brew uninstall --formula galaxy` before the install above.

# Direct download — standalone binary, no Node.js required
curl -fsSL https://github.com/scalar/galaxy-cli/releases/latest/download/galaxy-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz | tar xz
curl -fsSL "https://github.com/scalar/galaxy-cli/releases/latest/download/galaxy-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz galaxy
sudo mv galaxy /usr/local/bin/

# Windows — download and extract galaxy-windows-x64.zip, then add it to PATH
Expand Down Expand Up @@ -55,7 +56,7 @@ Failed requests print a structured error to standard error and exit with a statu

- Pass `--format toon` for token-efficient structured output: a uniform list collapses into one header plus a row per item, with a definitive `[N]` count. Use `--format json` when the output is fed to a JSON parser.
- Use `--max-items <count>` to bound paginated, streaming, and WebSocket commands before they fill the context, and `--transform <dot.path>` to keep only the field you need.
- Commands never prompt, so they are safe to run non-interactively. Credentials come from the documented environment variables or their flags.
- Endpoint commands never prompt, so they are safe to run non-interactively. Credentials come from the documented environment variables or their flags. `login` is meant for a human at a terminal, so do not drive it: a flow that reads a credential refuses a non-terminal stdin outright, and a browser or device flow waits for a person to finish signing in elsewhere before it gives up. Set the credential through its environment variable or flag instead.
- Branch on the exit status rather than on stderr text: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. A failed request repeats its class on stderr as a stable `code`, with a `hint` when there is a concrete next step; exit `2` is a plain message with no structured body, because the command never ran.
- Run `galaxy --help` or `galaxy <resource> --help` to discover commands and flags, and `man galaxy` for the full reference.

Expand Down
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ node_modules/
.env
.env.*
/*.tar.gz
/apple-codesign-*/
/compile-out/
/release-binaries/
/tap/
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.3.0"
".": "0.3.1"
}
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.3.1](https://github.com/scalar/galaxy-cli/compare/v0.3.0...v0.3.1) (2026-10-02)


### Chores

* **api:** regenerate SDK ([f2b5b18](https://github.com/scalar/galaxy-cli/commit/f2b5b188396318b95ff6cb3d1aeb4b875f798d6f))
* **api:** update generated SDK content ([c861bdb](https://github.com/scalar/galaxy-cli/commit/c861bdb763144c3557048022762814b04bf306b1))

## [0.3.0](https://github.com/scalar/galaxy-cli/compare/v0.2.4...v0.3.0) (2026-09-15)


Expand Down
40 changes: 37 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ The full API of this library can be found in [api.md](./api.md).
- [Installation](#installation)
- [Usage](#usage)
- [API Reference](./api.md)
- [Signing In](#signing-in)
- [Environments](#environments)
- [File Arguments](#file-arguments)
- [Shell Completion](#shell-completion)
- [Manual Pages](#manual-pages)
Expand All @@ -31,10 +33,11 @@ The full API of this library can be found in [api.md](./api.md).
npm install -g @scalar/galaxy-cli

# Homebrew — standalone binary, no Node.js required
brew install scalar/galaxy-cli-tap/galaxy
brew install --cask scalar/galaxy-cli-tap/galaxy
# Had the `galaxy` formula installed? Run `brew uninstall --formula galaxy` before the install above.

# Direct download — standalone binary, no Node.js required
curl -fsSL https://github.com/scalar/galaxy-cli/releases/latest/download/galaxy-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz | tar xz
curl -fsSL "https://github.com/scalar/galaxy-cli/releases/latest/download/galaxy-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz galaxy
sudo mv galaxy /usr/local/bin/

# Windows — download and extract galaxy-windows-x64.zip, then add it to PATH
Expand All @@ -51,12 +54,42 @@ galaxy [resource] [command] [flags]
galaxy planets list-all-data --bearer-auth "$BEARER_AUTH" --limit '10' --offset '0'
```

The examples in the following sections assume a `client` configured as shown above.
Every command accepts the global flags below, so the examples that follow show only what is specific to them.

See the [API reference](./api.md) for every available operation.

<br />

## Signing In

`galaxy login` signs you in and saves the credential for later commands, so it does not have to be passed every time. It goes into your operating system's credential store — the system keyring on Linux, Credential Manager on Windows — and falls back to a file in your state directory, readable only by you, when no such store is available. On macOS it is always that file, because the system's own tool accepts a password only on its command line, where other processes could read it. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. `galaxy logout` forgets it. A credential passed with a flag, or set in the environment, still takes precedence over a saved one. Both act on the environment selected with `--environment <name>` or `SCALAR_ENVIRONMENT`, so sign in to each environment you call. Sign-in methods: bearer-auth, basic, api-key-header, api-key-query, api-key-cookie, oauth-client-credentials, oauth-password, open-id-connect. Pass `--flow <name>` to pick one without being asked.

```sh
galaxy login
galaxy login --flow bearer-auth
galaxy logout
galaxy logout --all
```

<br />

## Environments

This API declares more than one environment. Pass `--environment <name>` to any command to choose one, or leave it off for `production`. `--base-url` sets a URL directly and cannot be combined with it, since each names where the request goes. `galaxy environments` prints the list for reading and takes `--format json` for parsing. Set `SCALAR_ENVIRONMENT` to choose one for every command in a shell; `--environment` and `--base-url` both take precedence over it, and it cannot be set together with the base URL environment variable.

- `production` — `https://galaxy.scalar.com` (default)
- `void` — `https://void.scalar.com/`

```sh
# read them; --format json when a script is parsing
galaxy environments

# call an endpoint against one
galaxy --environment production COMMAND
```

<br />

## File Arguments

Any command flag or credential reads its value from a file when the value begins with `@`, so a body field holding a whole document does not have to survive shell quoting. `@file://` always sends the file as text and `@data://` always sends it base64-encoded; a bare `@` lets the file decide. A flag that uploads a file takes its path with or without the `@`. Escape a literal value that begins with `@` as `\@`. The global options (`--base-url`, `--timeout`, `--format` and the rest) are read exactly as written.
Expand Down Expand Up @@ -143,6 +176,7 @@ Configure the generated client by setting any of these options when you create i
| `--timeout` | `<ms>` | - | Request timeout in milliseconds. |
| `--max-retries` | `<count>` | - | Number of retries for retryable failures. |
| `--debug` | `flag` | - | Enable SDK debug logging. |
| `--environment` | `<name>` | `production` | Named environment to target: production, void (can also be set with SCALAR_ENVIRONMENT env var). Cannot be combined with `--base-url`. |

<br />

Expand Down
7 changes: 4 additions & 3 deletions SKILL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,11 @@ Generated CLI client for Scalar Galaxy API, published as `@scalar/galaxy-cli`. U
npm install -g @scalar/galaxy-cli

# Homebrew — standalone binary, no Node.js required
brew install scalar/galaxy-cli-tap/galaxy
brew install --cask scalar/galaxy-cli-tap/galaxy
# Had the `galaxy` formula installed? Run `brew uninstall --formula galaxy` before the install above.

# Direct download — standalone binary, no Node.js required
curl -fsSL https://github.com/scalar/galaxy-cli/releases/latest/download/galaxy-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz | tar xz
curl -fsSL "https://github.com/scalar/galaxy-cli/releases/latest/download/galaxy-$(uname -s | tr '[:upper:]' '[:lower:]')-$(uname -m | sed 's/x86_64/x64/;s/aarch64/arm64/').tar.gz" | tar xz galaxy
sudo mv galaxy /usr/local/bin/

# Windows — download and extract galaxy-windows-x64.zip, then add it to PATH
Expand Down Expand Up @@ -55,7 +56,7 @@ Failed requests print a structured error to standard error and exit with a statu

- Pass `--format toon` for token-efficient structured output: a uniform list collapses into one header plus a row per item, with a definitive `[N]` count. Use `--format json` when the output is fed to a JSON parser.
- Use `--max-items <count>` to bound paginated, streaming, and WebSocket commands before they fill the context, and `--transform <dot.path>` to keep only the field you need.
- Commands never prompt, so they are safe to run non-interactively. Credentials come from the documented environment variables or their flags.
- Endpoint commands never prompt, so they are safe to run non-interactively. Credentials come from the documented environment variables or their flags. `login` is meant for a human at a terminal, so do not drive it: a flow that reads a credential refuses a non-terminal stdin outright, and a browser or device flow waits for a person to finish signing in elsewhere before it gives up. Set the credential through its environment variable or flag instead.
- Branch on the exit status rather than on stderr text: `0` success, `1` `error`, `2` `usage`, `10` `auth-failed`, `11` `not-found`, `12` `rate-limited`, `13` `client-error`, `14` `server-error`, `15` `connection-error`. A failed request repeats its class on stderr as a stable `code`, with a `hint` when there is a concrete next step; exit `2` is a plain message with no structured body, because the command never ran.
- Run `galaxy --help` or `galaxy <resource> --help` to discover commands and flags, and `man galaxy` for the full reference.

Expand Down
14 changes: 14 additions & 0 deletions VERSIONING.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,10 @@ different fixes:
platform and the `github-actions` bot to push (or be left unprotected); the default
branch only ever advances by merging release PRs, and `scalar-next` receives each
released state back from the release workflow.
- **`scalar-next` must not enable "Require linear history."** The Scalar platform merges each
regeneration into it, and merges a resolved conflict back the same way; the release sync
adds another merge whenever a release PR is squash- or rebase-merged. That setting rejects
all of them.
- No Actions settings changes are required: the generated workflows declare their own
permissions and never create pull requests.
- If this package publishes through OIDC trusted publishing (for example PyPI or npm),
Expand All @@ -84,3 +88,13 @@ different fixes:
manual re-publishes at an existing tag; register it as an additional trusted publisher
only if you use it. If the publish job is configured with a deployment environment,
include that environment in the registration too.

### Recommended, not required

Releases work without this; it closes a window where one can go out at the wrong version.

- **If this repository uses auto-merge, make the `Release PR version` check a required status
check.** Auto-merge merges as soon as the checks that are *required* go green, with no
human present — so a check that is not required but still red at that moment stops
nothing, which is exactly the window between retitling a release PR and the platform
re-rendering it.
2 changes: 1 addition & 1 deletion biome.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
{
"$schema": "https://biomejs.dev/schemas/2.5.7/schema.json",
"$schema": "https://biomejs.dev/schemas/2.5.14/schema.json",
"root": true,
"files": {
"includes": [
Expand Down
6 changes: 6 additions & 0 deletions man/galaxy-authentication-create-token.1
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ Print transformed string values without JSON quotes.
\fB\-\-debug\fR
Enable SDK debug logging on standard error.
.TP
\fB\-\-environment\fR \fI<name>\fR
Named environment to target: production, void (can also be set with SCALAR_ENVIRONMENT env var) (default: production). Cannot be combined with \-\-base\-url.
.TP
\fB\-\-bearer\-auth\fR \fI<value>\fR
JWT Bearer token authentication. Can also be set with the BEARER_AUTH environment variable.
.TP
Expand Down Expand Up @@ -77,6 +80,9 @@ galaxy authentication create\-token \e
.RE
.SH "ENVIRONMENT"
.TP
\fBSCALAR_ENVIRONMENT\fR
Fallback for \-\-environment when the flag is not passed. Ignored when \-\-base\-url is passed, and refused beside the base URL environment variable.
.TP
\fBBEARER_AUTH\fR
Fallback for \-\-bearer\-auth when the flag is not passed.
.TP
Expand Down
6 changes: 6 additions & 0 deletions man/galaxy-authentication-create-user.1
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,9 @@ Print transformed string values without JSON quotes.
\fB\-\-debug\fR
Enable SDK debug logging on standard error.
.TP
\fB\-\-environment\fR \fI<name>\fR
Named environment to target: production, void (can also be set with SCALAR_ENVIRONMENT env var) (default: production). Cannot be combined with \-\-base\-url.
.TP
\fB\-\-bearer\-auth\fR \fI<value>\fR
JWT Bearer token authentication. Can also be set with the BEARER_AUTH environment variable.
.TP
Expand Down Expand Up @@ -81,6 +84,9 @@ galaxy authentication create\-user \e
.RE
.SH "ENVIRONMENT"
.TP
\fBSCALAR_ENVIRONMENT\fR
Fallback for \-\-environment when the flag is not passed. Ignored when \-\-base\-url is passed, and refused beside the base URL environment variable.
.TP
\fBBEARER_AUTH\fR
Fallback for \-\-bearer\-auth when the flag is not passed.
.TP
Expand Down
6 changes: 6 additions & 0 deletions man/galaxy-authentication-list-me.1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Print transformed string values without JSON quotes.
\fB\-\-debug\fR
Enable SDK debug logging on standard error.
.TP
\fB\-\-environment\fR \fI<name>\fR
Named environment to target: production, void (can also be set with SCALAR_ENVIRONMENT env var) (default: production). Cannot be combined with \-\-base\-url.
.TP
\fB\-\-bearer\-auth\fR \fI<value>\fR
JWT Bearer token authentication. Can also be set with the BEARER_AUTH environment variable.
.TP
Expand Down Expand Up @@ -68,6 +71,9 @@ galaxy authentication list\-me \-\-bearer\-auth "$BEARER_AUTH"
.RE
.SH "ENVIRONMENT"
.TP
\fBSCALAR_ENVIRONMENT\fR
Fallback for \-\-environment when the flag is not passed. Ignored when \-\-base\-url is passed, and refused beside the base URL environment variable.
.TP
\fBBEARER_AUTH\fR
Fallback for \-\-bearer\-auth when the flag is not passed.
.TP
Expand Down
6 changes: 6 additions & 0 deletions man/galaxy-celestial-bodies-create.1
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,9 @@ Print transformed string values without JSON quotes.
\fB\-\-debug\fR
Enable SDK debug logging on standard error.
.TP
\fB\-\-environment\fR \fI<name>\fR
Named environment to target: production, void (can also be set with SCALAR_ENVIRONMENT env var) (default: production). Cannot be combined with \-\-base\-url.
.TP
\fB\-\-bearer\-auth\fR \fI<value>\fR
JWT Bearer token authentication. Can also be set with the BEARER_AUTH environment variable.
.TP
Expand Down Expand Up @@ -68,6 +71,9 @@ galaxy celestial\-bodies create \-\-bearer\-auth "$BEARER_AUTH"
.RE
.SH "ENVIRONMENT"
.TP
\fBSCALAR_ENVIRONMENT\fR
Fallback for \-\-environment when the flag is not passed. Ignored when \-\-base\-url is passed, and refused beside the base URL environment variable.
.TP
\fBBEARER_AUTH\fR
Fallback for \-\-bearer\-auth when the flag is not passed.
.TP
Expand Down
61 changes: 61 additions & 0 deletions man/galaxy-environments.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
.\" File generated from our OpenAPI spec by Scalar. Do not edit.
.TH "GALAXY\-ENVIRONMENTS" "1" "" "galaxy" "Scalar Galaxy Manual"
.SH "NAME"
galaxy\-environments \- list the named environments this API declares
.SH "SYNOPSIS"
.B galaxy environments
[\fB\-\-format\fR \fI<format>\fR]
.SH "DESCRIPTION"
Prints every environment \-\-environment accepts, with the base URL it selects and which one is used by default. The list comes from the same table galaxy resolves the flag against, so it always describes this version's environments.
.SH "OPTIONS"
.TP
\fB\-\-format\fR \fI<format>\fR
Output format: auto, json, jsonl, pretty, raw, toon, yaml. Without one, or with auto or pretty, the list is drawn for a reader: the default marked, each base URL behind its name, and colour only when standard output is a terminal. Name a machine format to parse it.
.SH "ENVIRONMENTS"
\-\-environment selects one of these base URLs, or SCALAR_ENVIRONMENT when the flag is not passed, and production is used when neither is. Run galaxy environments to print the same list.
.TP
\fBproduction\fR
https://galaxy.scalar.com (default)
.TP
\fBvoid\fR
https://void.scalar.com/
.SH "EXAMPLES"
Print the environments, then call an endpoint against one of them:
.PP
.RS 4
.nf
galaxy environments
galaxy environments \-\-format json
galaxy \-\-environment production COMMAND
.fi
.RE
.SH "EXIT STATUS"
.TP
\fB0\fR
The command completed successfully.
.TP
\fB1\fR
The request failed for an unclassified reason. Reported as error.
.TP
\fB2\fR
The command was invoked incorrectly (missing or invalid arguments).
.TP
\fB10\fR
Authentication or authorization failed (HTTP 401 or 403). Reported as auth\-failed.
.TP
\fB11\fR
The requested resource does not exist (HTTP 404). Reported as not\-found.
.TP
\fB12\fR
The request was rate limited (HTTP 429). Reported as rate\-limited.
.TP
\fB13\fR
The request was rejected (any other HTTP 4xx). Reported as client\-error.
.TP
\fB14\fR
The API failed to handle the request (HTTP 5xx). Reported as server\-error.
.TP
\fB15\fR
The API could not be reached, or the request timed out. Reported as connection\-error.
.SH "SEE ALSO"
.BR galaxy (1)
65 changes: 65 additions & 0 deletions man/galaxy-login.1
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
.\" File generated from our OpenAPI spec by Scalar. Do not edit.
.TH "GALAXY\-LOGIN" "1" "" "galaxy" "Scalar Galaxy Manual"
.SH "NAME"
galaxy\-login \- sign in and save credentials
.SH "SYNOPSIS"
.B galaxy login
[\fB\-\-flow\fR \fIname\fR] [\fB\-\-base\-url\fR \fIurl\fR] [\fB\-\-environment\fR \fIname\fR]
.SH "DESCRIPTION"
Obtains a credential and saves it so later commands do not have to carry one. It goes into your operating system's credential store \- the system keyring on Linux, Credential Manager on Windows \- and falls back to a file in your state directory, readable only by you, when no such store is available. On macOS it is always that file, because the system's own tool accepts a password only on its command line, where other processes could read it. Either way it is filed under the base URL it was captured for, so a credential saved for one host is never sent to another. A credential passed with a flag, or set in the environment, still takes precedence over a saved one.
.SH "OPTIONS"
.TP
\fB\-\-flow\fR \fIname\fR
Sign\-in flow to use, skipping the prompt. One of: bearer\-auth, basic, api\-key\-header, api\-key\-query, api\-key\-cookie, oauth\-client\-credentials, oauth\-password, open\-id\-connect.
.TP
\fB\-\-base\-url\fR \fIurl\fR
Sign in against this base URL instead of the default.
.TP
\fB\-\-environment\fR \fIname\fR
Sign in to the named environment instead of the default. One of: production, void. Falls back to SCALAR_ENVIRONMENT. Cannot be combined with \-\-base\-url.
.SH "SIGN\-IN FLOWS"
.TP
\fBbearer\-auth\fR
Enter your access token.
.TP
\fBbasic\fR
Username and password for basic auth.
.TP
\fBapi\-key\-header\fR
Enter your API key.
.TP
\fBapi\-key\-query\fR
Enter your API key.
.TP
\fBapi\-key\-cookie\fR
Enter your API key.
.TP
\fBoauth\-client\-credentials\fR
Sign in with a client id and secret (OAuth client credentials).
.TP
\fBoauth\-password\fR
Sign in with a username and password (OAuth password grant).
.TP
\fBopen\-id\-connect\fR
Paste an access token you already have.
.SH "EXAMPLES"
.PP
.RS 4
.nf
galaxy login
galaxy login \-\-flow bearer\-auth
.fi
.RE
.SH "EXIT STATUS"
.TP
\fB0\fR
The command completed successfully.
.TP
\fB2\fR
The command was invoked incorrectly (missing or invalid arguments).
.TP
\fB10\fR
Sign\-in or sign\-out did not complete. The message on standard error says why.
.SH "SEE ALSO"
.BR galaxy (1),
.BR galaxy\-logout (1)
Loading
Loading