1
0
mirror of https://github.com/Llewellynvdm/starship.git synced 2024-06-07 11:00:47 +00:00
starship/docs/ja-JP/config/README.md
2020-05-23 19:10:58 -04:00

67 KiB
Raw Blame History

蚭定

::: tip

🔥Starshipの開発は珟圚も進んでいたす。 倚くの新しいオプションが今埌のリリヌスで利甚可胜になりたす。

:::

Starshipの蚭定を開始するには、~/.config/starship.toml ファむルを䜜成したす。

$ mkdir -p ~/.config && touch ~/.config/starship.toml

Starshipのすべおの蚭定は、このTOMLファむルで行われたす。

# Don't print a new line at the start of the prompt
add_newline = false

# Replace the "❯" symbol in the prompt with "➜"
[character]      # The name of the module we are configuring is "character"
symbol = "➜"     # The "symbol" segment is being set to "➜"

# Disable the package module, hiding it from the prompt completely
[package]
disabled = true

STARSHIP_CONFIG 環境倉数を䜿甚しお、デフォルトのstarship.toml ファむルの堎所を倉曎できたす。

export STARSHIP_CONFIG=~/.starship

Equivalently in PowerShell (Windows) would be adding this line to your $PROFILE:

$ENV:STARSHIP_CONFIG = "$HOME\.starship"

甚語

モゞュヌル: OSのコンテキスト情報に基づいお情報を提䟛するプロンプト内のコンポヌネントです。 たずえば、珟圚のディレクトリがNodeJSプロゞェクトである堎合、「nodejs」モゞュヌルは、珟圚コンピュヌタヌにむンストヌルされおいるNodeJSのバヌゞョンを衚瀺したす。

セグメント: モゞュヌルを構成する小さなサブコンポヌネントです。 たずえば、「nodejs」モゞュヌルの「symbol」セグメントには、バヌゞョン番号の前に衚瀺される文字が含たれおいたすデフォルト: ⬢。

以䞋はNode モゞュヌルの衚珟です。 次の䟋では、「シンボル」ず「バヌゞョン」はその䞭のセグメントです。 すべおのモゞュヌルには、デフォルトの端末色であるprefixずsuffixもありたす。

[prefix]      [symbol]     [version]    [suffix]
 "via "         "⬢"        "v10.4.1"       ""

スタむルの蚭定

Starshipのほずんどのモゞュヌルでは、衚瀺スタむルを蚭定できたす。 これは、蚭定を指定する文字列である゚ントリstyleで行われたす。 スタむル文字列の䟋ずその機胜を次に瀺したす。 完党な構文の詳现に぀いおは、詳现は 高床な蚭定を参照しおください 。

  • "fg:green bg:blue" は、青色の背景に緑色のテキストを蚭定したす
  • "bg:blue fg:bright-green" は、青色の背景に明るい緑色のテキストを蚭定したす
  • "bold fg:27" は、 ANSIカラヌ 27の倪字テキストを蚭定したす
  • "underline bg:#bf5700" は、焊げたオレンゞ色の背景に䞋線付きのテキストを蚭定したす
  • "bold italic fg:purple"は、玫色の倪字斜䜓のテキストを蚭定したす
  • "" はすべおのスタむルを明瀺的に無効にしたす

スタむリングがどのように芋えるかは、端末゚ミュレヌタによっお制埡されるこずに泚意しおください。 たずえば、䞀郚の端末゚ミュレヌタはテキストを倪字にする代わりに色を明るくしたす。たた、䞀郚のカラヌテヌマは通垞の色ず明るい色ず同じ倀を䜿甚したす。 たた、斜䜓のテキストを取埗するには、端末で斜䜓をサポヌトする必芁がありたす。

プロンプト

これは、プロンプト党䜓のオプションのリストです。

オプション

倉数 デフォルト 説明
add_newline true プロンプトの開始前に新しい行を远加したす。
prompt_order link プロンプトモゞュヌルを出力する順序を蚭定したす。
scan_timeout 30 ファむルをスキャンする際のタむムアりト時間 (milliseconds) です。

蚭定䟋

# ~/.config/starship.toml

# Disable the newline at the start of the prompt
add_newline = false
# Overwrite a default_prompt_order and  use custom prompt_order
prompt_order=["rust","line_break","package","line_break","character"]
# Wait 10 milliseconds for starship to check files under the current directory.
scan_timeout = 10

デフォルトのプロンプト衚瀺順

デフォルトのprompt_orderは、空の堎合、たたはprompt_orderが指定されおいない堎合に、プロンプトにモゞュヌルが衚瀺される順序を定矩するために䜿甚されたす。 デフォルトは次のずおりです。

prompt_order = [
    "username",
    "hostname",
    "kubernetes",
    "directory",
    "git_branch",
    "git_commit",
    "git_state",
    "git_status",
    "hg_branch",
    "docker_context",
    "package",
    "dotnet",
    "elixir",
    "elm",
    "erlang",
    "golang",
    "haskell",
    "java",
    "julia",
    "nodejs",
    "ocaml",
    "php",
    "purescript",
    "python",
    "ruby",
    "rust",
    "terraform",
    "zig",
    "nix_shell",
    "conda",
    "memory_usage",
    "aws",
    "env_var",
    "crystal",
    "cmd_duration",
    "custom",
    "line_break",
    "jobs",
    "battery",
    "time",
    "character",
]

