Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Add copy buttons to all
 blocks\n(function() {\n function addCopyButtons() {\n document.querySelectorAll('pre code').forEach(function(codeBlock) {\n if (codeBlock.parentElement.hasAttribute('data-copy-added')) return;\n codeBlock.parentElement.setAttribute('data-copy-added', 'true');\n \n var btn = document.createElement('button');\n btn.textContent = 'Copy';\n btn.style.cssText = 'position:absolute;top:4px;right:4px;padding:2px 8px;font-size:11px;background:#4ecdc4;border:none;border-radius:4px;color:#1a1a2e;cursor:pointer;opacity:0.7;transition:opacity 0.2s;';\n btn.onmouseover = function() { this.style.opacity = '1'; };\n btn.onmouseout = function() { this.style.opacity = '0.7'; };\n btn.onclick = function() {\n navigator.clipboard.writeText(codeBlock.textContent).then(function() {\n btn.textContent = 'Copied!';\n setTimeout(function() { btn.textContent = 'Copy'; }, 1500);\n });\n };\n codeBlock.parentElement.style.position = 'relative';\n codeBlock.parentElement.appendChild(btn);\n });\n }\n \n addCopyButtons();\n \n // Re-run on dynamic content\n var observer = new MutationObserver(addCopyButtons);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Add Copy Buttons to Code Blocks");
}
} catch(__e) { console.warn('[Userscript:Add Copy Buttons to Code Blocks]', __e); }
})();
(function(){
try {
var __m = "github.com";
var __re = new RegExp('^' + "github\\.com" + '
Skip to content

Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Force GitHub README to respect dark mode\n(function() {\n var style = document.createElement('style');\n style.textContent = '\n .markdown-body {\n color-scheme: dark light;\n }\n .markdown-body pre { background: #161b22 !important; }\n .markdown-body code { background: rgba(110, 118, 129, 0.4) !important; }\n .markdown-body table th, .markdown-body table td { border-color: #30363d !important; }\n .markdown-body img { background: #0d1117; }\n .markdown-body blockquote { border-left-color: #8b949e; }\n .markdown-body hr { border-color: #30363d; }\n ';\n document.head.appendChild(style);\n})();", "GitHub Dark Mode README Fix"); } } catch(__e) { console.warn('[Userscript:GitHub Dark Mode README Fix]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Highlight search terms from Google/DuckDuckGo/Bing referrer\n(function() {\n var ref = document.referrer;\n var terms = [];\n \n if (ref.includes('google.com') || ref.includes('duckduckgo.com') || ref.includes('bing.com')) {\n var url = new URL(ref);\n var q = url.searchParams.get('q') || url.searchParams.get('p');\n if (q) {\n terms = q.split(/\\s+/).filter(function(t) { return t.length > 2; });\n }\n }\n \n if (terms.length === 0) return;\n \n var style = document.createElement('style');\n style.textContent = '.userscript-highlight { background: #fbbf24; color: #1a1a2e; padding: 1px 3px; border-radius: 2px; }';\n document.head.appendChild(style);\n \n function highlight(node) {\n if (node.nodeType === 3) { // text node\n var text = node.textContent;\n var found = false;\n terms.forEach(function(term) {\n var regex = new RegExp('(' + term.replace(/[.*+?^${}()|[\\]\\\\]/g, '\\\\') + ')', 'gi');\n if (regex.test(text)) {\n found = true;\n var frag = document.createDocumentFragment();\n var parts = text.split(regex);\n parts.forEach(function(part, i) {\n if (i % 2 === 0) {\n frag.appendChild(document.createTextNode(part));\n } else {\n var span = document.createElement('span');\n span.className = 'userscript-highlight';\n span.textContent = part;\n frag.appendChild(span);\n }\n });\n node.parentNode.replaceChild(frag, node);\n }\n });\n } else if (node.nodeType === 1 && node.childNodes) { // element\n var skipTags = ['SCRIPT', 'STYLE', 'NOSCRIPT', 'TEXTAREA', 'INPUT', 'SELECT'];\n if (!skipTags.includes(node.tagName)) {\n Array.from(node.childNodes).forEach(highlight);\n }\n }\n }\n \n highlight(document.body);\n \n // Re-highlight on dynamic content\n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1 || node.nodeType === 3) highlight(node);\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Highlight Search Terms"); } } catch(__e) { console.warn('[Userscript:Highlight Search Terms]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Strip utm_, fbclid, gclid, etc. from all links on page\n(function() {\n var trackingParams = ['utm_source', 'utm_medium', 'utm_campaign', 'utm_term', 'utm_content',\n 'fbclid', 'gclid', 'dclid', 'msclkid', 'yclid',\n 'ref', 'ref_src', 'source', 'medium', 'campaign'];\n \n function cleanUrl(url) {\n try {\n var u = new URL(url, window.location.origin);\n var changed = false;\n trackingParams.forEach(function(p) {\n if (u.searchParams.has(p)) {\n u.searchParams.delete(p);\n changed = true;\n }\n });\n return changed ? u.toString() : url;\n } catch (e) {\n return url;\n }\n }\n \n function cleanLinks() {\n document.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n \n cleanLinks();\n \n var observer = new MutationObserver(function(mutations) {\n mutations.forEach(function(m) {\n m.addedNodes.forEach(function(node) {\n if (node.nodeType === 1) {\n if (node.tagName === 'A') cleanLinks();\n node.querySelectorAll('a[href]').forEach(function(a) {\n var clean = cleanUrl(a.href);\n if (clean !== a.href) a.href = clean;\n });\n }\n });\n });\n });\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "Remove Tracking Parameters from Links"); } } catch(__e) { console.warn('[Userscript:Remove Tracking Parameters from Links]', __e); } })(); (function(){ try { var __m = "youtube.com"; var __re = new RegExp('^' + "youtube\\.com" + '
Skip to content

Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Auto-enable theater mode on YouTube\n(function() {\n function tryTheater() {\n var btn = document.querySelector('button[aria-label=\"Theater mode\"], ytd-player #player button[title=\"Theater mode\"]');\n if (btn && !btn.classList.contains('activated')) {\n btn.click();\n }\n }\n \n // Try immediately\n tryTheater();\n \n // Try after navigation (SPA)\n var lastUrl = location.href;\n setInterval(function() {\n if (location.href !== lastUrl) {\n lastUrl = location.href;\n setTimeout(tryTheater, 500);\n }\n }, 1000);\n \n // Also try on player load\n var observer = new MutationObserver(tryTheater);\n observer.observe(document.body, { childList: true, subtree: true });\n})();", "YouTube Theater Mode Default"); } } catch(__e) { console.warn('[Userscript:YouTube Theater Mode Default]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Remove or un-stick sticky/fixed headers that block content\n(function() {\n function unstick() {\n document.querySelectorAll('header, nav, [role=\"banner\"], .header, .navbar, .sticky, .fixed-top, [style*=\"position: fixed\"], [style*=\"position:sticky\"]').forEach(function(el) {\n if (el.style.position === 'fixed' || el.style.position === 'sticky' || \n getComputedStyle(el).position === 'fixed' || getComputedStyle(el).position === 'sticky') {\n el.style.position = 'static';\n el.style.top = 'auto';\n el.style.zIndex = 'auto';\n }\n });\n }\n \n unstick();\n \n var observer = new MutationObserver(unstick);\n observer.observe(document.body, { childList: true, subtree: true, attributes: true, attributeFilter: ['style', 'class'] });\n})();", "Kill Sticky Headers"); } } catch(__e) { console.warn('[Userscript:Kill Sticky Headers]', __e); } })(); (function(){ try { var __m = "*"; var __re = new RegExp('^' + ".*" + '
Skip to content

Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages

, 'i'); if (__m === '*' || __re.test(location.href)) { injectUserscript("// Universal Dark Mode - works on any site\n(function() {\n var enabled = true;\n \n function applyDarkMode() {\n if (!enabled) return;\n \n // Create style element if it doesn't exist\n var style = document.getElementById('universal-dark-mode-style');\n if (!style) {\n style = document.createElement('style');\n style.id = 'universal-dark-mode-style';\n document.head.appendChild(style);\n }\n \n // Dark mode CSS - inverts colors but preserves images/video\n style.textContent = '\n /* Invert everything except media */\n html {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #1a1a2e !important;\n }\n \n /* Restore images, videos, iframes, canvas */\n img, video, iframe, canvas, svg, picture, [style*=\"background-image\"] {\n filter: invert(1) hue-rotate(180deg) !important;\n }\n \n /* Preserve specific elements that should not be inverted */\n .no-dark-mode, .no-dark-mode *,\n [data-theme=\"light\"], [data-theme=\"light\"],\n .ace_editor, .ace_editor *,\n .CodeMirror, .CodeMirror *,\n .monaco-editor, .monaco-editor *,\n .markdown-body pre, .markdown-body pre *,\n .highlight, .highlight *,\n pre code, pre code * {\n filter: none !important;\n }\n \n /* Fix common UI elements */\n .modal, .popup, .dropdown-menu, .tooltip, .popover {\n filter: invert(1) hue-rotate(180deg) !important;\n background: #2d2d44 !important;\n border-color: #444 !important;\n }\n \n /* Scrollbars */\n ::-webkit-scrollbar { background: #1a1a2e !important; }\n ::-webkit-scrollbar-thumb { background: #444 !important; }\n ::-webkit-scrollbar-thumb:hover { background: #555 !important; }\n \n /* Selection */\n ::selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ::-moz-selection { background: #4ecdc4 !important; color: #1a1a2e !important; }\n ';\n }\n \n function removeDarkMode() {\n var style = document.getElementById('universal-dark-mode-style');\n if (style) style.remove();\n }\n \n // Toggle with Alt+Shift+D\n document.addEventListener('keydown', function(e) {\n if (e.altKey && e.shiftKey && e.key === 'D') {\n e.preventDefault();\n enabled = !enabled;\n if (enabled) {\n applyDarkMode();\n console.log('[Universal Dark Mode] Enabled');\n } else {\n removeDarkMode();\n console.log('[Universal Dark Mode] Disabled');\n }\n }\n });\n \n // Apply on load\n applyDarkMode();\n \n // Re-apply on dynamic content\n var observer = new MutationObserver(function(mutations) {\n if (enabled && !document.getElementById('universal-dark-mode-style')) {\n applyDarkMode();\n }\n });\n observer.observe(document.head, { childList: true });\n \n console.log('[Universal Dark Mode] Loaded - Press Alt+Shift+D to toggle');\n})();", "Universal Dark Mode"); } } catch(__e) { console.warn('[Userscript:Universal Dark Mode]', __e); } })(); })();
Skip to content

