From b690690c05fe25e46b394002a1f4c0847742c55b Mon Sep 17 00:00:00 2001 From: jae beller Date: Mon, 23 Feb 2026 13:49:10 -0500 Subject: [PATCH 1/2] Fix URL in cli docs generator --- src/lib/cli-releases.ts | 27 ++------------------------- 1 file changed, 2 insertions(+), 25 deletions(-) diff --git a/src/lib/cli-releases.ts b/src/lib/cli-releases.ts index 3e0da9b..07a1d8f 100644 --- a/src/lib/cli-releases.ts +++ b/src/lib/cli-releases.ts @@ -22,26 +22,6 @@ const PLATFORMS = [ { platform: 'Windows', arch: 'ARM64', key: 'windows-arm64' }, ] as const; -function findLatestVersion(xml: string): string { - const versionPattern = /client\/(v0\.0\.1-rc(\d+))\//g; - let maxRcNumber = 0; - let latestVersion = ''; - - for (const match of xml.matchAll(versionPattern)) { - const rcNumber = parseInt(match[2], 10); - if (rcNumber > maxRcNumber) { - maxRcNumber = rcNumber; - latestVersion = match[1]; - } - } - - if (!latestVersion) { - throw new Error('No RC versions found in bucket listing'); - } - - return latestVersion; -} - function buildBinaries(version: string): CliBinary[] { return PLATFORMS.map(({ platform, arch, key }) => { const ext = key.startsWith('windows') ? 'zip' : 'tar.gz'; @@ -58,11 +38,8 @@ function buildBinaries(version: string): CliBinary[] { } export async function getLatestRcRelease(): Promise { - const response = await fetch( - `${BINARIES_BASE_URL}/?list-type=2&prefix=client/v0.0.1-rc`, - ); - const xml = await response.text(); - const version = findLatestVersion(xml); + const response = await fetch(`${BINARIES_BASE_URL}/client/rc.txt`); + const version = await response.text(); return { version, From 1af4fa8f6596e1f25df8ec9c29c9652f81f18747 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 23 Feb 2026 18:54:05 +0000 Subject: [PATCH 2/2] Update auto-generated CLI documentation --- src/content/docs/cli/commands.mdx | 343 ++++-------------------------- 1 file changed, 45 insertions(+), 298 deletions(-) diff --git a/src/content/docs/cli/commands.mdx b/src/content/docs/cli/commands.mdx index 1a7436f..efedc4a 100644 --- a/src/content/docs/cli/commands.mdx +++ b/src/content/docs/cli/commands.mdx @@ -24,90 +24,46 @@ These options work with any command: ### `sprite login` -sprite login - Authenticate with Fly.io +Usage of login: -```bash -sprite login [api-url] [options] -``` - -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `-h, --help Show` - this help message - -**Examples:** ```bash sprite login -sprite login -o my-org -sprite login https://custom-api.sprites.dev ``` ### `sprite logout` -sprite logout - Remove Sprites configuration +Usage of logout: -```bash -sprite logout [options] -``` - -**Options:** -- `-h, --help Show` - this help message - -**Examples:** ```bash sprite logout ``` ### `sprite org auth` -Add an API token +Usage of org auth: ```bash -sprite org auth [api-url|alias] [-o :] +sprite org auth ``` **Aliases:** `sprite orgs`, `sprite organizations`, `sprite o` -**Options:** -- `-h, --help` - Show help for this command -- `-o, --o ` - Organization to use (shorthand) -- `-o, --org ` - Organization to use -- `-s, --s ` - Sprite to use (shorthand) -- `-s, --sprite ` - Sprite to use - -**Examples:** -```bash -sprite org auth -sprite org auth https://custom-api.sprites.dev -sprite org auth prod -sprite org auth -o prod:my-org -sprite org auth -o staging:test-org -sprite org auth https://staging-api.sprites.dev -o staging:test-org -``` - ### `sprite org list` -Show configured tokens +Usage of org list: ```bash -sprite org list [api-url|alias] +sprite org list ``` -**Options:** -- `-h, --help` - Show help for this command - ### `sprite org logout` -Remove all tokens +Usage of org logout: ```bash -sprite org logout [options] +sprite org logout ``` -**Options:** -- `-f, --force` - Skip confirmation prompt -- `-h, --help` - Show help for this command - ### `sprite org keyring disable` --- Org selector @@ -126,289 +82,126 @@ sprite org keyring enable ### `sprite auth setup` -Set up authentication using a pre-generated token. - -```bash -sprite auth setup --token -``` - -**Options:** -- `-h, --help` - Show help for this command -- `-t, --token ` - Token in format: org-slug/org-id/token-id/token-value +Usage of auth setup: -**Examples:** ```bash -sprite auth setup --token "org-slug/org-id/token-id/token-value" +sprite auth setup ``` ## Sprite Management ### `sprite create` -sprite create - Create a new sprite +Usage of create: ```bash -sprite create [options] [sprite-name] -``` - -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `-h, --help Show` - this help message - -> Creates a new sprite with the specified name. -> The sprite will be created in the selected organization. -> If sprite name is not provided, you will be prompted. - -**Examples:** -```bash -sprite create my-sprite -sprite create -o myorg development-sprite sprite create ``` ### `sprite use` -sprite use - Activate a sprite for the current directory - -```bash -sprite use [options] [sprite-name] -``` - -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `--unset Remove` - the .sprite file from current directory -- `-h, --help Show` - this help message - -> Creates a .sprite file in the current directory to set the active sprite. -> This file will be used by other commands when no sprite is explicitly specified. -> Similar to 'nvm use' or 'asdf local' for version management. -> If no sprite name is provided, shows an interactive list to choose from. +Usage of use: -**Examples:** ```bash -sprite use my-sprite -sprite use -o myorg dev-sprite sprite use ``` ### `sprite list` -sprite list - List all sprites +Usage of list: ```bash -sprite list [options] +sprite list ``` **Aliases:** `sprite ls` -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `--prefix ` - Filter sprites by name prefix -- `-h, --help Show` - this help message - -> Lists all sprites in the selected organization. -> Use --prefix to filter sprites by name prefix. - -**Examples:** -```bash -sprite list -sprite list -o myorg -sprite list --prefix dev -``` - ### `sprite destroy` -sprite destroy - Destroy a sprite - -```bash -sprite destroy [options] [sprite-name] -``` - -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `--force Skip` - confirmation prompt -- `-h, --help Show` - this help message +Usage of destroy: -**Examples:** ```bash -sprite destroy mysprite -sprite destroy -o myorg mysprite -sprite destroy -s mysprite -sprite destroy --force +sprite destroy ``` ## Command Execution ### `sprite exec` -sprite exec - Execute a command in the sprite environment +Usage of exec: ```bash -sprite exec [options] [args...] +sprite exec ``` **Aliases:** `sprite x` -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `-h, --help Show` - this help message - -> When using -tty, terminal environment variables (TERM, COLORTERM, LANG, LC_ALL) -> are automatically passed through from your local environment. -> Use 'sprite sessions' to list, attach to, or kill running sessions. - -**Examples:** -```bash -sprite exec ls -la -sprite exec -dir /app echo hello world -sprite exec -env KEY=value,FOO=bar env -sprite exec -tty /bin/bash -sprite exec -o myorg -s mysprite npm start -``` - ### `sprite console` -sprite console - Open an interactive shell in the sprite environment +Usage of console: ```bash -sprite console [options] +sprite console ``` **Aliases:** `sprite c` -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `-h, --help Show` - this help message - -> Opens an interactive shell with a TTY allocated. -> Uses shell environment variables to determine which shell to use. -> Supported shells: bash, zsh, fish, tcsh, ksh. -> Falls back to bash if shell detection fails. -> Sessions can be detached and reattached using sprite exec -id. - -**Examples:** -```bash -sprite console -sprite console -o myorg -s mysprite -``` - ## Checkpoints ### `sprite checkpoint create` -Create a new checkpoint +Usage of checkpoint create: ```bash sprite checkpoint create ``` -**Options:** -- `-c, --comment ` - Optional comment to describe this checkpoint -- `-h, --help` - Show help for this command - ### `sprite checkpoint list` -List all checkpoints +Usage of checkpoint list: ```bash -sprite checkpoint list [options] +sprite checkpoint list ``` **Aliases:** `sprite checkpoint ls`, `sprite checkpoints ls` -**Options:** -- `-h, --help` - Show help for this command -- `-h, --history ` - Filter by history version Include auto-generated checkpoints - ### `sprite checkpoint info` -Show information about a specific checkpoint +Usage of checkpoint info: ```bash -sprite checkpoint info -``` - -**Options:** -- `-h, --help` - Show help for this command - -**Examples:** -```bash -sprite checkpoint info v2 +sprite checkpoint info ``` ### `sprite checkpoint delete` -Delete a checkpoint (soft delete) +Usage of checkpoint delete: ```bash -sprite checkpoint delete +sprite checkpoint delete ``` **Aliases:** `sprite checkpoint rm` -**Options:** -- `-h, --help` - Show help for this command - -**Examples:** -```bash -sprite checkpoint delete v3 -``` - ### `sprite restore` -sprite restore - Restore from a checkpoint version +Usage of restore: ```bash -sprite restore [options] +sprite restore ``` **Aliases:** `sprite checkpoint restore` -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `-h, --help Show` - this help message - -**Examples:** -```bash -sprite restore v1 -sprite restore -o myorg -s mysprite v2 -See also: -sprite checkpoint --help Full checkpoint documentation -``` - ## Networking ### `sprite proxy` -sprite proxy - Forward local ports through the remote server proxy - -```bash -sprite proxy [options] [port2] ... or [local2:remote2] ... -``` - -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `-h, --help Show` - this help message - -> Each port will be forwarded from localhost to the remote environment. -> Use LOCAL:REMOTE syntax to map different local and remote ports. -> Multiple ports can be specified to forward multiple services simultaneously. +Usage of proxy: -**Examples:** ```bash -sprite proxy 8080 -sprite proxy 3000 8080 -sprite proxy 4005:4000 -sprite proxy 3001:3000 8081:8080 -sprite proxy -o myorg -s mysprite 8080 +sprite proxy ``` ### `sprite url` @@ -416,14 +209,21 @@ sprite proxy -o myorg -s mysprite 8080 sprite url - Manage sprite URL settings ```bash -sprite url Show sprite URL and auth setting sprite url update [options] Update URL authentication settings URL Format: https://-.sprites.dev/ Authentication Modes: sprite Allows access via browser to Sprite org members, and via org tokens (default) public No authentication - anyone with URL can access Subcommands: update Update URL authentication settings Update options: --auth Authentication type: 'public' or 'sprite' +sprite url Show sprite URL and auth setting sprite url update [options] Update URL authentication settings URL Format: https://-.sprites.dev/ Authentication Modes: sprite Allows access via browser to Sprite org members, and via org tokens (default) public No authentication - anyone with URL can access Subcommands: update Update URL authentication settings ``` +**Options:** +- `-o, --org ` - Specify organization +- `-s, --sprite ` - Specify sprite +- `-h, --help Show` - this help message +- `--auth ` - Authentication type: 'public' or 'sprite' + **Examples:** ```bash sprite url # Show current URL and auth setting sprite url update --auth public # Make URL publicly accessible sprite url update --auth sprite # Require org membership (default) +sprite url -o myorg -s mysprite # Show URL for specific sprite Accessing Authenticated URLs: Visit the URL in your browser and log in with Fly.io, or use an org token: curl -H "Authorization: Bearer $SPRITE_API_TOKEN" https://mysprite-myorg.sprites.dev/ @@ -435,81 +235,28 @@ Security Notes: ### `sprite url update` -Update URL authentication settings - -```bash -sprite url update [options] -``` - -**Options:** -- `-a, --auth ` - Authentication type: 'public' or 'sprite' (default) -- `-h, --help` - Show help for this command -- `-o, --o ` - Organization to use (shorthand) -- `-o, --org ` - Organization to use -- `-s, --s ` - Sprite to use (shorthand) -- `-s, --sprite ` - Sprite to use - -> Changes the authentication requirement for the sprite's URL. -> Use 'public' to make the URL accessible without authentication. -> Use 'sprite' to require org membership (default). +Usage of url update: -**Examples:** ```bash -sprite url update --auth public -sprite url update --auth sprite +sprite url update ``` ## Utility Commands ### `sprite api` -sprite api - Make authenticated API calls with curl - -```bash -sprite api [options] [curl options] -``` - -**Options:** -- `-o, --org ` - Specify organization -- `-s, --sprite ` - Specify sprite -- `-h, --help Show` - this help message - -> This command wraps curl to automatically add authentication headers. -> If a sprite is specified with -s, the path is relative to /v1/sprites/``/. -> If no sprite is specified, the path is relative to /v1/. -> Paths starting with /v1/sprites/ are always used as-is, ignoring any sprite context. -> All arguments after the path are passed directly to curl. +Usage of api: -**Examples:** ```bash -sprite api -o myorg /sprites -sprite api -o myorg -s my-sprite /upgrade -X POST -sprite api -o myorg -s my-sprite /exec -X GET -sprite api -o myorg -s my-sprite /checkpoints +sprite api ``` ### `sprite upgrade` -sprite upgrade - Upgrade the sprite client to the latest version - -```bash -sprite upgrade [options] -``` - -**Options:** -- `--check Check` - for updates without installing -- `--force Force` - upgrade even if already up to date -- `--version ` - Upgrade to a specific version -- `--channel ` - Release channel (release, rc, dev) -- `-h, --help Show` - this help message +Usage of upgrade: -**Examples:** ```bash -sprite upgrade # Upgrade to the latest version -sprite upgrade --check # Check for available updates -sprite upgrade --force # Force upgrade even if up to date -sprite upgrade --channel dev # Switch to the dev channel -sprite upgrade --channel rc # Switch to the rc channel +sprite upgrade ```