AWS

aws モゞュヌルは珟圚のAWSプロファむルが衚瀺されたす。 これは ~/.aws/config に蚘述されおいる AWS_REGION, AWS_DEFAULT_REGION, and AWS_PROFILE 環境倉数に基づいおいたす。

When using aws-vault the profile is read from the AWS_VAULT env var.

オプション

倉数 デフォルト 説明
symbol "☁ " 珟圚のAWSプロファむルを衚瀺する前に衚瀺される蚘号です。
displayed_items all 衚瀺するアむテムを遞択したす。 指定可胜な倀は以䞋です。[all, profile, region]
region_aliases AWS名に加えお衚瀺するリヌゞョンの゚むリアスです。
style "bold yellow" モゞュヌルのスタむルです。
disabled false awsモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[aws]
style = "bold blue"
symbol = "🅰 "
displayed_items = "region"
[aws.region_aliases]
ap-southeast-2 = "au"
us-east-1 = "va"

バッテリヌ

batteryモゞュヌルは、デバむスのバッテリヌ残量ず珟圚の充電状態を瀺したす。 モゞュヌルは、デバむスのバッテリヌ残量が10未満の堎合にのみ衚瀺されたす。

オプション

倉数 デフォルト 説明
full_symbol "•" バッテリヌが満タンのずきに衚瀺される蚘号です。
charging_symbol "⇡" バッテリヌの充電䞭に衚瀺される蚘号です。
discharging_symbol "⇣" バッテリヌが攟電しおいるずきに衚瀺される蚘号です。
display link モゞュヌルの閟倀ずスタむルを衚瀺したす。
disabled false batteryモゞュヌルを無効にしたす。
いく぀かのたれなバッテリヌ状態のオプションもありたす。
倉数 説明
unknown_symbol バッテリヌ状態が䞍明なずきに衚瀺される蚘号です。
empty_symbol バッテリヌが空のずきに衚瀺される蚘号です。

オプションを指定しない限り、バッテリヌの状態がunknownもしくはemptyになった堎合にむンゞケヌタヌは非衚瀺になりたす。

蚭定䟋

# ~/.config/starship.toml

[battery]
full_symbol = "🔋"
charging_symbol = "⚡"
discharging_symbol = "💀"

バッテリヌの衚瀺

display オプションを䜿甚しお、バッテリヌむンゞケヌタヌを衚瀺するタむミング閟倀ず倖芳スタむルを定矩したす。 display が提䟛されない堎合、 デフォルトは次のずおりです。

[[battery.display]]
threshold = 10
style = "bold red"

オプション

displayオプションは、次の衚の通りです。

倉数 説明
threshold バッテリヌが衚瀺される䞊限です。
style displayオプションが䜿甚されおいる堎合のスタむルです。

蚭定䟋

[[battery.display]]  # バッテリヌ残量が0〜10の間は「倪字の赀色」スタむルを利甚する
threshold = 10
style = "bold red"

[[battery.display]]  # バッテリヌ残量が10〜30の間は「倪字の黄色」スタむルを利甚する
threshold = 30
style = "bold yellow"

# 容量が30を超えるず、バッテリヌむンゞケヌタヌは衚瀺されたせん

文字

characterモゞュヌルは、端末でテキストが入力される堎所の暪に文字通垞は矢印を衚瀺したす。

文字は、最埌のコマンドが成功したかどうかを瀺したす。 これは、色の倉曎赀/緑たたはその圢状の倉曎(❯/✖) の2぀の方法で行うこずができたす。 埌者はuse_symbol_for_statusにtrue蚭定されおいる堎合にのみ行われたす。

オプション

倉数 デフォルト 説明
symbol "❯" プロンプトでテキストを入力する前に䜿甚される蚘号です。
error_symbol "✖" 前のコマンドが倱敗した堎合にテキスト入力の前に䜿甚される蚘号です。
use_symbol_for_status false シンボルを倉曎しお゚ラヌステヌタスを瀺したす。
vicmd_symbol "❮" シェルがvimの通垞モヌドである堎合、プロンプトのテキスト入力の前に䜿甚される蚘号です。
style_success "bold green" 最埌のコマンドが成功した堎合に䜿甚されるスタむルです。
style_failure "bold red" 最埌のコマンドが倱敗した堎合に䜿甚されるスタむルです。
disabled false characterモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[character]
symbol = "➜"
error_symbol = "✗"
use_symbol_for_status = true

コマンド実行時間

cmd_durationモゞュヌルは、最埌のコマンドの実行にかかった時間を瀺したす。 モゞュヌルが衚瀺されるのは、コマンドが2秒以䞊かかった堎合、たたはmin_time倀が存圚する堎合のみです。

::: warning BashでDEBUGトラップをhookしない

bashでStarshipを実行しおいる堎合、 eval $(starship init $0)実行した埌にDEBUGトラップをフックしないでください。そうしないず、このモゞュヌルがおそらくですが壊れたす。

:::

preexecのような機胜を必芁ずするBashナヌザヌは、 rcalorasのbash_preexecフレヌムワヌクを䜿甚できたす。 eval $(starship init $0) を実行する前に、preexec_functions、およびprecmd_functions定矩するだけで、通垞どおり続行したす。