Repository files navigation

I Message Queue CLI (@imqueue/cli)

Build Statusnpm versionLicense

Why?

Frees you from writing boilerplate when making @imqueue services.

Documentation

This README is a quick reference. The full user manual is published at imqueue.org/cli (and mirrored in the project wiki). Commercial licensing & support: imqueue.com. Using an AI assistant? Point it at imqueue.org/llms.txt or see AGENTS.md. Current version, licence and Node floor for every package: imqueue.org/status.json. Wiki chapters:

(The command listings below are abridged; run imq <command> --help for the authoritative, always-current options.)

Install

As simple as:

npm i -g @imqueue/cli

Usage

To start simply run after install:

imq

@imqueue/cli first of all provides a way to manage your @imqueue/rpc based services and clients based on desired configuration.

@imqueue Command Line Interface
Usage: imq <command>
Commands:
imq client Manage @imqueue client
imq completions Generates completions script for your shell
imq config Manage @imqueue CLI settings
imq ctl <action> Start/stop/restart/status a bulk of local services
imq log [services..] Tail and combine local service logs
imq service Manage @imqueue service
imq up Bulk-update service dependencies
Options:
--version Show version number [boolean]
--help Show help [boolean]

Upgrading from 3.x: the standalone imqctl, imqlog and imqup shell tools are now native subcommands — imq ctl, imq log and imq up. The options are unchanged; see Controlling Local Services.

