Metadata-Version: 2.5
Name: bloom-launch
Version: 0.1.0a2
Summary: Scoped launcher for native coding harnesses
License-Expression: Apache-2.0
License-File: LICENSE
Classifier: Development Status :: 3 - Alpha
Classifier: Environment :: Console
Classifier: Operating System :: MacOS
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Requires-Python: >=3.12
Requires-Dist: keyring<26,>=25.6
Description-Content-Type: text/markdown

# Bloom Launch

Connect your installed Claude Code or OpenCode to the Bloom gateway for one invocation.
Your Coding Harness retains its normal settings, permissions, plugins, and history.
Plain `claude` or `opencode` continues to use its normal connection.

## Install

Requirements: Python **3.12 or later**, plus Claude Code or OpenCode already installed and available on `PATH`.
macOS is the primary platform. Bloom does not install or repair your Coding Harness.

These instructions describe `0.1.0a2`; if not yet available on PyPI, collaborators can use a source checkout.
The selected source version is `0.1.0a2`.

When available on PyPI, install this exact version with either tool:

```sh
uv tool install --prerelease allow 'bloom-launch==0.1.0a2'
# Or:
pipx install --pip-args=--pre 'bloom-launch==0.1.0a2'
```

Collaborators need access to the private [repository](https://github.com/Bloom-Factory-Engineering/bloom-cli) for a source checkout.
Use a checkout whose project metadata and lockfile both specify `0.1.0a2` before running:

```sh
uv sync --locked --group dev
uv run --no-sync bloom launch claude
# Or:
uv run --no-sync bloom launch opencode
```

The commands below use `bloom`. In a source checkout, use `uv run --no-sync bloom` instead.
Repository collaborators can read [installation details](https://github.com/Bloom-Factory-Engineering/bloom-cli/blob/staging/docs/installation.md).

## Launch and arguments

This section describes `0.1.0a2`, including cached keys and optional input limits.
The published `0.1.0a1` lacks this behavior. For its setup, use the [historical PyPI instructions](https://pypi.org/project/bloom-launch/0.1.0a1/).

```sh
bloom --help
bloom --version
bloom launch --help
bloom launch claude
bloom launch opencode
bloom launch claude --model EXACT_GATEWAY_MODEL_ID
bloom launch opencode --config
bloom launch claude --config --model EXACT_GATEWAY_MODEL_ID
bloom launch opencode --base_url http://127.0.0.1:4000
```

| Argument | Purpose |
| --- | --- |
| `-h`, `--help` | Show global help or `launch` help. |
| `--version` | Show the package version. Use before `launch`. |
| `launch {claude,opencode}` | Select the installed Coding Harness. |
| `--config` | Replace the gateway key and the current harness's default model. |
| `--model EXACT_GATEWAY_MODEL_ID` | Select an exact, full gateway model ID. |
| `--base_url BASE_URL` | Select the gateway for this invocation. |

There are no profiles, model-list commands, or native argument forwarding. `--url` and `--endpoint` are not supported.

### First setup and saved defaults

On first setup, enter your Bloom virtual key (vkey) at the hidden prompt, then select a numbered connected model.
After any required hidden key prompt, `Fetching models...` covers discovery and optional metadata lookup.
It uses an animated ASCII spinner on a TTY and a plain line otherwise.
The indicator stops before the picker, native handoff, or error output, including cancellation.
Later launches reuse the cached key and the harness's saved model, with discovery and access checked on every launch.
Each normalized gateway shares one key across both harnesses. Each harness has a separate model default.

`--config` prompts for a replacement key and displays model choices.
Bloom saves the key and current harness's model atomically after discovery, selection, and native preparation succeed.
A failed or cancelled replacement preserves the previous settings.
`--model` overrides a valid saved default temporarily. Without a usable default, a valid explicit model becomes the initial saved selection.

Picker labels remove one leading UUID prefix for readability only. Stored IDs and IDs sent to the gateway remain unchanged.
For `--model`, replace `EXACT_GATEWAY_MODEL_ID` with the full gateway ID, including any UUID prefix.
If you only know the shortened label, use the numbered picker instead.

### Optional reported input limits

When available, picker labels include a reported input budget, such as `provider/model (context window: 272K)`.
The number is an example, not a claim about a real model.
Captions use decimal units: `K` means 1,000 and `M` means 1,000,000, with rounded display values.
Bloom saves only the selected model's limit under its exact ID and gateway, then reuses it on later launches.
Missing limits trigger an optional lookup. `--config` attempts a refresh and can retain a matching cached limit if that refresh fails.
A temporary `--model` override can cache its own limit without replacing the saved default.

For `https://gateway.bloomfactory.ai`, Bloom uses the existing public catalog at `https://app.bloomfactory.ai/api/v2/models/catalog?provider=...` without credentials.
Custom gateways skip new catalog lookups. Bloom does not infer an API host.
Missing or invalid metadata does not block launch or change model access.

Claude receives the reported value through the invocation overlay's `CLAUDE_CODE_MAX_CONTEXT_TOKENS` field.
The private `max_input_tokens` map and Claude overlay retain exact integers, without caption rounding.
Without a usable value, Bloom preserves existing native context configuration. OpenCode uses the value only for picker labels and launcher caching.
The `context window` caption labels an advisory budget, possibly from `max_tokens` fallback, not verified provider context or native capacity.
Synthetic mapping checks do not establish that an installed Claude warning disappears.

### Gateways and credentials

The default is always `https://gateway.bloomfactory.ai`. A custom invocation does not change that default.
Use `--base_url` for an alternative HTTPS gateway or an explicitly specified `http://` development gateway.
Path prefixes and a terminal `/v1` are supported without duplicating `/v1`.
URLs must not contain credentials, queries, or fragments.

Bloom saves credentials in `$HOME/.config/bloom/launcher.json` with owner-only permissions (`0600`).
**This file contains a secret. Do not paste or share its contents.**
Never put a vkey in command arguments, a URL, a project file, or an error report.
Environment variables, credential helpers, and Keychain cannot supply the key. Setup requires an interactive terminal with hidden input.

## Troubleshooting

- If a cached key is rejected, use `--config` to replace it.
- Discovery requires `/v1/models`, `/key/info`, and a concrete connected model ID. Wildcard entries are filtered, including in mixed grant lists.
- Wildcard-only grants cannot supply a model choice. Discovery does not establish native model compatibility.
- Complete native setup, trust, and permission prompts normally. Shell approvals follow native permissions and workspace instructions, not connection errors.
- Claude may assume a fallback context window for unrecognized custom model IDs. See [Claude's guidance](https://code.claude.com/docs/en/model-config#correct-the-window-for-a-gateway-or-custom-model-id).

Repository collaborators can read the detailed [launch behavior](https://github.com/Bloom-Factory-Engineering/bloom-cli/blob/staging/docs/quick-launch.md).

## License

Bloom Launch uses the [Apache License, Version 2.0](https://www.apache.org/licenses/LICENSE-2.0).