オプション

倉数 デフォルト 説明
min_time 2_000 実行時間を衚瀺する最短期間ミリ秒単䜍です。
show_milliseconds false 実行時間の秒に加えおミリ秒を衚瀺したす。
prefix took コマンド実行時間の盎前に衚瀺する文字列です。
style "bold yellow" モゞュヌルのスタむルです。
disabled false cmd_durationモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[cmd_duration]
min_time = 500
prefix = "underwent "

Conda

$CONDA_DEFAULT_ENVが蚭定されおいる堎合、condaモゞュヌルは珟圚のcondaの環境を衚瀺したす。

::: tip

Note: これはconda自身の プロンプト修食子 を抑制したせん。conda config --set changeps1 False で実行するこずができたす。

:::

オプション

倉数 デフォルト 説明
truncation_length 1 The number of directories the environment path should be truncated to, if the environment was created via conda create -p [path]. 0 means no truncation. Also see the directory module.
symbol "C " 環境名の盎前に䜿甚されるシンボルです。
style "bold green" モゞュヌルのスタむルです。
disabled false condaモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[conda]
style = "dimmed green"

Crystal

crystalモゞュヌルには、珟圚むンストヌルされおいるCrystalのバヌゞョンが衚瀺されたす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにshard.ymlファむルが含たれおいる
  • カレントディレクトリに.crの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🔮 " Crystalのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false crystalモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[crystal]
symbol = "✹ "
style = "bold blue"

ディレクトリ

directoryモゞュヌルには、珟圚のディレクトリぞのパスが衚瀺され、3぀の芪フォルダは切り捚おられたす。 ディレクトリは、珟圚のgitリポゞトリであるずルヌトずなりたす。

fishスタむルのpwdオプションを䜿甚するず、切り捚おられたパスを非衚瀺にする代わりに、オプションで有効にした番号に基づいお各ディレクトリの短瞮名が衚瀺されたす。

䟋ずしお、~/Dev/Nix/nixpkgs/pkgsで、nixpkgsがリポゞトリルヌトであり、オプションが1に蚭定されおいる堎合を挙げたす。 以前はnixpkgs/pkgsでしたが、~/D/N/nixpkgs/pkgsが衚瀺されたす。

オプション

倉数 デフォルト 説明
truncation_length 3 珟圚のディレクトリを切り捚おる芪フォルダヌの数です。
truncate_to_repo true 珟圚いるgitリポゞトリのルヌトに切り捚おるかどうかです。
prefix "in " ディレクトリ名の盎前に衚瀺するprefixです。
style "bold cyan" モゞュヌルのスタむルです。
disabled false directoryモゞュヌルを無効にしたす。
このモゞュヌルは、どのようにディレクトリを衚瀺するかに぀いおの高床なオプションをいく぀か持っおいたす。
倉数 デフォルト 説明
fish_style_pwd_dir_length 0 fish shellのpwdパスロゞックを適甚するずきに䜿甚する文字数です。
use_logical_path true OSからのパスの代わりに、シェル(PWD) によっお提䟛される論理パスを衚瀺したす。

fish_style_pwd_dir_length interacts with the standard truncation options in a way that can be surprising at first: if it's non-zero, the components of the path that would normally be truncated are instead displayed with that many characters. For example, the path /built/this/city/on/rock/and/roll, which would normally be displayed as as rock/and/roll, would be displayed as /b/t/c/o/rock/and/roll with fish_style_pwd_dir_length = 1--the path components that would normally be removed are displayed with a single character. For fish_style_pwd_dir_length = 2, it would be /bu/th/ci/on/rock/and/roll.

蚭定䟋

# ~/.config/starship.toml

[directory]
truncation_length = 8

Docker Context

The docker_context module shows the currently active Docker context if it's not set to default.

オプション

倉数 デフォルト 説明
symbol "🐳 " The symbol used before displaying the Docker context .
only_with_files false Only show when there's a docker-compose.yml or Dockerfile in the current directory.
style "bold blue" モゞュヌルのスタむルです。
disabled true Disables the docker_context module.

蚭定䟋

# ~/.config/starship.toml

[docker_context]
symbol = "🐋 "

Dotnet

dotnet モゞュヌルはカレントディレクトリに関係する.NET Core SDKのバヌゞョンを衚瀺したす。 もし SDKは珟圚のディレクトリに固定されおいるのであれば、その固定されたバヌゞョンが衚瀺されたす。 それ以倖の堎合、モゞュヌル SDKの最新のむンストヌルバヌゞョンを瀺したす。

このモゞュヌルは、カレントディレクトリに次のファむルのいずれかが存圚する堎合にのみプロンプトに衚瀺されたす。: global.json, project.json, *.sln, *.csproj, *.fsproj, *.xproj 正しく䜿甚するには、.NET Coreコマンドラむンツヌルもむンストヌルする必芁がありたす。

内郚的に、このモゞュヌルは自身のバヌゞョン怜知のメカニズムを利甚したす。 dotnet --version を実行するより2倍速く実行できたすが、.NET project䞀般的でないディレクトリlayoutの堎合は間違ったバヌゞョンが瀺されおしたうこずがありたす。 速床よりも粟床が重芁な堎合は、次の方法でメカニズムを無効にできたす。 モゞュヌルオプションでheuristic = false を蚭定したす。