On every interactive run imq checks npm for a newer release and offers to self-update. Set IMQ_NO_UPDATE_CHECK=1 to skip that check.

Service Management

The main essence of this command-line tool is to provide simple way of creating services based on boilerplate templates.

Service creation is organized around four independent, pluggable axes so you can mix and match the tools you actually use:

  • VCS host (--vcs): github (default), gitlab, bitbucket
  • CI provider (--ci): github-actions (default), circleci, travis (legacy). Choices are filtered to those compatible with the selected host.
  • Container registry (--registry): dockerhub (default), google (Artifact Registry), aws-ecr, azure-acr
  • Addon packages (--packages): optional secondary @imqueue libraries (see Package Catalog)

Every option resolves with the precedence CLI flag → per-service .imqrc.json → global ~/.imq/config.json → interactive prompt → default, so non-interactive runs never hang. It is recommended to run imq config init right after installation to set your defaults.

imq service create [name] [path]
Creates new service package with the given service name under given path.
Options:
-a, --author Service author full name (person or organization)
-e, --email Service author's contact email
-g, --use-git Turn on automatic repo creation [boolean]
--vcs VCS host: github, gitlab, bitbucket
-u, --github-namespace VCS namespace (user, organization or workspace)
--ci CI provider: github-actions, circleci, travis
--registry Container registry: dockerhub, google, aws-ecr,
azure-acr
--region Registry region (google, aws-ecr)
--project GCP project id (google)
--account-id AWS account id (aws-ecr)
--packages Comma-separated addon packages (--no-packages for none)
--no-install Do not install npm packages automatically [boolean]
-V, --service-version Initial service version [default: "1.0.0-0"]
-H, --homepage Homepage URL for service, if required
-B, --bugs-url Bugs url for service, if required
-l, --license SPDX license name/id or path to a custom license file
-t, --template Template name, git url or file system directory
-d, --description Service description
-n, --node-versions Node version tags for CI builds (comma-separated)
-D, --dockerize Enable service dockerization with CI builds [boolean]
-L, --node-docker-tag Node docker tag to use as base docker image
-N, --docker-namespace Registry namespace / repository / ACR name
-T, --github-token VCS auth token
--git-protocol Git transport for the initial push: https (default) or
ssh [choices: "https","ssh"]
-p, --private Repository will be private [boolean]
--dry-run Print the resolved plan and exit [boolean]
-y, --yes Skip the confirmation prompt [boolean]
--name Service name to create with
--path Path to directory where service will be generated to

