Codeware Sthlm Developer CLI
Table of contents
This is a CLI to make local development a bit easier and structured. Some commonly used tools and scripts are bundled and provided by CLI commands.
Though it's a public repo this CLI is aimed for Codeware Sthlm developers. If anyone finds it useful we're more than happy to share our code, or the CLI itself from NPM.
Setup a local npm registry using verdaccio
# Start verdaccio
cdwr registry start
# Change your local registry setting to use the verdaccio host
cdwr registry set local
# Check status and get registry info
cdwr registry status
Deployment to npm via npm publish
should end up in verdaccio repository.
The repository content is accessed via http://localhost:4373.
# Stop verdaccio
cdwr registry stop
# Verify it's stopped
cdwr registry status
$ npm install -g @cdwr/cli
$ cdwr COMMAND
running command...
$ cdwr (--version)
@cdwr/cli/1.3.0 linux-x64 node-v18.18.0
$ cdwr --help [COMMAND]
USAGE
$ cdwr COMMAND
...
display autocomplete installation instructions
USAGE
$ cdwr autocomplete [SHELL] [-r]
ARGUMENTS
SHELL shell type
FLAGS
-r, --refresh-cache Refresh cache (ignores displaying instructions)
DESCRIPTION
display autocomplete installation instructions
EXAMPLES
$ cdwr autocomplete
$ cdwr autocomplete bash
$ cdwr autocomplete zsh
$ cdwr autocomplete --refresh-cache
See code: @oclif/plugin-autocomplete
list all the commands
USAGE
$ cdwr commands [--json] [-h] [--hidden] [--tree] [--columns <value> | -x] [--sort <value>] [--filter
<value>] [--output csv|json|yaml | | [--csv | --no-truncate]] [--no-header | ]
FLAGS
-h, --help Show CLI help.
-x, --extended show extra columns
--columns=<value> only show provided columns (comma-separated)
--csv output is csv format [alias: --output=csv]
--filter=<value> filter property by partial string matching, ex: name=foo
--hidden show hidden commands
--no-header hide table header from output
--no-truncate do not truncate output to fit screen
--output=<option> output in a more machine friendly format
<options: csv|json|yaml>
--sort=<value> property to sort by (prepend '-' for descending)
--tree show tree of commands
GLOBAL FLAGS
--json Format output as json.
DESCRIPTION
list all the commands
See code: @oclif/plugin-commands
Display help for cdwr.
USAGE
$ cdwr help [COMMANDS] [-n]
ARGUMENTS
COMMANDS Command to show help for.
FLAGS
-n, --nested-commands Include all nested commands in the output.
DESCRIPTION
Display help for cdwr.
See code: @oclif/plugin-help
Search for a command.
USAGE
$ cdwr search
DESCRIPTION
Search for a command.
Once you select a command, hit enter and it will show the help for that command.
See code: @oclif/plugin-search
USAGE
$ cdwr version [--json] [--verbose]
FLAGS
--verbose Show additional information about the CLI.
GLOBAL FLAGS
--json Format output as json.
FLAG DESCRIPTIONS
--verbose Show additional information about the CLI.
Additionally shows the architecture, node version, operating system, and versions of plugins that the CLI is using.
See code: @oclif/plugin-version
tsx
must be globally installed to be able to start CLI in development mode.
npm i -g tsx
git clone https://github.com/codeware-sthlm/cdwr-cli.git [PATH]
cd [PATH]
yarn
Launch development mode
bin/dev.js [COMMAND]
Launch production build
yarn build
bin/run.js [COMMAND]
Linting
yarn lint
Unit tests
yarn test
yarn release:local
# Stage files
git add [FILES]
# Start interactive Git commit CLI
yarn commit
# or
yarn c
# with ai support (setup required)
yarn commit ai
# or
yarn cai
https://cz-git.qbb.sh/recipes/openai#setup-openai-token
npx czg --openai-token=sk-xxxxx
Token is saved to
~/.config/.czrc