オプション

倉数 デフォルト 説明
symbol •NET " dotnetのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
heuristic true より高速なバヌゞョン怜出を䜿甚しお、starshipの動䜜を維持したす。
style "bold blue" モゞュヌルのスタむルです。
disabled false dotnetモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[dotnet]
symbol = "🥅 "
style = "green"
heuristic = false

Elixir

The elixir module shows the currently installed version of Elixir and Erlang/OTP. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにmix.exsファむルが含たれおいる.

オプション

倉数 デフォルト 説明
symbol "💧 " The symbol used before displaying the version of Elixir/Erlang.
style "bold purple" モゞュヌルのスタむルです。
disabled false Disables the elixir module.

蚭定䟋

# ~/.config/starship.toml

[elixir]
symbol = "🔮 "

Elm

elmモゞュヌルは、珟圚むンストヌルされおいるElmのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにelm.jsonファむルが含たれおいる
  • カレントディレクトリにelm-package.jsonファむルが含たれおいる
  • The current directory contains a .elm-version file
  • カレントディレクトリにelm-stuffフォルダが含たれおいる
  • カレントディレクトリに*.elmファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🌳 " Elmのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold cyan" モゞュヌルのスタむルです。
disabled false elmモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[elm]
symbol = " "

環境倉数

env_varモゞュヌルは、遞択された環境倉数の珟圚の倀を衚瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • variableオプションが、既存の環境倉数ず䞀臎する
  • variableオプションが定矩されおおらず、defaultオプションが定矩されおいる

オプション

倉数 デフォルト 説明
symbol 環境倉数を衚瀺する前に䜿甚される蚘号です。
variable 衚瀺される環境倉数です。
default 䞊のvariableが定矩されおいない堎合に衚瀺されるデフォルトの倀です。
prefix "" 倉数の盎前に衚瀺するprefixです。
suffix "" 倉数の盎埌に衚瀺するsuffixです。
style "dimmed bold black" モゞュヌルのスタむルです。
disabled false env_varモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[env_var]
variable = "SHELL"
default = "unknown shell"

Erlang

The erlang module shows the currently installed version of Erlang/OTP. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにrebar.configファむルが含たれおいる.
  • カレントディレクトリにerlang.mkファむルが含たれおいる.

オプション

倉数 デフォルト 説明
symbol "🖧 " The symbol used before displaying the version of Erlang.
style bold red The style for this module.
disabled false Disables the erlang module.

蚭定䟋

# ~/.config/starship.toml

[erlang]
symbol = "e "

Git ブランチ

git_branchモゞュヌルは、珟圚のディレクトリにあるリポゞトリのアクティブなブランチを衚瀺したす。

オプション

倉数 デフォルト 説明
symbol " " 珟圚のディレクトリのリポゞトリのブランチ名の前に䜿甚されるシンボルです。
truncation_length 2^63 - 1 gitブランチをX曞蚘玠に切り捚おたす。
truncation_symbol "
" ブランチ名切り捚おられおいるこずを瀺すための蚘号です。 蚘号なしに「」も䜿甚できたす。
style "bold purple" モゞュヌルのスタむルです。
disabled false git_branchモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[git_branch]
symbol = "🌱 "
truncation_length = 4
truncation_symbol = ""

Git コミット

git_commitモゞュヌルは、珟圚のディレクトリにあるリポゞトリの珟圚のコミットハッシュを衚瀺したす。

オプション

倉数 デフォルト 説明
commit_hash_length 7 衚瀺されるgitコミットハッシュの長さです。
prefix "(" このモゞュヌルの先頭に衚瀺される文字列です。
suffix ")" このモゞュヌルの末尟に衚瀺される文字列です。
style "bold green" モゞュヌルのスタむルです。
only_detached true 切り離されたHEAD状態のずきのみgit commit hashを衚瀺したす
disabled false git_commitモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[git_commit]
truncation_length = 4

Git の進行状態

git_stateモゞュヌルはgitディレクトリの進行状態を衚したす。 (䟋: REBASING, BISECTING, その他) 進捗情報がある堎合(䟋: REBASING 3/10)はその情報も衚瀺されたす。

オプション

倉数 デフォルト 説明
rebase "REBASING" rebase進行䞭に衚瀺されるテキストです。
merge "MERGING" merge進行䞭に衚瀺されるテキストです。
revert "REVERTING" revert進行䞭に衚瀺されるテキストです。
cherry_pick "CHERRY-PICKING" cherry-pick進行䞭に衚瀺されるテキストです。
bisect "BISECTING" disect進行䞭に衚瀺されるテキストです。
am "AM" apply-mailbox (git am) の進行䞭に衚瀺されるテキストです。
am_or_rebase "AM/REBASE" あいたいなapply-mailboxたたはrebaseが進行䞭のずきに衚瀺されるテキストです。
progress_divider "/" 珟圚の進行量ず合蚈進行量を分ける蚘号たたはテキストです。 (䟋: " of " 、 "3 of 10")
style "bold yellow" モゞュヌルのスタむルです。
disabled false git_stateモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[git_state]
progress_divider = " of "
cherry_pick = "🍒 PICKING"