Use --dry-run to preview the fully-resolved plan (providers, repo url, image reference, packages) without making any changes — handy for scripting and CI.

The chosen providers and packages are written to a committed .imqrc.json in the generated service, so later commands and re-creations reuse them.

Git transport for the initial push. By default (vcs.protocol: https) the initial commit is pushed over HTTPS authenticated with the same access token that created the repository — the token is used only for that push and is never written into the repository's .git/config. This makes a push to a private organization repo succeed even when your SSH key (or a different "active" git/gh account) has no access to it. Pass --git-protocol ssh (or set vcs.protocol ssh) to push over SSH with your own keys instead. imq config init auto-detects a sensible default from whether you have SSH keys in ~/.ssh. See Configuration → Git transport.

Package Catalog

imq service create --packages <list> adds secondary @imqueue libraries and wires them in. The catalog is data (catalog.json bundled with the CLI, with the templates-repo copy preferred when present), so new addons can be published without a CLI release. Groups marked exclusive allow a single choice:

  • tracing (exclusive): dd-trace, opentelemetry
  • orm (exclusive): sequelize, pg-prisma
  • features: pg-cache, pg-pubsub, tag-cache, job, net, http-protect, graphql-dependency, type-graphql-dependency

Each addon merges its dependencies, may inject wiring code at the template's %ADDON_PRELOAD / %ADDON_CONFIG points, and prints any required environment variables after creation.

Client Management

Generating Clients:

To generate a client related service should be started, otherwise generation will fail.

This command will expect service name as mandatory option.

Usage:

imq client generate <name> [path]
Generates @imqueue/rpc client for a specified service
Options:
--version Show version number [boolean]
--help Show help [boolean]
-o, --overwrite Overwrite existing client without prompt [boolean]
--path Directory where client file should be placed [default: "."]

Bulk Version Bump

To release a new version across one or many services under a directory, use:

imq service update-version <path> [branch]
Updates services under given path with a new version tag and pushes the
changes to their repositories, triggering CI builds.
Options:
-b, --branch The branch to checkout and use during update
[default: "master"]
-n, --npm-version NPM version to update
(major|minor|patch|prerelease) [default: "prerelease"]

For each detected service it runs git checkout <branch>git pullnpm version <n>git push --follow-tags, stopping that service on the first failing step.

Managing @imqueue/cli Configuration

@imqueue/cli can be used with a pre-configured options to shorten commands usage. Global base configurations options usually stored in ~/.imq/config.json file. This file can be managed manually, but it is recommended to use special command:

imq config init

