Skip to main content

CWClock CLI

We provide an OpenSource1 CLI for CWClock. You can use it to record your time using a terminal and more.

Installation​

Choose the installation mode that suits your operating system and follow the instructions.

Homebrew​

First installation:

brew tap cwclock/cwclock https://gitlab.cwcloud.tech/oss/cwclock.git
brew trust --formula cwclock/cwclock/cwclock
brew install cwclock

Upgrade:

brew update
brew upgrade cwclock

Curl​

Linux​

Linux x86 (64 bit)​
version="1.13.4"
curl -L "https://gitlab.cwcloud.tech/oss/cwclock/-/releases/v${version}/downloads/cwclock/cwclock_${version}_linux_amd64.tar.gz" -o "cwclock_cli.tar.gz"
mkdir cwclock_cli && tar -xf cwclock_cli.tar.gz -C cwclock_cli
sudo ./cwclock_cli/install.sh

Beware of checking if the version is available in the releases because we only keep the 5 last builds.

Linux arm (64 bit)​
version="1.13.4"
curl -L "https://gitlab.cwcloud.tech/oss/cwclock/-/releases/v${version}/downloads/cwclock/cwclock_${version}_linux_arm64.tar.gz" -o "cwclock_cli.tar.gz"
mkdir cwclock_cli && tar -xf cwclock_cli.tar.gz -C cwclock_cli
sudo ./cwclock_cli/install.sh

Beware of checking if the version is available in the releases because we only keep the 5 last builds.

MacOS​

MacOS x86/arm (64 bit)​
version="1.13.4"
curl -L "https://gitlab.cwcloud.tech/oss/cwclock/-/releases/v${version}/downloads/cwclock/cwclock_${version}_darwin_all.tar.gz" -o "cwclock_cli.tar.gz"
mkdir cwclock_cli && tar -xf cwclock_cli.tar.gz -C cwclock_cli
sudo ./cwclock_cli/install.sh

Beware of checking if the version is available in the releases because we only keep the 5 last builds.

Windows​

Direct download​

You can directly download from here. Choose the right architecture (amd64 or arm64), download, unzip and you'll find an exe file there.

Windows x86 (64 bit) with Powershell​

$version = "1.13.4"
$user = "YOUR_USER"
cd "C:\Users\${user}"
Invoke-WebRequest -Uri "https://gitlab.cwcloud.tech/oss/cwclock/-/releases/v${version}/downloads/cwclock/cwclock_${version}_windows_amd64.zip" -OutFile "cwclock_cli.zip"
Expand-Archive -Path "cwclock_cli.zip" -DestinationPath "cwclock_cli" -Force
Set-Location "cwclock_cli"
.\cwclock.exe

Beware of checking if the version is available in the releases because we only keep the 5 last builds.

Windows arm (64 bit) with Powershell​

$version = "1.13.4"
$user = "YOUR_USER"
cd "C:\Users\${user}"
Invoke-WebRequest -Uri "https://gitlab.cwcloud.tech/oss/cwclock/-/releases/v${version}/downloads/cwclock/cwclock_${version}_windows_arm64.zip" -OutFile "cwclock_cli.zip"
Expand-Archive -Path "cwclock_cli.zip" -DestinationPath "cwclock_cli" -Force
Set-Location "cwclock_cli"
.\cwclock.exe

Installation of quickwit using the CLI​

cwclock bootstrap

