npm install -g @nzz/q-cli
Some commands require certain environment variables. If you do not provide them, q cli tries to get them from your local 1Password installation. Make sure, that you have 1Password installed.
pnpm i
There is a test script for each command in the package.json
.
To use the q cli in GitHub Actions there are special access tokens provided. You can find them in 1Password (vault: Q CLI). Editorial Tech manages those access tokens.
You will need to set the secrets in your GitHub repository under: Settings > Secrets & variables > Actions > New repository secret
Example:
- name: Run Q cli
run: Q update-item
env:
Q_STAGING_SERVER: ${{ secrets.Q_STAGING_SERVER }}
Q_STAGING_ACCESSTOKEN: ${{ secrets.Q_STAGING_ACCESSTOKEN }}
Q_PRODUCTION_SERVER: ${{ secrets.Q_PRODUCTION_SERVER }}
Q_PRODUCTION_ACCESSTOKEN: ${{ secrets.Q_PRODUCTION_ACCESSTOKEN }}
Creates a new custom code project.
Q new-custom-code my-custom-code-project
Creates a new custom code item on the specified environment and adds the id of the newly created item to the specified q.config.json
.
q.config.json
: By default q cli will look for the config file in the current directory, if no path is specified.
This command requires the environment variables Q_[ENVIRONMENT]_SERVER
and Q_[ENVIRONMENT]_ACCESSTOKEN
.
Q create-custom-code-item -e local -c ./tests/q.config.json -t 'TEST CUSTOM CODE ITEM'
Reads the specified q.config.json
and updates all q items there.
q.config.json
: By default q cli will look for the config file in the current directory, if no path is specified.
This command requires the environment variables Q_[ENVIRONMENT]_SERVER
and Q_[ENVIRONMENT]_ACCESSTOKEN
.
Q update-item -e local -c ./tests/q.config.json
Changes to the Q-cli won't be automatically released by the CI/CD. After the changes have been merged into the main
branch, and the changeset got applied, the Q-cli needs to be manually published by running the following commands:
pnpm build
npm publish