confluent prompt

説明

このコマンドは、ターミナルのプロンプトに confluent 情報を追加する場合に使用します。

Bash:

export PS1='$(confluent prompt) '$PS1

ZSH:

setopt prompt_subst
export PS1='$(confluent prompt) '$PS1

プロンプトは、--format フラグを渡して呼び出すことによってカスタマイズできます(-f '(confluent|%C)' など)。このカスタマイズを永続させるには、Bash または ZSH のプロファイルに上の行を追加する必要があります。

トークンのフォーマット

このコマンドは、複数のフォーマットトークンとともに使用します。すべてのトークンのリストを以下に示します。

  • %a - 使用している現在の Kafka API キー(例: "ABCDEF1234567890")。
  • %C - 使用している現在のコンテキストの名前(例: "dev-app1"、"stag-dc1"、"prod")。
  • %e - 使用している現在の環境の ID(例: "a-4567")。
  • %E - 使用している現在の環境の名前(例: "default"、"prod-team1")。
  • %k - 使用している現在の Kafka クラスターの ID(例: "lkc-abc123")。
  • %K - 使用している現在の Kafka クラスターの名前(例: "prod-us-west-2-iot")。
  • %u - 使用している現在のユーザーまたは認証情報(例: "joe@montana.com")。

スタイル

テキストのスタイルは、機能、カラー、属性を組み合わせて変更できます。

機能:

  • fgcolor - 前景色を変更します。
  • bgcolor - 背景色を変更します。
  • attr - テキスト属性を変更します。

カラー:

  • black
  • blue
  • cyan
  • green
  • magenta
  • red
  • white
  • yellow

テキスト属性:

  • bold
  • invert
  • italicize
  • underline

  • {{fgcolor "blue" "this text is blue"}}
  • {{bgcolor "blue" "this text has a blue background"}}
  • {{attr "bold" "this text is bold"}}

追加の属性を区切るには、垂直バーを使用します。

  • {{fgcolor "red" "this text is red and bold" | attr "bold"}}

同じフォーマット文字列でトークンとカラーを使用できます。

  • ({{fgcolor "blue" "confluent"}} | {{fgcolor "red" "%C"}})
confluent prompt [flags]

フラグ

-f, --format string   The format string to use. See the help for details. (default "(confluent|%C)")
-t, --timeout int     The maximum execution time in milliseconds. (default 200)

グローバルフラグ

-h, --help            Show help for this command.
-v, --verbose count   Increase verbosity (-v for warn, -vv for info, -vvv for debug, -vvvv for trace).

関連情報