{"id":14973889,"url":"https://github.com/kgalli/cliw","last_synced_at":"2025-10-27T05:30:57.901Z","repository":{"id":35033722,"uuid":"163510623","full_name":"kgalli/cliw","owner":"kgalli","description":"A cliw[rapper] to ease day to day command line tasks!","archived":false,"fork":false,"pushed_at":"2023-01-06T10:07:20.000Z","size":1378,"stargazers_count":6,"open_issues_count":13,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-01T02:22:51.194Z","etag":null,"topics":["aws-kms","cli","db","docker-compose","psql"],"latest_commit_sha":null,"homepage":"","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/kgalli.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-12-29T12:49:12.000Z","updated_at":"2021-11-15T12:07:36.000Z","dependencies_parsed_at":"2023-01-15T12:26:47.775Z","dependency_job_id":null,"html_url":"https://github.com/kgalli/cliw","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgalli%2Fcliw","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgalli%2Fcliw/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgalli%2Fcliw/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/kgalli%2Fcliw/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/kgalli","download_url":"https://codeload.github.com/kgalli/cliw/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":238437615,"owners_count":19472448,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["aws-kms","cli","db","docker-compose","psql"],"created_at":"2024-09-24T13:49:38.385Z","updated_at":"2025-10-27T05:30:52.530Z","avatar_url":"https://github.com/kgalli.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"CLIW\n============\n\nA CliW[rapper] to ease day to day command line tasks!\n\n[![oclif](https://img.shields.io/badge/cli-oclif-brightgreen.svg)](https://oclif.io)\n[![Version](https://img.shields.io/npm/v/cliw.svg)](https://npmjs.org/package/cliw)\n[![Downloads/week](https://img.shields.io/npm/dw/cliw.svg)](https://npmjs.org/package/cliw)\n[![License](https://img.shields.io/npm/l/cliw.svg)](https://github.com/kgalli/cliw/blob/master/package.json)\n\n\u003c!-- toc --\u003e\n* [Installation](#installation)\n* [Usage](#usage)\n* [Commands](#commands)\n* [Command Reference](#command-reference)\n\u003c!-- tocstop --\u003e\n# Installation\n\n```sh-session\n$ npm install -g cliw\n```\n\n# Usage\n\n```sh-session\n$ cliw COMMAND\nrunning command...\n\n$ cliw (-v|--version|version)\ncliw/0.0.0 darwin-x64 node-v10.12.0\n\n$ cliw --help [COMMAND]\nUSAGE\n  $ cliw COMMAND\n...\n```\n\n# Commands\n\n## `cliw init`\n\nThe `init` sub command is used to create the initial `projects.yaml` file. `cliw` supports the management of several\nservices and databases under a project context. By doing so multiple `cliw` project configurations can be maintained\nat the same time while `cliw` supports switching between those when needed. This functionality comes in very handy\nwhen work has to be done for several clients or to keep private and business projects separated.\n\nThe default location of the `projects.yaml` file is `$HOME/.config/cliw` and can be overwritten via an environment\nvariable `CLIW_CONFIG_PATH`.\n  \nThe `init` sub command also requires two parameters to finish its work:\n \n* The location (absolute path) of the so called working directory. `cliw` uses this location to be able to utilize the\n`service` sub command which is used to manage service containers (e.g.: start, stop, exec ...).\n \n* The location of the configuration files. To properly work `cliw` expects the existence of the following files:\n\n  * `docker-compose.yaml`\n  * `service-metadata.yaml`\n  * `service-parameters.yaml`\n  * `service-overrides.yaml` (optional as `cliw` will use fallback strategy)\n  * `data-sources.yaml`\n\n  Examples for each of those configuration files can be found\n  _[here](https://github.com/kgalli/cliw/blob/master/config-examples)._\n\n## `cliw project`\n\nOnce the `init` command was used to setup the first project the `project` command can be used to add new projects\nand switch between them when needed.\n\n## `cliw db`\n\nThe `db` command is a wrapper for several database command line tools e.g. `psql`, `pg_dump`\n`pg_restore` to expose those via a streamlined simplified interface. Furthermore, it is using one centralized\nconfiguration file (`data-sources.yaml`) to be able to connect to different data sources incl. support of data sources\nwhich can only be accessed via `SSH TUNNEL`. To remove the pain of installing all those tools locally official `docker`\nimages are used.\n\nCurrently `Postgres` and `MySQL` are supported.\n\n## `cliw secret`\n\nThe `secret` command is a wrapper of the AWS KMS SDK to encrypt or decrypt string\ntokens e.g. passwords.\n\n## `cliw service`\n\nThe `service` command is a wrapper of `docker-compose`. The benefit of using this wrapper is that you can easily manage\ne.g. start, stop services in different environments defined using one centralized configuration. The switch between\nrunning a service container from an image of a registry or build the image from source is supported via `cliw` commands\ndirectly. No change of configuration files is necessary.\n\n\n# Command Reference\n\u003c!-- commands --\u003e\n* [`cliw db:console DATASOURCE`](#cliw-dbconsole-datasource)\n* [`cliw db:create DATASOURCE`](#cliw-dbcreate-datasource)\n* [`cliw db:drop DATASOURCE`](#cliw-dbdrop-datasource)\n* [`cliw db:dump DATASOURCE`](#cliw-dbdump-datasource)\n* [`cliw db:restore DATASOURCE`](#cliw-dbrestore-datasource)\n* [`cliw help [COMMAND]`](#cliw-help-command)\n* [`cliw init`](#cliw-init)\n* [`cliw project:add PROJECT`](#cliw-projectadd-project)\n* [`cliw project:list`](#cliw-projectlist)\n* [`cliw project:remove PROJECT`](#cliw-projectremove-project)\n* [`cliw project:set-default PROJECT`](#cliw-projectset-default-project)\n* [`cliw secret:decrypt`](#cliw-secretdecrypt)\n* [`cliw secret:encrypt`](#cliw-secretencrypt)\n* [`cliw service:checkout [SERVICES]`](#cliw-servicecheckout-services)\n* [`cliw service:config [SERVICES]`](#cliw-serviceconfig-services)\n* [`cliw service:exec SERVICE COMMAND`](#cliw-serviceexec-service-command)\n* [`cliw service:image:list [SERVICES]`](#cliw-serviceimagelist-services)\n* [`cliw service:image:pull [SERVICES]`](#cliw-serviceimagepull-services)\n* [`cliw service:image:set-origin SERVICE ORIGIN`](#cliw-serviceimageset-origin-service-origin)\n* [`cliw service:list`](#cliw-servicelist)\n* [`cliw service:logs [SERVICES]`](#cliw-servicelogs-services)\n* [`cliw service:run SERVICE COMMAND`](#cliw-servicerun-service-command)\n* [`cliw service:start [SERVICES]`](#cliw-servicestart-services)\n* [`cliw service:status [SERVICES]`](#cliw-servicestatus-services)\n* [`cliw service:stop [SERVICES]`](#cliw-servicestop-services)\n\n## `cliw db:console DATASOURCE`\n\nrun database console\n\n```\nUSAGE\n  $ cliw db:console DATASOURCE\n\nARGUMENTS\n  DATASOURCE  (api) data source specified by name\n\nOPTIONS\n  -c, --command=command               run only single command (SQL or internal) and exit\n  -e, --environment=development|test  (required) [default: development]\n  -f, --file=file                     execute commands from file, then exit\n  -h, --help                          show CLI help\n  --dry-run                           print shell commands without executing\n```\n\n_See code: [src/commands/db/console.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/db/console.ts)_\n\n## `cliw db:create DATASOURCE`\n\ncreate database\n\n```\nUSAGE\n  $ cliw db:create DATASOURCE\n\nARGUMENTS\n  DATASOURCE  (api) data source specified by name\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  --dry-run                           print shell commands without executing\n```\n\n_See code: [src/commands/db/create.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/db/create.ts)_\n\n## `cliw db:drop DATASOURCE`\n\ncreate database\n\n```\nUSAGE\n  $ cliw db:drop DATASOURCE\n\nARGUMENTS\n  DATASOURCE  (api) data source specified by name\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  --dry-run                           print shell commands without executing\n```\n\n_See code: [src/commands/db/drop.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/db/drop.ts)_\n\n## `cliw db:dump DATASOURCE`\n\ncreate database\n\n```\nUSAGE\n  $ cliw db:dump DATASOURCE\n\nARGUMENTS\n  DATASOURCE  (api) data source specified by name\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  -o, --schema-only                   dump schema without data\n  -t, --target=target                 (required) dump file location (relative to current directory)\n  --dry-run                           print shell commands without executing\n```\n\n_See code: [src/commands/db/dump.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/db/dump.ts)_\n\n## `cliw db:restore DATASOURCE`\n\nrestore database\n\n```\nUSAGE\n  $ cliw db:restore DATASOURCE\n\nARGUMENTS\n  DATASOURCE  (api) data source specified by name\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  -r, --restore-file=restore-file     (required) restore file location (relative to current directory)\n  --dry-run                           print shell commands without executing\n```\n\n_See code: [src/commands/db/restore.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/db/restore.ts)_\n\n## `cliw help [COMMAND]`\n\ndisplay help for cliw\n\n```\nUSAGE\n  $ cliw help [COMMAND]\n\nARGUMENTS\n  COMMAND  command to show help for\n\nOPTIONS\n  --all  see all commands in CLI\n```\n\n_See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v2.2.3/src/commands/help.ts)_\n\n## `cliw init`\n\nCreate and setup default project and configuration.\n\n```\nUSAGE\n  $ cliw init\n\nOPTIONS\n  -c, --config-directory=config-directory    absolute location of the configuration directory\n  -h, --help                                 show CLI help\n  -n, --name=name                            project unique identifier (name)\n  -w, --working-directory=working-directory  absolute location of the working directory\n\nDESCRIPTION\n  [cliw] supports the 'orchestration' of multiple projects.\n  Therefore it needs to maintain the path to the configuration directory\n  (location of e.g. service-metadata.yaml, service-runtime.yaml\n  service-parameters.yaml, docker-compose.yaml and db-parameters) and the\n  working directory. The latter is e.g. used as checkout path of the defined\n  services.\n\n  Called without options the 'init' command is executed in interactive mode\n  to gather the information needed directly from the prompt.\n\n  Data in stored in projects-config.json at: ~/.config/ (default).\n```\n\n_See code: [src/commands/init.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/init.ts)_\n\n## `cliw project:add PROJECT`\n\nadd project\n\n```\nUSAGE\n  $ cliw project:add PROJECT\n\nARGUMENTS\n  PROJECT  project specified by name\n\nOPTIONS\n  -c, --config=config                        (required) absolute path to the configuration files directory\n  -h, --help                                 show CLI help\n  -w, --working-directory=working-directory  (required) absolute path to the working directory\n```\n\n_See code: [src/commands/project/add.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/project/add.ts)_\n\n## `cliw project:list`\n\nlist projects\n\n```\nUSAGE\n  $ cliw project:list\n\nOPTIONS\n  -x, --extended          show extra columns\n  --columns=columns       only show provided columns (comma-separated)\n  --csv                   output is csv format [alias: --output=csv]\n  --filter=filter         filter property by partial string matching, ex: name=foo\n  --no-header             hide table header from output\n  --no-truncate           do not truncate output to fit screen\n  --output=csv|json|yaml  output in a more machine friendly format\n  --sort=sort             property to sort by (prepend '-' for descending)\n```\n\n_See code: [src/commands/project/list.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/project/list.ts)_\n\n## `cliw project:remove PROJECT`\n\nremove project\n\n```\nUSAGE\n  $ cliw project:remove PROJECT\n\nARGUMENTS\n  PROJECT  project specified by name\n\nOPTIONS\n  -h, --help  show CLI help\n```\n\n_See code: [src/commands/project/remove.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/project/remove.ts)_\n\n## `cliw project:set-default PROJECT`\n\nset default project\n\n```\nUSAGE\n  $ cliw project:set-default PROJECT\n\nARGUMENTS\n  PROJECT  project specified by name\n\nOPTIONS\n  -h, --help  show CLI help\n```\n\n_See code: [src/commands/project/set-default.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/project/set-default.ts)_\n\n## `cliw secret:decrypt`\n\ndecrypt secret encrypted via AWS KMS\n\n```\nUSAGE\n  $ cliw secret:decrypt\n\nOPTIONS\n  -h, --help           show CLI help\n  -s, --secret=secret  (required) Secret to decrypt\n```\n\n_See code: [src/commands/secret/decrypt.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/secret/decrypt.ts)_\n\n## `cliw secret:encrypt`\n\nencrypt value via AWS KMS\n\n```\nUSAGE\n  $ cliw secret:encrypt\n\nOPTIONS\n  -h, --help         show CLI help\n  -k, --keyId=keyId  (required) AWS KMS customer master key id\n  -v, --value=value  (required) Value to encrypt\n```\n\n_See code: [src/commands/secret/encrypt.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/secret/encrypt.ts)_\n\n## `cliw service:checkout [SERVICES]`\n\nCheckout service(s) from version control.\n\n```\nUSAGE\n  $ cliw service:checkout [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  -s, --services=services\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n```\n\n_See code: [src/commands/service/checkout.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/checkout.ts)_\n\n## `cliw service:config [SERVICES]`\n\nList, set or validate service(s) configuration.\n\n```\nUSAGE\n  $ cliw service:config [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          Show CLI help.\n  -i, --image-origin=source|registry  Set service(s) image origin.\n  --list                              List service(s) configuration.\n  --validate                          Validate service(s) configuration.\n```\n\n_See code: [src/commands/service/config.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/config.ts)_\n\n## `cliw service:exec SERVICE COMMAND`\n\nExecute a command in a running service container.\n\n```\nUSAGE\n  $ cliw service:exec SERVICE COMMAND\n\nARGUMENTS\n  SERVICE  (api|db) service name\n  COMMAND  specify command to execute\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n  --no-tty                            Disable pseudo-tty allocation.\n```\n\n_See code: [src/commands/service/exec.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/exec.ts)_\n\n## `cliw service:image:list [SERVICES]`\n\nList service(s) origin SOURCE|REGISTRY\n\n```\nUSAGE\n  $ cliw service:image:list [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n```\n\n_See code: [src/commands/service/image/list.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/image/list.ts)_\n\n## `cliw service:image:pull [SERVICES]`\n\nPull container image(s) from registry\n\n```\nUSAGE\n  $ cliw service:image:pull [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n```\n\n_See code: [src/commands/service/image/pull.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/image/pull.ts)_\n\n## `cliw service:image:set-origin SERVICE ORIGIN`\n\nSet containers image origin (source|registry)\n\n```\nUSAGE\n  $ cliw service:image:set-origin SERVICE ORIGIN\n\nARGUMENTS\n  SERVICE  (api|db) service name\n  ORIGIN   (registry|source) origin of the container image\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n```\n\n_See code: [src/commands/service/image/set-origin.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/image/set-origin.ts)_\n\n## `cliw service:list`\n\nList service(s) metadata.\n\n```\nUSAGE\n  $ cliw service:list\n\nOPTIONS\n  -h, --help              show CLI help\n  -x, --extended          show extra columns\n  --columns=columns       only show provided columns (comma-separated)\n  --csv                   output is csv format [alias: --output=csv]\n  --filter=filter         filter property by partial string matching, ex: name=foo\n  --no-header             hide table header from output\n  --no-truncate           do not truncate output to fit screen\n  --output=csv|json|yaml  output in a more machine friendly format\n  --sort=sort             property to sort by (prepend '-' for descending)\n```\n\n_See code: [src/commands/service/list.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/list.ts)_\n\n## `cliw service:logs [SERVICES]`\n\nShow service(s) logs.\n\n```\nUSAGE\n  $ cliw service:logs [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -f, --follow                        follow log output\n  -h, --help                          show CLI help\n  -t, --timestamps                    show timestamps\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n```\n\n_See code: [src/commands/service/logs.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/logs.ts)_\n\n## `cliw service:run SERVICE COMMAND`\n\nRun a one-off command on a service.\n\n```\nUSAGE\n  $ cliw service:run SERVICE COMMAND\n\nARGUMENTS\n  SERVICE  (api|db) service name\n  COMMAND  specify command to execute\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n  --entrypoint=entrypoint             Override the entrypoint of the image.\n  --no--tty                           Disable pseudo-tty allocation.\n```\n\n_See code: [src/commands/service/run.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/run.ts)_\n\n## `cliw service:start [SERVICES]`\n\nStart service(s) in daemon mode.\n\n```\nUSAGE\n  $ cliw service:start [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  --[no-]build                        Build images before starting containers.\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n```\n\n_See code: [src/commands/service/start.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/start.ts)_\n\n## `cliw service:status [SERVICES]`\n\nShow service(s) run status.\n\n```\nUSAGE\n  $ cliw service:status [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  -s, --services=services\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n```\n\n_See code: [src/commands/service/status.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/status.ts)_\n\n## `cliw service:stop [SERVICES]`\n\nStop running service(s).\n\n```\nUSAGE\n  $ cliw service:stop [SERVICES]\n\nARGUMENTS\n  SERVICES  (api|db) Service name(s) defined in docker-compose.yaml [default: ALL...].\n\nOPTIONS\n  -e, --environment=development|test  (required) [default: development]\n  -h, --help                          show CLI help\n  -t, --timeout=timeout               [default: 10] Specify a shutdown timeout in seconds.\n  --dry-run                           Print command(s) to STDOUT without actually executing.\n```\n\n_See code: [src/commands/service/stop.ts](https://github.com/kgalli/cliw/blob/v0.14.0/src/commands/service/stop.ts)_\n\u003c!-- commandsstop --\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgalli%2Fcliw","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fkgalli%2Fcliw","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fkgalli%2Fcliw/lists"}