Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

CLI reference

The camel CLI runs, scaffolds, inspects, and compiles integration routes. Install it with cargo install camel-cli, or cargo binstall camel-cli for a prebuilt binary (see Distribution flavors).

Each command has a reference page in this section. run, new, and journal inspect also appear in the Getting started guide as walkthroughs.

Command surface

CommandPurposeReference
camel runStart a Camel context from route filesGetting started: CLI usage
camel new <NAME>Scaffold a new projectGetting started: CLI usage
camel journal inspect <FILE>Read events from a runtime journal fileGetting started: CLI usage
camel lint <FILE>Lint a route file against the production component catalogthis page
camel test <FILE|DIR>...Run declarative mock tests from *.test.yaml documentsTesting
camel job [<FILE>]Run or list jobs from *.job.yaml documentscamel job
camel compile <DOCUMENT>Pack a route or job into a self-contained artifactcamel compile
camel plugin new / camel plugin buildScaffold and build WASM pluginsOpenAPI and plugin subcommands
camel openapi generate <FILE>Emit an OpenAPI 3.0.3 document from rest: blocksOpenAPI and plugin subcommands
camel lspStart the Language Server Protocol server over stdiothis page

Flag definitions for the command enum live in crates/camel-cli/src/main.rs.

camel lint

Lint one route file against the production component catalog. The command prints diagnostics with byte-exact spans.

camel lint routes/my-route.yaml
Exit codeOutcome
0Clean. No Error diagnostics.
1At least one Error diagnostic.
2CLI misuse: missing or unreadable file.

Warnings do not change the exit code. For example, camel lint warns R-MOCK-IN-PRODUCTION on inline to: mock: sends in route files; see Testing. Reserved documents are skipped with an informational message: *.test.yaml test documents and *.job.yaml job documents.

camel lsp

Starts the Language Server Protocol server over stdio. Editors drive it; it takes no arguments. The server provides route-file diagnostics from the same lint engine.

Conventions

  • Config file. Commands that read configuration accept --config <FILE> (default: Camel.toml) and the CAMEL_CONFIG_FILE environment variable. An explicit --config wins.
  • Profiles. Set the active profile with CAMEL_PROFILE.
  • Trust model. camel run, camel test, and camel job execute route scripts, WASM modules, and beans resolved from the current working directory. Only run them from a trusted directory.
  • Exit codes. 0 success; 1 execution failure (a failed route pipeline, a failing test, an Error diagnostic); 2 usage, boot, timeout, or apparatus failure. See the per-command pages for their exact taxonomies.

See also

Reference: CLI crate