{"_id":"@alt-javascript/camel-lite-cli","_rev":"3-a73f18e668a9fcd3374198e313f94dcc","name":"@alt-javascript/camel-lite-cli","dist-tags":{"latest":"1.1.1"},"versions":{"1.0.2":{"name":"@alt-javascript/camel-lite-cli","version":"1.0.2","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","cli","routing","yaml"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/camel-lite-cli@1.0.2","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"},{"name":"Apache Camel — design inspiration and pattern source"}],"homepage":"https://github.com/alt-javascript/camel-lite#readme","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"bin":{"camel-lite":"bin/camel-lite.js"},"dist":{"shasum":"cf7c8eb4b80b1201882ac70f33b9d258bb07a861","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-cli/-/camel-lite-cli-1.0.2.tgz","fileCount":5,"integrity":"sha512-Er90UmDZjJ5KCTaxXhfAgw6pyvcJ8zcweC9h7m+xu+p7WoMpNw8T0izNkNwrMqAkY7vz5TY4q/3qinX7cKRKLQ==","signatures":[{"sig":"MEQCIH3XqP08R17nYoz0NOOmuuZX3OWcqA0bx66ReprLwptfAiB/EJHiUGhROG+HiWsC1Qck0EjIw5JZxMnOvGxnx84jnA==","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-cli@1.0.2","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":14619},"main":"src/index.js","type":"module","gitHead":"9f948b9f02d85c9f593229684c475cd209369f2c","scripts":{"test":"node --test test/*.test.js"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/camel-lite.git","type":"git"},"_npmVersion":"11.9.0","description":"Command-line runtime for camel-lite — load a route definition and send a message","directories":{},"_nodeVersion":"24.14.0","dependencies":{"commander":"^12.0.0","@alt-javascript/camel-lite-core":"1.0.2","@alt-javascript/camel-lite-component-ftp":"1.0.2","@alt-javascript/camel-lite-component-log":"1.0.2","@alt-javascript/camel-lite-component-sql":"1.0.2","@alt-javascript/camel-lite-component-amqp":"1.0.2","@alt-javascript/camel-lite-component-cron":"1.0.2","@alt-javascript/camel-lite-component-file":"1.0.2","@alt-javascript/camel-lite-component-http":"1.0.2","@alt-javascript/camel-lite-component-seda":"1.0.2","@alt-javascript/camel-lite-component-nosql":"1.0.2","@alt-javascript/camel-lite-component-timer":"1.0.2","@alt-javascript/camel-lite-component-direct":"1.0.2","@alt-javascript/camel-lite-component-master":"1.0.2"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/camel-lite-cli_1.0.2_1774595585845_0.5585481216372157","host":"s3://npm-registry-packages-npm-production"}},"1.1.0":{"name":"@alt-javascript/camel-lite-cli","version":"1.1.0","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","cli","routing","yaml"],"author":{"name":"Craig Parravicini"},"license":"MIT","_id":"@alt-javascript/camel-lite-cli@1.1.0","maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"contributors":[{"url":"Anthropic","name":"Claude"}],"homepage":"https://github.com/alt-javascript/camel-lite#readme","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"bin":{"camel-lite":"bin/camel-lite.js"},"dist":{"shasum":"0f5af0983dc08101fc93c0946c185dff84a337e0","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-cli/-/camel-lite-cli-1.1.0.tgz","fileCount":4,"integrity":"sha512-0dCwqrxUSaoGFJBIOCq79xIkz2TE74NmtZ3vHo4ZSRQv7AzIqFqjkdlbPtatK5lLI4oxAuY5Mt4R2FEokdoRNQ==","signatures":[{"sig":"MEYCIQDs611Rpc2KKnXhJbLGtxo3Us1NpYy57ohY4jmp6Y2A7gIhAMRX3BKFYGZTvXUZYlN6VTeupw+4ypKjyyrM7n5xUKTV","keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U"}],"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-cli@1.1.0","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"unpackedSize":26347},"main":"src/index.js","type":"module","gitHead":"c227a03632d4b1e2f93b4562c7e74f52ba87d340","scripts":{"test":"node --test test/*.test.js"},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"repository":{"url":"git+https://github.com/alt-javascript/camel-lite.git","type":"git"},"_npmVersion":"11.9.0","description":"Command-line runtime for camel-lite — load a route definition and send a message","directories":{},"_nodeVersion":"24.14.0","dependencies":{"commander":"^12.0.0","@alt-javascript/cdi":"^3.0.7","@alt-javascript/boot":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/camel-lite-core":"1.1.0","@alt-javascript/boot-camel-lite-starter":"1.1.0","@alt-javascript/boot-camel-lite-extras-starter":"1.1.0"},"publishConfig":{"access":"public","registry":"https://registry.npmjs.org/"},"_hasShrinkwrap":false,"_npmOperationalInternal":{"tmp":"tmp/camel-lite-cli_1.1.0_1774763492001_0.6627723505350631","host":"s3://npm-registry-packages-npm-production"}},"1.1.1":{"name":"@alt-javascript/camel-lite-cli","version":"1.1.1","description":"Command-line runtime for camel-lite — load a route definition and send a message","type":"module","main":"src/index.js","bin":{"camel-lite":"bin/camel-lite.js"},"scripts":{"test":"node --test test/*.test.js"},"dependencies":{"commander":"^12.0.0","@alt-javascript/camel-lite-core":"1.1.1","@alt-javascript/boot":"^3.0.7","@alt-javascript/cdi":"^3.0.7","@alt-javascript/config":"^3.0.7","@alt-javascript/boot-camel-lite-starter":"1.1.1","@alt-javascript/boot-camel-lite-extras-starter":"1.1.1"},"keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","cli","routing","yaml"],"author":{"name":"Craig Parravicini"},"license":"MIT","repository":{"type":"git","url":"git+https://github.com/alt-javascript/camel-lite.git"},"contributors":[{"name":"Claude","url":"Anthropic"}],"publishConfig":{"registry":"https://registry.npmjs.org/","access":"public"},"gitHead":"ff8501eed381d38ac20f56aea721274466d64212","_id":"@alt-javascript/camel-lite-cli@1.1.1","bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"homepage":"https://github.com/alt-javascript/camel-lite#readme","_nodeVersion":"24.14.0","_npmVersion":"11.9.0","dist":{"integrity":"sha512-0jTmaXdyVOwGjq0TIIyiq/whErevpbtjcJJXlUluu2VjUamwb46ZYysHQDQU+jQGfRmgCIuVBkzQgKzzKR+KPQ==","shasum":"7477379625ad1f7e234a7848ffd692d62a1a268c","tarball":"https://registry.npmjs.org/@alt-javascript/camel-lite-cli/-/camel-lite-cli-1.1.1.tgz","fileCount":4,"unpackedSize":26347,"attestations":{"url":"https://registry.npmjs.org/-/npm/v1/attestations/@alt-javascript%2fcamel-lite-cli@1.1.1","provenance":{"predicateType":"https://slsa.dev/provenance/v1"}},"signatures":[{"keyid":"SHA256:DhQ8wR5APBvFHLF/+Tc+AYvPOdTpcIDqOhxsBHRwC7U","sig":"MEQCIDrg+NwGhfUf9/6hMqPACngYsrmVozOyUBleuZCUradBAiBFiwiYqWee12bazUIsXy1sWeAle4phvFYASI5nLsbg2Q=="}]},"_npmUser":{"name":"craigparra","email":"craigparra@gmail.com"},"directories":{},"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages-npm-production","tmp":"tmp/camel-lite-cli_1.1.1_1774764448115_0.7071727808937138"},"_hasShrinkwrap":false}},"time":{"created":"2026-03-27T07:13:05.742Z","modified":"2026-03-29T06:07:28.589Z","1.0.2":"2026-03-27T07:13:06.009Z","1.1.0":"2026-03-29T05:51:32.136Z","1.1.1":"2026-03-29T06:07:28.283Z"},"bugs":{"url":"https://github.com/alt-javascript/camel-lite/issues"},"author":{"name":"Craig Parravicini"},"license":"MIT","homepage":"https://github.com/alt-javascript/camel-lite#readme","keywords":["alt-javascript","camel","camel-lite","eai","eip","integration","cli","routing","yaml"],"repository":{"type":"git","url":"git+https://github.com/alt-javascript/camel-lite.git"},"description":"Command-line runtime for camel-lite — load a route definition and send a message","contributors":[{"name":"Claude","url":"Anthropic"}],"maintainers":[{"name":"craigparra","email":"craigparra@gmail.com"}],"readme":"# camel-lite-cli\n\n[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](../../LICENSE)\n\nCommand-line runtime for camel-lite. Load a route definition and run it — inject a single message, receive messages from a URI, or keep the context alive in daemon mode.\n\n## Install\n\n```sh\nnpm install -g @alt-javascript/camel-lite-cli\n```\n\n## Quick Start\n\n```sh\n# Run a route file silently\ncamel-lite -r route.yaml\n\n# Inject a JSON body and print any reply\ncamel-lite -r route.yaml -i '{\"name\":\"world\"}'\n\n# Keep a timer route running until Ctrl-C\ncamel-lite -r timer-route.yaml -d\n\n# Consume messages from a URI and print each body to stdout\ncamel-lite -r route.yaml -c seda:orders\n\n# Show framework logs while debugging a route\ncamel-lite --debug -r route.yaml -i '{\"name\":\"world\"}'\n```\n\n## Usage\n\n```\ncamel-lite -r <file|-> [options]\n```\n\n### Required\n\n| Flag | Description |\n|------|-------------|\n| `-r`, `--routes <file\\|->` | Route definition file (`.yaml`, `.yml`, `.json`) or `-` to read from stdin |\n\n### Input / Output\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `-i`, `--input <body\\|->` | Message body to inject into the first `from:` endpoint. Accepts a JSON string, a plain string, or `-` to read from stdin | *(none — no message sent)* |\n| `-p`, `--producer-uri <uri>` | Override the target endpoint URI for `-i`. Requires `-i`. Default: the first route's `from:` URI | *(first route `from:` URI)* |\n| `--exchange-pattern <pattern>` | `InOnly` or `i` — fire-and-forget (exit after send). `InOut` or `io` — request-reply (prints reply body to stdout). Case-insensitive. | `InOnly` |\n| `-c`, `--consumer-uri <uri>` | Poll a consumer URI in a daemon loop, printing each message body to stdout. Implies daemon mode. Mutually exclusive with `-i` and `-p` | *(none)* |\n\n### Runtime Behaviour\n\n| Flag | Description | Default |\n|------|-------------|---------|\n| `-d`, `--daemon` | Keep the context alive until `SIGINT`/`SIGTERM`. Use for timer, cron, and seda-driven routes | `false` |\n| `-l`, `--log-mode <text\\|json>` | Log output format: `text` (human-readable) or `json` (structured JSON objects) | `text` |\n\n### Logging\n\nBy default, all camel-lite and boot framework log output is suppressed — the CLI is pipe-friendly and produces zero stderr output unless a flag is set.\n\n| Flag | Description |\n|------|-------------|\n| `--verbose` | Enable info-level framework logging on stderr |\n| `--debug` | Enable debug-level framework logging on stderr. Takes precedence over `--verbose` |\n\n### Other\n\n| Flag | Description |\n|------|-------------|\n| `-v`, `--version` | Print the CLI version and exit |\n| `-h`, `--help` | Print help and exit |\n\n## Flag Constraints\n\n- `-r -` and `-i -` are mutually exclusive: only one argument can read from stdin.\n- `-p` requires `-i`. Specifying a producer URI without a body to send is an error.\n- `-c` is mutually exclusive with `-i` and `-p`. Consumer mode and producer mode are separate operations.\n- `--exchange-pattern` accepts `InOnly`, `i`, `InOut`, or `io` (case-insensitive). Any other value is an error.\n\n## Examples\n\n### Fire-and-forget message\n\n```sh\ncamel-lite -r route.yaml -i '{\"order\":\"ABC-1\",\"qty\":5}'\n```\n\nSends the JSON body to the first route's `from:` URI. Exits after the route completes. No output unless the route writes to stdout.\n\n### Request-reply (InOut)\n\n```sh\ncamel-lite -r transform-route.yaml -i 'hello' --exchange-pattern InOut\n```\n\nSends `hello`, waits for the reply, and prints the reply body to stdout.\n\n### Send to a specific endpoint\n\n```sh\ncamel-lite -r route.yaml -i '{\"event\":\"login\"}' -p seda:audit\n```\n\nSends the body to `seda:audit` instead of the route's default `from:` URI.\n\n### Read route and body from stdin\n\n```sh\n# Route from stdin, body as argument\ncat route.yaml | camel-lite -r - -i '{\"name\":\"world\"}'\n\n# Route as argument, body from stdin\necho '{\"name\":\"world\"}' | camel-lite -r route.yaml -i -\n```\n\n### Daemon mode\n\n```sh\ncamel-lite -r cron-route.yaml -d\n```\n\nKeeps the context running. Press Ctrl-C or send `SIGTERM` to stop.\n\n### Consumer daemon\n\n```sh\ncamel-lite -r route.yaml -c timer:tick?period=1000\n```\n\nPolls `timer:tick` in a loop. Each message body is printed to stdout on a new line. Runs until `SIGINT` or `SIGTERM`.\n\n```sh\ncamel-lite -r route.yaml -c seda:results | tee results.log\n```\n\nPipe consumer output to another tool — the CLI writes one body per line to stdout.\n\n### Logging\n\n```sh\n# Show info-level framework logs (route registration, context start/stop)\ncamel-lite --verbose -r route.yaml -i body\n\n# Show debug-level logs (per-message dispatch, timer fires, lock renewal)\ncamel-lite --debug -r route.yaml -i body\n\n# --debug wins when both are present\ncamel-lite --debug --verbose -r route.yaml -i body\n\n# JSON-structured log lines (combine with --verbose or --debug)\ncamel-lite --verbose -l json -r route.yaml -i body\n```\n\n### Missing home config directory\n\nIf `~/.camel-lite/` does not exist, the CLI starts silently with no user config. No error is thrown.\n\n## User Configuration\n\nThe CLI loads `application.yaml` (or `application.json`) from `~/.camel-lite/` on every invocation. Place component connection strings, default log levels, or any `boot.camel-lite.*` properties there.\n\n```\n~/.camel-lite/\n  application.yaml\n```\n\nExample `~/.camel-lite/application.yaml`:\n\n```yaml\nboot:\n  camel-lite:\n    amqp:\n      url: amqp://localhost:5672\n      username: guest\n      password: guest\n```\n\nValues in `~/.camel-lite/application.yaml` are overridden by the CLI's own `EphemeralConfig` overlay (logging level, banner suppression), and can themselves be overridden by environment variables loaded through the same config chain.\n\n## Exit Codes\n\n| Code | Meaning |\n|------|---------|\n| `0` | Success |\n| `1` | Validation error (bad flags), route error, or unhandled exception |\n\nError messages are written to stderr in the format `camel-lite: error: <message>`.\n\n## Troubleshooting\n\n**No output in silent mode is expected.** All framework log lines are suppressed by default. Use `--verbose` or `--debug` to see what the route is doing.\n\n**`camel-lite: error: -r / --routes is required`** — The `-r` flag is mandatory. Every invocation must specify a route definition file.\n\n**`camel-lite: error: -p / --producer-uri requires -i / --input`** — You specified a target URI with `-p` but did not provide a body to send. Add `-i <body>`.\n\n**`camel-lite: error: -c / --consumer-uri is mutually exclusive with -i / --input`** — Consumer mode (`-c`) and producer mode (`-i`) cannot be combined. Choose one.\n\n**`camel-lite: fatal: <message>`** — An unhandled exception occurred during CDI boot or route execution. Run with `--debug` to see the full log trace leading up to the error.\n\n**Route exits immediately without processing** — Without `-d` or `-c`, the context stops as soon as the initial message (if any) completes. Add `-d` for timer, cron, or seda-driven routes that need to stay alive.\n\n## Runtime Architecture\n\nThe CLI uses a full CDI boot stack for every invocation:\n\n1. `EphemeralConfig` overlay is constructed with the computed log level and banner suppression.\n2. User config is loaded synchronously from `~/.camel-lite/` via `ProfileConfigLoader`.\n3. A `PropertySourceChain` is composed: overlay (highest priority) → user config.\n4. `Boot.boot({ config })` initialises the CDI container with the chained config.\n5. `camelLiteExtrasStarter` registers all 12 component schemes into the CDI context.\n6. `CdiCamelRuntime` loads the route definition and starts the `CamelContext`.\n7. `ProducerTemplate` or `ConsumerTemplate` performs the requested operation.\n8. The context is stopped (unless `-d` or `-c` keeps it alive).\n\nAll 12 camel-lite component schemes are pre-loaded. Components whose external broker or service is unavailable at startup fail gracefully — the route starts with the available components.\n\n## See Also\n\n- [camel-lite root README](../../README.md)\n- [camel-lite-core](../camel-lite-core/README.md) — `CamelContext`, `RouteBuilder`, `ProducerTemplate`, `ConsumerTemplate`\n- [boot-camel-lite-starter](../boot-camel-lite-starter/README.md) — CDI auto-configuration for core + 8 components\n- [boot-camel-lite-extras-starter](../boot-camel-lite-extras-starter/README.md) — CDI auto-configuration for amqp/sql/nosql/master\n","readmeFilename":"README.md"}