Available flags:

  • -r or --release: Release name for deployment (default: cwclock)
  • -n or --namespace: Namespace to use for deployment (default: cwclock)
  • -k or --keep-dir: Keep the local helm directory
  • -d or --recreate-ns: Recreate the namespace
  • -o or --openshift: Use openshift cli instead of kubectl
  • -p or --value: Values to override configurations (can be repeated)
  • --directory: Change the directory folder location (usefull if you want to use your own helm templates)
  • --kind-cluster: Specify the kind cluster to use (it'll be recreated even if it already exists)

Example:

cwclock bootstrap -r my-release -n production --value key=value --value values-override.yaml

Open tunnels​

cwclock bootstrap pfw

Opens tunnels (or port forward) to the different services. You can override the configuration like this:

cwclock bootstrap pfw --config my-pfw-config.yml

Expected YAML configuration format:

---
pfwConfigs:
- name: "cwclock-api"
port: 8080
targetPort: 8080
- name: "cwclock-ui"
port: 3000
targetPort: 3000

Configuration​

cwclock configure
cwclock configure set format pretty
cwclock configure set api_url https://api.cwclock.me
cwclock configure set api_key <your api key>

Note: it's also possible to use environment variables QWCTL_{VAR_NAME} instead of this configuration file. For example, for the output format you can set QWCTL_FORMAT environment variable to json or pretty.

Metrics​

Get all the available metrics (from the prometheus URL /v1/metrics of the API) with:

cwclock metrics ls

Get a particular metric with:

cwclock metrics get -n <metric_name>
cwclock metrics get --name <metric_name>

Notes:

  • Wildcard * is supported to get all the metrics starting with a particular string (e.g: cwclock metrics get -n "quickwit_metastore_*" to get all the metrics starting with quickwit_metastore_ in their name)
  • Label filtering is also supported with --filter flag (e.g: cwclock metrics get -n "quickwit_metastore_grpc_request_duration_seconds_bucket" --filter "kind=client" to get the metric quickwit_metastore_grpc_request_duration_seconds_bucket with the label kind equal to client)

AI MCP & Agents​

Create MCP server​

cwclock ai mcp
cwclock ai mcp -l 127.0.0.1 -p 8080 -e /mcp

Create agent calling the mcp server​

cwclock ai agent -p "List the indexes"
cwclock ai agent -p "Search *" -s "http://127.0.0.1:8080/mcp" --provider anthropic

Note: available providers are anthropic, openai, deepseek or openrouter, for now you can configure your keys like this:

cwclock configure set openai_api_key "your_key"
cwclock configure set anthropic_api_key "your_key"
cwclock configure set openrouter_api_key "your_key"
cwclock configure set deepseek_api_key "your_key"
cwclock configure set gemini_api_key "your_key"
cwclock configure set mistral_api_key "your_key"

You can also use environment variables instead:

export CWCLOCK_OPENAI_API_KEY="your_key"
export CWCLOCK_ANTHROPIC_API_KEY="your_key"
export CWCLOCK_OPENROUTER_API_KEY="your_key"
export CWCLOCK_DEEPSEEK_API_KEY="your_key"
export CWCLOCK_GEMINI_API_KEY="your_key"
export CWCLOCK_MISTRAL_API_KEY="your_key"

Note: you can also use interactive mode to create your agent with -i or --interactive flag:

cwclock ai agent -i

Create a web agent​

You can also use a web server mode to query your agent with HTTP POST requests instead of CLI:

cwclock ai web-agent -a 0.0.0.0 -p 8081

The path / can be configured as an external AI adapter (usable directly from Aristochat) and the path /gitlab as a gitlab webhook if you set the following configurations:

cwclock configure set gitlab_base_url "https://gitlab.cwcloud.tech"
cwclock configure set gitlab_token "your_gitlab_token"
cwclock configure set gitlab_webhook_secret "your webhook secret"

Or with those environment variables:

export CWCLOCK_GITLAB_BASE_URL="https://gitlab.cwcloud.tech"
export CWCLOCK_GITLAB_TOKEN="your_gitlab_token"
export CWCLOCK_GITLAB_WEBHOOK_SECRET="your webhook secret"

List all the MCP tools available​

cwclock ai agent -p "list_mcp_dynamic_tools"

Note: a cwclock MCP server has to be running for this command to work

Footnotes​

  1. It's available here with MIT licence ↩