Git の状態

git_statusモゞュヌルは、珟圚のディレクトリのリポゞトリの状態を衚すシンボルを衚瀺したす。

オプション

倉数 デフォルト 説明
conflicted "=" このブランチにはマヌゞの競合がありたす。
conflicted_count link 競合の数の衚瀺およびスタむル蚭定したす。
ahead "⇡" このブランチは、远跡されるブランチよりも先にありたす。
behind "⇣" このブランチは、远跡されおいるブランチの背埌にありたす。
diverged "⇕" このブランチは、远跡されおいるブランチから分岐しおいたす。
untracked "?" 䜜業ディレクトリに远跡されおいないファむルがありたす。
untracked_count link 远跡されおいないファむルの数を衚瀺およびスタむル蚭定したす。
stashed "$" ロヌカルリポゞトリ甚のスタッシュが存圚したす。
stashed_count link スタッシュの数の衚瀺およびスタむル蚭定したす。
modified "!" 䜜業ディレクトリにファむルの倉曎がありたす。
modified_count link 倉曎されたファむルの数を衚瀺およびスタむル蚭定したす。
staged "+" 新しいファむルがステヌゞング領域に远加されたした。
staged_count link ステヌゞングされたファむルの数を衚瀺およびスタむル蚭定したす。
renamed "»" 名前が倉曎されたファむルがステヌゞング領域に远加されたした。
renamed_count link 名前を倉曎したファむルの数を衚瀺およびスタむル蚭定したす。
deleted "✘" ファむルの削陀がステヌゞング領域に远加されたした。
deleted_count link 削陀されたファむルの数を衚瀺およびスタむルしたす。
show_sync_count false 远跡されおいるブランチの先行/埌方カりントを衚瀺したす。
prefix [ このモゞュヌルの先頭に衚瀺される文字列です。
suffix ] このモゞュヌルの末尟に衚瀺される文字列です。
style "bold red" モゞュヌルのスタむルです。
disabled false git_statusモゞュヌルを無効にしたす。

Git Statusのカりント

倉数 デフォルト 説明
enabled false ファむルの数を衚瀺したす。
style オプションで、モゞュヌルずは異なるカりントのスタむルを蚭定したす。

蚭定䟋

# ~/.config/starship.toml

[git_status]
conflicted = "🏳"
ahead = "🏎💚"
behind = "😰"
diverged = "😵"
untracked = "🀷‍"
stashed = "📊"
modified = "📝"
staged.value = "++"
staged.style = "green"
staged_count.enabled = true
staged_count.style = "green"
renamed = "👅"
deleted = "🗑"

Golang

golangモゞュヌルは、珟圚むンストヌルされおいるGolangのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにgo.modファむルが含たれおいる
  • カレントディレクトリにgo.sumファむルが含たれおいる
  • カレントディレクトリにglide.yamlファむルが含たれおいる
  • カレントディレクトリにGopkg.ymlファむルが含たれおいる
  • カレントディレクトリにGopkg.lockファむルが含たれおいる
  • The current directory contains a .go-version file
  • カレントディレクトリにGodepsファむルが含たれおいる
  • カレントディレクトリに.goの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🐹 " Golangのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold cyan" モゞュヌルのスタむルです。
disabled false golangモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[golang]
symbol = "🏎💚 "

Haskell

The haskell module shows the currently installed version of Haskell Stack version. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにstack.yamlファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "λ " The symbol used before displaying the version of Haskell.
style "bold red" モゞュヌルのスタむルです。
disabled false Disables the haskell module.

蚭定䟋

# ~/.config/starship.toml

[haskell]
symbol = " "

ホスト名

hostnameモゞュヌルには、システムのホスト名が衚瀺されたす。

オプション

倉数 デフォルト 説明
ssh_only true SSHセッションに接続されおいる堎合にのみホスト名を衚瀺したす。
prefix "" ホスト名の盎前に衚瀺するprefixです。
suffix "" ホスト名の盎埌に衚瀺するsuffixです。
trim_at "." この文字が最初にマッチするたでをホスト名ず認識したす。 "."は最初の. たでをホスト名ずしお認識したす。 ""を指定した堎合トリムしたせん。
style "bold dimmed green" モゞュヌルのスタむルです。
disabled false hostnameモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[hostname]
ssh_only = false
prefix = "⟪"
suffix = "⟫"
trim_at = ".companyname.com"
disabled = false

Java

javaモゞュヌルは、珟圚むンストヌルされおいるJavaのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a pom.xml, build.gradle.kts, build.sbt or .java-version file
  • カレントディレクトリに拡匵子が.java, .class, .gradle, もしくは.jarのファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "☕ " Javaのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "dimmed red" モゞュヌルのスタむルです。
disabled false javaモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[java]
symbol = "🌟 "

ゞョブ

jobsモゞュヌルには、実行䞭のゞョブの珟圚の数が衚瀺されたす。 このモゞュヌルは、実行䞭のバックグラりンドゞョブがある堎合にのみ衚瀺されたす。 1぀以䞊のゞョブがある、たたはthresholdに指定した倀以䞊にゞョブがある堎合は実行䞭のゞョブの数を衚瀺したす。

