---
title: blossom shell
url: "/docs/reference/cli/shell/"
canonical_url: https://docs.blossom88.com/docs/reference/cli/shell/
markdown_url: https://docs.blossom88.com/docs/reference/cli/shell.md
summary: Open Blossom Shell
categories:
- cli
- reference
---

# blossom shell

Open Blossom Shell

## Usage

    blossom shell [--container CONTAINER] [--environment ENVIRONMENT] [--service SERVICE] [-- COMMAND...]

## Flags

| Flag | Description |
| --- | --- |
| `--container, -c` | Container id to attach to |
| `--environment, -e` | Environment id to attach to |
| `--service` | Service id to attach to |

Examples:

    blossom shell --container container-100
    blossom shell --environment environment-100
    blossom shell --service service-100
    blossom shell --environment environment-100 -- bin/rails console

Opens Blossom Shell for a selected Container, Environment, or Service.

Without a command after `--`, Blossom opens an interactive shell in the selected
target and automatically uses the best available shell, such as bash, ash, or sh.
With a command after `--`, Blossom runs that one process and streams output until
it exits.

When its output or input is not a terminal, such as a redirect to a file, the
command runs without a TTY: output keeps its exact bytes and stderr stays
separate, as with `ssh`. The command receives no input in that case.

    blossom shell --environment environment-100 -- cat tmp/report.csv > report.csv

## Buildpack images

Buildpacks install runtimes and gems in layers. If a direct command cannot
find `ruby`, `rails`, or another installed executable, run it through the
buildpack launcher to load the runtime environment:

    blossom shell --environment environment-100 -- /cnb/lifecycle/launcher -- bundle exec rails console

Inside an interactive CLI or browser Shell, use:

    /cnb/lifecycle/launcher -- bundle exec rails console

The second `--`, after `launcher`, preserves arguments literally instead of
having the launcher expand them again. Use it for quoted code too:

    blossom shell --environment environment-100 -- /cnb/lifecycle/launcher -- bundle exec rails runner 'puts({records: Post.count}.to_json)'

For shell expansion or pipelines, explicitly run `sh -c 'COMMAND'` after the
launcher's `--`.

The launcher loads the image's runtime settings; it does not supply missing
App variables. A Rails `ENV.fetch` error still needs the named variable set
on the Environment and a new deployment to apply it.
