Metadata-Version: 2.5
Name: bloom-launch
Version: 0.2.1
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, Codex, or OpenCode to the Bloom gateway for one invocation.
Claude Code and OpenCode retain their normal settings, permissions, plugins, and history.
Codex uses a separate persistent Bloom-owned home at `$HOME/.config/bloom/codex` for its native state and project trust.
Plain `claude`, `codex`, or `opencode` continues to use its normal connection.

## Install

Requirements: Python **3.12 or later**, plus Claude Code, Codex CLI `0.167.2`, or OpenCode already installed and available on `PATH`.
macOS is the primary platform. Bloom does not install or repair your Coding Harness.
Codex has structural adapter evidence only. Live Bloom, tool/history, and full interactive qualification remain unrecorded.
The bundled Codex command does not establish a Qualified Harness Path or satisfy the release's native acceptance gate.
Before launching, follow the [Claude Code installation instructions](https://docs.anthropic.com/en/docs/claude-code/overview), [Codex CLI installation instructions](https://developers.openai.com/codex/), or [OpenCode installation instructions](https://opencode.ai/docs/installation/).

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

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

```sh
uv tool install 'bloom-launch==0.2.1'
# Or:
pipx install 'bloom-launch==0.2.1'
```

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.2.1` before running:

```sh
uv sync --locked --group dev
uv run --no-sync bloom launch claude
# Or:
uv run --no-sync bloom launch codex
# 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 cached vkeys and configurable agent IDs.
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
bloom launch claude --agent-id Alex
bloom launch claude --session-id session-123
```

Bloom sends extra arguments to the selected Coding Harness. For example, use `-p` with Claude Code or `run` with OpenCode:

```sh
bloom launch claude -p "say hi"
bloom launch opencode run "say hi"
```

Use `--` when you want to mark the start of native arguments clearly. Bloom sends every argument after it unchanged:

```sh
bloom launch claude -- --verbose
```

Bloom keeps `--model` for its own gateway model selection. Bloom also keeps Claude Code's `--settings` option for its private settings file.

| Argument | Purpose |
| --- | --- |
| `-h`, `--help` | Show global help or `launch` help. |
| `--version` | Show the package version. Use before `launch`. |
| `launch {claude,codex,opencode}` | Select the installed Coding Harness. |
| `--config` | Replace the gateway vkey 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. |
| `--agent-id VALUE` | Set an agent ID for this invocation without saving it. |
| `--session-id VALUE` | Set a transient session ID for this invocation without saving it. |

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

### First setup and saved defaults

On first setup, enter your Bloom vkey at the hidden prompt, select a numbered connected model, then enter an optional agent ID.
Use `Alex` or `Platform` as examples. Leave the prompt blank to clear the saved agent ID.
After any required hidden vkey 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.
Ordinary launches use the cached vkey and the harness's saved model for direct native handoff without launcher HTTP or progress output.
First setup, `--config`, and explicit `--model` perform discovery and access checks before handoff.
Each normalized gateway shares one vkey across all three harnesses. Each harness has a separate model default.

`--config` prompts for a replacement vkey, displays model choices, and prompts for an agent ID.
Bloom saves the vkey, agent ID, 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.

### 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 the vkey, agent ID, and harness defaults in the global `$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.
When an agent ID exists, Bloom configures `X-Bloom-Agent-ID` for Claude Code, Codex, and OpenCode.
Claude does not use a default `bloom-launch-claude` value.
The saved agent ID is shared across gateways and harnesses. A direct `--agent-id VALUE` override applies only to that launch and is not saved.
`--session-id VALUE` is also transient and is forgotten when the harness exits. Bloom sends it as `X-Bloom-Session-ID`; omitting the flag sends no session header.
Session IDs use the same printable-ASCII validation as agent IDs. Blank or invalid values are rejected.
Environment variables, credential helpers, and Keychain cannot supply the vkey. Setup requires an interactive terminal with hidden input.

## Troubleshooting

- If a cached vkey 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).