オプション

倉数 デフォルト 説明
symbol "✩" ゞョブの数を衚瀺する前に䜿甚される蚘号です。
threshold 1 超過した堎合、ゞョブの数を衚瀺したす。
style "bold blue" モゞュヌルのスタむルです。
disabled false jobsモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[jobs]
symbol = "+ "
threshold = 4

Julia

juliaモゞュヌルは、珟圚むンストヌルされおいるJuliaのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにProject.tomlファむルが含たれおいる
  • カレントディレクトリにManifest.tomlファむルが含たれおいる
  • カレントディレクトリに.jlの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "ஃ " Juliaのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold purple" モゞュヌルのスタむルです。
disabled false juliaモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[julia]
symbol = "∎ "

Kubernetes

珟圚のKubernetesコンテキスト名ず、蚭定されおいる堎合は、kubeconfigファむルに基づいおネヌムスペヌスを衚瀺したす。 ネヌムスペヌスはkubconfigで蚭定されおいる必芁がありたす。それは kubectl config set-context starship-cluster --namespace astronaut のようなコマンドで蚭定するこずができたす。 $KUBECONFIG 環境倉数が蚭定されおいる堎合、モゞュヌルはそれを䜿甚したす ~/.kube/config は䜿甚したせん。

::: tip

このモゞュヌルはデフォルトで無効になっおいたす。 有効にするには、蚭定ファむルでdisabledをfalseに蚭定したす。

:::

オプション

倉数 デフォルト 説明
symbol "☞ " クラスタ情報を衚瀺する前に䜿甚される蚘号です。
context_aliases Table of context aliases to display
style "bold blue" モゞュヌルのスタむルです。
disabled true Kubernetesモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[kubernetes]
symbol = "⛵ "
style = "dimmed green"
disabled = false
[kubernetes.context_aliases]
"dev.local.cluster.k8s" = "dev"

改行

line_breakモゞュヌルは、プロンプトを2行に分割したす。

オプション

倉数 デフォルト 説明
disabled false line_breakモゞュヌルを無効にしお、プロンプトを1行にしたす。

蚭定䟋

# ~/.config/starship.toml

[line_break]
disabled = true

メモリ䜿甚量

`memory_usage</ 0>モゞュヌルは、珟圚のシステムメモリずスワップ䜿甚量を瀺したす。

デフォルトでは、システムスワップの合蚈がれロ以倖の堎合、スワップ䜿甚量が衚瀺されたす。

::: tip

このモゞュヌルはデフォルトで無効になっおいたす。 有効にするには、蚭定ファむルでdisabled`を`false`に蚭定したす。

:::

オプション

倉数 デフォルト 説明
show_percentage false メモリ䜿甚量を割合で衚瀺したす。
show_swap true 合蚈スワップがれロ以倖の堎合、スワップ䜿甚量を衚瀺したす。
threshold 75 この閟倀を超えない限り、メモリ䜿甚率は衚瀺されたせん。
symbol "🐏 " メモリ䜿甚率を衚瀺する前に䜿甚される蚘号です。
separator `" "`
style "bold dimmed white" モゞュヌルのスタむルです。
disabled true memory_usageモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[memory_usage]
disabled = false
show_percentage = true
show_swap = true
threshold = -1
symbol = " "
separator = "/"
style = "bold dimmed green"

Mercurial ブランチ

hg_branchモゞュヌルは、珟圚のディレクトリにあるリポゞトリのアクティブなブランチを瀺したす。

オプション

倉数 デフォルト 説明
symbol " " The symbol used before the hg bookmark or branch name of the repo in your current directory.
truncation_length 2^63 - 1 Truncates the hg branch name to X graphemes
truncation_symbol "
" ブランチ名切り捚おられおいるこずを瀺すための蚘号です。
style "bold purple" モゞュヌルのスタむルです。
disabled true Disables the hg_branch module.

蚭定䟋

# ~/.config/starship.toml

[hg_branch]
symbol = "🌱 "
truncation_length = 4
truncation_symbol = ""

Nix-shell

nix_shellモゞュヌルは、nix-shell環境を瀺しおいたす。 このモゞュヌルは、nixシェル環境内にあるずきに衚瀺されたす。

オプション

倉数 デフォルト 説明
use_name false nix-shellの名前を衚瀺したす。
impure_msg "impure" impureメッセヌゞをカスタマむズしたす。
pure_msg "pure" pureメッセヌゞをカスタマむズしたす。
symbol "❄ " The symbol used before displaying the shell name.
style "bold blue" モゞュヌルのスタむルです。
disabled false nix_shellモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[nix_shell]
disabled = true
use_name = true
impure_msg = "impure shell"
pure_msg = "pure shell"
symbol = "☃  "

NodeJS

nodejsモゞュヌルは、珟圚むンストヌルされおいるNodeJSのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにpackage.jsonファむルが含たれおいる
  • The current directory contains a .node-version file
  • カレントディレクトリにnode_modulesディレクトリが含たれおいる
  • カレントディレクトリに.jsの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "⬢ " NodeJSのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold green" モゞュヌルのスタむルです。
disabled false nodejsモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[nodejs]
symbol = "🀖 "

パッケヌゞのバヌゞョン

packageモゞュヌルは、珟圚のディレクトリがパッケヌゞのリポゞトリである堎合に衚瀺され、珟圚のバヌゞョンが衚瀺されたす。 The module currently supports npm, cargo, poetry, composer, gradle, julia and mix packages.

  • npm – npmパッケヌゞバヌゞョンは、珟圚のディレクトリにあるpackage.jsonから抜出されたす
  • cargo – cargoパッケヌゞバヌゞョンは、珟圚のディレクトリにあるCargo.tomlから抜出されたす。
  • poetry – poetryパッケヌゞバヌゞョンは、珟圚のディレクトリにあるpyproject.tomlから抜出されたす
  • composer – composerパッケヌゞバヌゞョンは、珟圚のディレクトリにあるcomposer.jsonから抜出されたす
  • gradle – The gradle package version is extracted from the build.gradle present
  • julia - The package version is extracted from the Project.toml present
  • mix - The mix package version is extracted from the mix.exs present

⚠ 衚瀺されるバヌゞョンは、パッケヌゞマネヌゞャヌではなく、゜ヌスコヌドが珟圚のディレクトリにあるパッケヌゞのバヌゞョンです。

オプション

倉数 デフォルト 説明
symbol "📊 " パッケヌゞのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold 208" モゞュヌルのスタむルです。
display_private false Enable displaying version for packages marked as private.
disabled false package モゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[package]
symbol = "🎁 "

OCaml

The ocaml module shows the currently installed version of OCaml. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a file with .opam extension or _opam directory
  • The current directory contains a esy.lock directory
  • The current directory contains a dune or dune-project file
  • The current directory contains a jbuild or jbuild-ignore file
  • The current directory contains a .merlin file
  • The current directory contains a file with .ml, .mli, .re or .rei extension

オプション

倉数 デフォルト 説明
symbol "🐫 " The symbol used before displaying the version of OCaml.
style "bold yellow" モゞュヌルのスタむルです。
disabled false Disables the ocaml module.

蚭定䟋

# ~/.config/starship.toml

[ocaml]
symbol = "🐪 "

PHP

phpモゞュヌルは、珟圚むンストヌルされおいるPHPのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにcomposer.jsonファむルが含たれおいる
  • The current directory contains a .php-version file
  • カレントディレクトリに.phpの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🐘 " PHPのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold 147" モゞュヌルのスタむルです。
disabled false phpモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[php]
symbol = "🔹 "

Python

The python module shows the currently installed version of Python and the current Python virtual environment if one is activated.

If pyenv_version_name is set to true, it will display the pyenv version name. Otherwise, it will display the version number from python --version.

次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリに.python-versionファむルが含たれおいる
  • カレントディレクトリにrequirements.txtファむルが含たれおいる
  • カレントディレクトリにpyproject.tomlファむルが含たれおいる
  • The current directory contains a file with the .py extension (and scan_for_pyfiles is true)
  • カレントディレクトリにPipfileファむルが含たれおいる
  • カレントディレクトリにtox.iniファむルが含たれおいる
  • カレントディレクトリにsetup.pyファむルが含たれおいる
  • The current directory contains a __init__.py file
  • 仮想環境がアクティブである

オプション

倉数 デフォルト 説明
symbol "🐍 " Pythonのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
pyenv_version_name false pyenvを䜿甚しおPythonバヌゞョンを取埗したす
pyenv_prefix "pyenv " pyenvバヌゞョン衚瀺の前のprefix (デフォルトの衚瀺はpyenv MY_VERSION) です
scan_for_pyfiles true If false, Python files in the current directory will not show this module.
style "bold yellow" モゞュヌルのスタむルです。
disabled false pythonモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[python]
symbol = "👟 "
pyenv_version_name = true
pyenv_prefix = "foo "

Ruby

rubyモゞュヌルは、珟圚むンストヌルされおいるRubyのバヌゞョンを瀺したす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにGemfileファむルが含たれおいる
  • The current directory contains a .ruby-version file
  • カレントディレクトリに.rbの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "💎 " Rubyのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false rubyモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[ruby]
symbol = "🔺 "

Rust

rustモゞュヌルには、珟圚むンストヌルされおいるRustのバヌゞョンが衚瀺されたす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリにCargo.tomlファむルが含たれおいる
  • カレントディレクトリに.rsの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "🊀 " Rustのバヌゞョンを衚瀺する前に䜿甚される蚘号です。
style "bold red" モゞュヌルのスタむルです。
disabled false rustモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[rust]
symbol = "⚙ "

Singularity

The singularity module shows the current singularity image, if inside a container and $SINGULARITY_NAME is set.

オプション

倉数 デフォルト 説明
label "" Prefix before the image name display.
prefix "[" Prefix to display immediately before image name.
suffix "]" Suffix to display immediately after image name.
symbol "" The symbol used before the image name.
style "bold dimmed blue" モゞュヌルのスタむルです。
disabled false Disables the singularity module.

蚭定䟋

# ~/.config/starship.toml

[singularity]
symbol = "📊 "

Terraform

terraformモゞュヌルには、珟圚遞択されおいるterraformワヌクスペヌスずバヌゞョンが衚瀺されたす。 デフォルトでは、Terraformのバヌゞョンは衚瀺されたせん。これは、倚くのプラグむンが䜿甚されおいる堎合、Terraformの珟圚のバヌゞョンでは遅いためです。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントディレクトリに.terraformフォルダが含たれおいる
  • カレントディレクトリに.tfの拡匵子のファむルが含たれおいる

オプション

倉数 デフォルト 説明
symbol "💠 " Terraform ワヌクスペヌスを衚瀺する前に䜿甚される蚘号です。
show_version false Terraformのバヌゞョンを衚瀺したす。 倧きなワヌクスペヌスでは非垞に遅くなりたす。
style "bold 105" モゞュヌルのスタむルです。
disabled false terraformモゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[terraform]
symbol = "🏎💚 "

時刻

timeモゞュヌルは、珟圚の珟地時間を瀺したす。 format蚭定は、時間の衚瀺方法を制埡するためにchronoクレヌトによっお䜿甚されたす。 䜿甚可胜なオプションを確認するには、chrono strftimeのドキュメントをご芧ください。

::: tip

このモゞュヌルはデフォルトで無効になっおいたす。 有効にするには、蚭定ファむルでdisabledをfalseに蚭定したす。

:::

オプション

倉数 デフォルト 説明
use_12hr false 12時間のフォヌマットを有効にしたす。
format この衚の䞋を参照しおください 時刻のフォヌマットに䜿甚されるクロノフォヌマット文字列 です。
style "bold yellow" モゞュヌルのスタむルです。
utc_time_offset "local" 䜿甚するUTCオフセットを蚭定したす。 -24から24たでの間で蚭定可胜です。 フロヌトが30/45分のタむムゟヌンオフセットに察応できるようにしたす。
disabled true timeモゞュヌルを無効にしたす。

use_12hr が true の堎合、format のデフォルトは "%r" です。 それ以倖の堎合、デフォルトは"%T"です。 formatを手動で蚭定するず、use_12hrの蚭定が䞊曞きされたす。

蚭定䟋

# ~/.config/starship.toml

[time]
disabled = false
format = "🕙[ %T ]"
utc_time_offset = "-5"

ナヌザヌ名

usernameモゞュヌルには、アクティブなナヌザヌのナヌザヌ名が衚瀺されたす。 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • カレントナヌザヌがroot
  • カレントナヌザヌが、ログむンしおいるナヌザヌずは異なる
  • ナヌザヌがSSHセッションずしお接続されおいる
  • show_always倉数がtrueに蚭定されおいる

オプション

倉数 デフォルト 説明
style_root "bold red" ナヌザヌがrootのずきに䜿甚されるスタむルです。
style_user "bold yellow" 非rootナヌザヌに䜿甚されるスタむルです。
show_always false username モゞュヌルを垞に衚瀺したす。
disabled false username モゞュヌルを無効にしたす。

蚭定䟋

# ~/.config/starship.toml

[username]
disabled = true

Zig

The zig module shows the currently installed version of Zig. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a .zig file

オプション

倉数 デフォルト 説明
symbol "↯ " The symbol used before displaying the version of Zig.
style "bold yellow" モゞュヌルのスタむルです。
disabled false Disables the zig module.

蚭定䟋

# ~/.config/starship.toml

[zig]
symbol = "⚡ "

Custom commands

The custom modules show the output of some arbitrary commands.

These modules will be shown if any of the following conditions are met:

  • The current directory contains a file whose name is in files
  • The current directory contains a directory whose name is in directories
  • The current directory contains a file whose extension is in extensions
  • The when command returns 0

::: tip

Multiple custom modules can be defined by using a ..

:::

::: tip

The order in which custom modules are shown can be individually set by setting custom.foo in prompt_order. By default, the custom module will simply show all custom modules in the order they were defined.

:::

オプション

倉数 デフォルト 説明
command The command whose output should be printed.
when A shell command used as a condition to show the module. The module will be shown if the command returns a 0 status code.
shell The path to the shell to use to execute the command. If unset, it will fallback to STARSHIP_SHELL and then to "sh".
説明 "<custom module>" The description of the module that is shown when running starship explain.
files [] The files that will be searched in the working directory for a match.
directories [] The directories that will be searched in the working directory for a match.
extensions [] The extensions that will be searched in the working directory for a match.
symbol "" The symbol used before displaying the command output.
style "bold green" モゞュヌルのスタむルです。
prefix "" Prefix to display immediately before the command output.
suffix "" Suffix to display immediately after the command output.
disabled false Disables this custom module.

蚭定䟋

# ~/.config/starship.toml

[custom.foo]
command = "echo foo"  # shows output of command
files = ["foo"]       # can specify filters
when = """ test "$HOME" == "$PWD" """
prefix = " transcending "

PureScript

The purescript module shows the currently installed version of PureScript version. 次の条件のいずれかが満たされるず、モゞュヌルが衚瀺されたす。

  • The current directory contains a spago.dhall file
  • The current directory contains a *.purs files

オプション

倉数 デフォルト 説明
symbol "<=> " The symbol used before displaying the version of PureScript.
style "bold white" モゞュヌルのスタむルです。
disabled false Disables the purescript module.

蚭定䟋

# ~/.config/starship.toml

[purescript]
symbol = "<=> "