Command Line Interface (CLI)
Bell provides a powerful command-line interface to execute scripts, run test suites, convert Postman collections, and more.
Installation
If you're using Bell as a package, you can run it via npx:
npx bell-lang <command>Basic Usage
Run a Bell file:
bell run example.belOr run a Bell file directly without the run command:
bell example.belInline Execution
Execute Bell code directly from the terminal using the -c flag (use \n for newlines):
bell -c 'url "https://api.example.com/data"\nGET'Commands
run
Executes a .bel file.
bell run <file> [options]Options:
-v, --verbose: Print request/response headers and timing for each request.-e, --env <environment>: Specify an environment configuration to use.--dry-run: Parse and validate the file without sending any HTTP requests.--retry <n>: Retry failed requests up to N times with exponential backoff. RespectsRetry-Afterheaders on 429 responses.--proxy <url>: Route requests through an HTTP/HTTPS proxy (e.g.http://localhost:8080).--insecure: Disable TLS certificate verification (useful for self-signed certs in dev).--cacert <file>: Path to a custom CA certificate bundle (.pem).--output <file>: Save the last response body to a file.--json: Print the last response body as JSON to stdout (useful for piping tojq).
test
Runs .bel files as a test suite and reports pass/fail results. Exit code 1 if any assertion fails.
bell test [patterns...] [options]Arguments:
[patterns...]: Glob patterns, file paths, or directories. Defaults to the current directory.
Options:
-e, --env <environment>: Specify an environment configuration to use.--reporter <type>: Output format:text(default) orjunitfor JUnit XML (CI/CD integration).--bail: Stop after the first file that has a failure.--retry <n>: Retry failed requests up to N times.
Example:
bell test # run all .bel files in current directory
bell test tests/ # run all .bel files in tests/
bell test "tests/**/*.bel" # glob pattern
bell test tests/ --reporter junit # JUnit XML output for CI
bell test tests/ --bail # stop on first failurecheck
Checks a .bel file for syntax and semantic errors. Outputs a JSON array of diagnostics. Always exits with code 0 (diagnostics are in the output, not the exit code) — suitable for editor integrations.
bell check <file>Each diagnostic has: line, col, length, message, severity ("error" or "warning").
Warnings include:
- Undefined variable references
- Variables declared but never used
- Possible hardcoded secrets (Bearer tokens, API keys)
- Variable names that shadow builtins (
url,response)
postman
Converts a Postman collection JSON file to Bell files.
bell postman <postman-json> [options]Options:
-o, --output <dir>: Output directory for the.belfiles (default:./bell).
openapi Coming Soon
Coming Soon
Not yet available in the current release.
Converts an OpenAPI 3.x spec (JSON or YAML) to Bell files.
bell openapi <openapi-file> [options]Options:
-o, --output <dir>: Output directory for the.belfiles (default:./bell).
curl Coming Soon
Coming Soon
Not yet available in the current release.
Converts a curl command string to a Bell file. Pass the command as an argument or pipe it via stdin.
bell curl '<curl command>' [options]Options:
-o, --output <file>: Output.belfile. Defaults to stdout.
har Coming Soon
Coming Soon
Not yet available in the current release.
Converts a browser HAR export to Bell files.
bell har <har-file> [options]Options:
-o, --output <dir>: Output directory for the.belfiles (default:./bell).--filter <pattern>: Keep only URLs matching a substring or regex.--dedupe: Keep only the last request per unique method + path.--include-cookies: Include Cookie headers (stripped by default).
insomnia Coming Soon
Coming Soon
Not yet available in the current release.
Converts an Insomnia v4 export JSON to Bell files.
bell insomnia <insomnia-json> [options]Options:
-o, --output <dir>: Output directory for the.belfiles (default:./bell).
http Coming Soon
Coming Soon
Not yet available in the current release.
Converts a .http or .rest (VS Code REST Client) file to Bell files.
bell http <http-file> [options]Options:
-o, --output <dir>: Output directory for the.belfiles (default:./bell).
convert (deprecated)
Alias for bell postman. Use bell postman instead.
bell convert <postman-json> [options]Options:
-o, --output <dir>: Output directory for the.belfiles (default:./bell).
format
Formats a Bell file according to the language style.
bell format <file> [options]Options:
--check: Exit with code 1 if the file would be changed, without writing.--stdout: Print formatted output to stdout instead of writing to the file.
config
Shows the merged Bell configuration (bell.config.json + ~/.bell/bell.config.json).
bell configinit
Creates a bell/ folder with a starter example file to help you get started quickly.
bell initskill
Prints the Bell language reference for AI assistants. With --install, writes it to .claude/commands/bell.md as a Claude Code slash command.
bell skill # print to stdout
bell skill --install # install for Claude Code (project)
bell skill --install --global # install for Claude Code (global)help
Displays help information for the commands.
bell help [command]Interactive REPL
Running bell without any arguments starts the interactive REPL (Read-Eval-Print Loop), where you can type Bell commands and see the results immediately.
bell