which will guide you through configuration process. When you enable a VCS host it auto-detects the git transport (SSH if you have keys in ~/.ssh, otherwise HTTPS), tells you what it picked, and lets you change it.

There are also useful commands to retrieve and set specific configuration values, stored in a configuration file:

imq config get

will print all set configuration options in option = value format (add -j/--json to print the whole config as JSON).

imq config get [option_name]

will print a single requested option value.

imq config set [option_name] [new_value]

will set requested option to a given new value. Nested options can be addressed with a dot-path, e.g. imq config set ci.provider circleci, imq config set vcs.namespace my-org or imq config set vcs.protocol ssh. The config keeps the structured v4 keys (vcs, ci, registry, packages, templatesRef) and their legacy equivalents in sync, so upgrading or downgrading the CLI keeps working. A config written by an older CLI is read transparently (github + travis + dockerhub).

imq config check

exits with code 0 if the config is initialized and 1 otherwise, which is handy in scripts. The config file is written with 0600 permissions since it may hold secrets (GitHub token, DockerHub password).

@imqueue/cli Completions For Your Shell

@imqueue/cli supports completions for your shell. It provide a way to generate completions script and add it to your shell configuration, as far as allows to remove previously added completion script just running the corresponding commands:

imq completions on
imq completions off

Currently it supports both zsh and bash shells.

Controlling Local Services

For comfortable local development @imqueue provides couple of useful command-line tools, allowing developers to manage local set of services. Like starting/stopping/restarting them with a single command line or managing services logs.

Please, note, there are many different ways to manage local services. You may consider pulling and starting pre-build docker images, or even use docker compose for managing them, or may utilize such tools as vagrant to organize local environment setup. BTW, you may suggest to run your services locally on host OS, which is really useful scenario during development and the tools below will dramatically improve your experience, especially, when the number of services to manage significant.

imq ctl and imq up share the same service discovery: when -s is omitted they scan the given path for immediate sub-directories whose src/ tree contains a class extending IMQService or IMQClient. imq log works off the *.log files already collected under ~/.imq/var (per-service logs and process ids live there).

imq ctl

Starts, stops, restarts or reports status of a bulk of local services. On start each service is launched via its npm run dev script in its own process group (output redirected to ~/.imq/var/<service>.log, truncated per run); a service already running is skipped (use restart). Stop terminates the whole process group and runs each service's npm run stop script.

imq ctl <action> [-p path] [-s services] [-ucv]
<action> one of start | stop | restart | status
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-u, --update run 'git pull' on each service before starting
-c, --calm calm start - wait for each service to become ready
(log line "reader channel connected") before the next;
a service that crashes on startup is reported at once
-v, --verbose show command execution time

imq ctl status lists each tracked service and whether its recorded pid is live or stale.

imq log

Combines and tails the logs collected by imq ctl. With no service names all available logs are combined; lines are prefixed with a coloured [service] tag when more than one log is shown.

imq log [services..] [-cfP]
[services..] service names to combine logs for (default: all)
-c, --clean delete collected logs and exit (scoped to the named
services, or all logs when none are named)
-f, --follow follow appended data (default: true; --no-follow to
dump current logs and exit)
--no-prefix do not prefix log lines with the service name (-P for short)

imq up

Updates dependencies of local services (via npm-check-updates, installed automatically if missing) and, optionally, version-bumps, commits and pushes them. Make sure the services are not in a dirty git state before running an update.

imq up [-p path] [-s services] [-v type] [-cu]
-p, --path directory with the service repositories (default: cwd)
-s, --services comma-separated service names (skips discovery)
-v, --npm-version version bump on commit: major|minor|patch|prerelease
(default: prerelease; also --bump)
-c, --commit commit, version-bump and push the update
-u, --skip-update skip the dependency update, perform other tasks only

For each service the update runs git pullncu -u → reinstall, then (with -c) commits chore: dependencies update, runs npm version <type> and git push --follow-tags — but only when the working tree actually changed. A step that fails aborts that service (before any destructive step) and is reported in a summary; the command exits non-zero if any service failed.

License

This project is licensed under the GNU General Public License v3.0. See the LICENSE

About

CLI for @imqueue — scaffold Redis-RPC microservices, generate typed clients, and manage a local service fleet (Node.js & TypeScript)

Topics

Resources

Contributing

Security policy

Stars

20 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages