Shopify CLIでログイン中のストア名をStarshipプロンプトに表示する Tsun Inc.

Display the logged-in store name in the Starship prompt with Shopify CLI

小笠原 京平

"RuffRuff 予約販売" supports the reduction of opportunity losses that occur when products are out of stock, new products are not on sale, or are on backorder.
It's incredibly easy to create pre-orders on your Shopify store, allowing you to register an unlimited number of pre-order products and accept unlimited pre-orders. You can also restrict people from ordering pre-order items and regular items at the same time, or send notifications when the item will be back in stock if it is not yet determined.
There are many unique features that are not found in other pre-order sales apps, such as the "Pay Later" feature that allows you to collect payment before the product is shipped.


My name is Ogasawara, CTO of Tsun Inc.!
Recently, we mainly develop Shopify apps and themes.
This blog shares information useful for Shopify development.
I would be happy if this would be helpful for Shopify engineers!

Why did you decide to make it?

If you're working with multiple customer stores with Shopify Partners, you'll need to work with multiple development stores.
Information about the store you are logged in with the Shopify CLI shopify store It was a pain to run the command and confirm it every time, so I thought I'd display it at Starship's prompt.

What you created

A setting that displays the store name currently logged in with Shopify CLI in the Starship prompt

Prerequisites

Target audience

  • People who have used Shopify CLI
  • People who have installed Starship

    I won't go into details about Starship in this article, but if you're interested in installing it, it's easy to install, so I highly recommend taking this opportunity to do so!

Environment

  • Shopify CLI (version: 2.17.0)
  • Starship (version: 1.6.3)

Implementation

Add the following settings to ~/.config/starship.toml .

[custom.shopify]
command = """ shopify store | sed -r "s/^.* into (.*)\\.myshopify\\.com.*$/\\1/" """
when = "shopify store"

Once the settings are reflected, the name of the store you are logged in to will be displayed as shown below!

Even if you switch stores, the name of the store you are currently logged in to will change immediately.

Display Shopify CLI login information in Starship prompt


What we are doing isshopify store When I run

You're currently logged into tsun-dev.myshopify.com

Since it is displayed in the format, only the store name part is extracted.

If you think it is annoying for it to always be displayed, specifying shopify-cli.yml in the detect_files option seems good.

Also, symbol is not specified above, but specifying something like Nerd Fonts' nf-fa-shopping_bag should make it easier to recognize as Shopify.

If you want to know about other settings, please check custom-commands.

Summary

This time, we introduced how to display the name of the store you are logged in to on the Shopify CLI in the Starship prompt.
I would be happy if Starship officially responded soon!



Tsun has a track record of building numerous stores with Shopify Partners.
If you are interested in building a store, please contact Tsun.

👆️目次はShopifyアプリ「RuffRuff 目次作成」を利用

👆️Table of contents by the Shopify app RuffRuff Table of Contents

Back to blog
  • Shopifyで使える決済方法一覧|手数料・導入サービス・選び方

    [Complete Guide] A Roundup of Payment Methods A...

    Tsunライターチーム

    This article gives a detailed explanation of the many payment methods available on Shopify and their respective payment processing fees and transaction fees. We also introduce handy Shopify apps that...

    [Complete Guide] A Roundup of Payment Methods A...

    Tsunライターチーム

    This article gives a detailed explanation of the many payment methods available on Shopify and their respective payment processing fees and transaction fees. We also introduce handy Shopify apps that...

  • GMOイプシロンの手数料・決済方法・入金サイクル|Shopifyの条件も解説

    GMO Epsilon Fees, Payment Methods, and Payout C...

    Tsun ライターチーム

    GMO Epsilon payment methods and fees, organized by contract type. Covers Shopify-specific terms, payouts, authorization and capture deadlines, refunds, and cancellation. Also introduces ways to use apps to control which...

    GMO Epsilon Fees, Payment Methods, and Payout C...

    Tsun ライターチーム

    GMO Epsilon payment methods and fees, organized by contract type. Covers Shopify-specific terms, payouts, authorization and capture deadlines, refunds, and cancellation. Also introduces ways to use apps to control which...

  • Shopify向けSBペイメントサービス|対応決済・手数料・導入時の注意点

    SB Payment Service for Shopify: Supported Payme...

    Tsun ライターチーム

    This article organizes the payment methods and pricing available with SBPS for Shopify. Compare cost estimates that include fixed costs, authentication fees, and Shopify fees, along with capture deadlines and...

    SB Payment Service for Shopify: Supported Payme...

    Tsun ライターチーム

    This article organizes the payment methods and pricing available with SBPS for Shopify. Compare cost estimates that include fixed costs, authentication fees, and Shopify fees, along with capture deadlines and...

  • KOMOJUとShopifyの連携|決済方法・手数料・オーソリ期限

    Integrating KOMOJU with Shopify: Payment Method...

    Tsunライターチーム

    This guide lists the KOMOJU payment methods available on Shopify and their fees. It covers rates for physical goods and digital content, additional Shopify fees, setup steps, authorization periods, payouts,...

    Integrating KOMOJU with Shopify: Payment Method...

    Tsunライターチーム

    This guide lists the KOMOJU payment methods available on Shopify and their fees. It covers rates for physical goods and digital content, additional Shopify fees, setup steps, authorization periods, payouts,...

  • Shopifyのセキュリティ対策|決済・アプリ要件・バグバウンティ

    Shopify Security: Payments, App Requirements, a...

    Tsun ライターチーム

    For businesses considering Shopify, this article explains security safeguards for communications, customer information, payments, and apps, along with third-party assessments. Review the scope of protection, compensation requirements, operational preparations, and...

    Shopify Security: Payments, App Requirements, a...

    Tsun ライターチーム

    For businesses considering Shopify, this article explains security safeguards for communications, customer information, payments, and apps, along with third-party assessments. Review the scope of protection, compensation requirements, operational preparations, and...

  • Shopifyサーバーの費用・稼働率・障害時の対処法

    Shopify server costs, uptime, and how to respon...

    Tsun ライターチーム

    Shopify web hosting is included in the plan fee. This article organizes costs and the scope of management, the difference between official uptime figures and contractual guarantees, the checks to...

    Shopify server costs, uptime, and how to respon...

    Tsun ライターチーム

    Shopify web hosting is included in the plan fee. This article organizes costs and the scope of management, the difference between official uptime figures and contractual guarantees, the checks to...

1 of 6
  • AI仮想顧客の改善ツール「SimGym」を使ったら売上はどうなった?実行から3か月後までの記録

    What Happened to Sales After Using SimGym, an A...

    テキサス・アユミ

    A record of trying SimGym on the miso specialty store ドットミソ, from checking the proposals through carrying out changes to the look-back three months later. It covers how the order...

    What Happened to Sales After Using SimGym, an A...

    テキサス・アユミ

    A record of trying SimGym on the miso specialty store ドットミソ, from checking the proposals through carrying out changes to the look-back three months later. It covers how the order...

  • 【ストアインタビュー後編】やりながら育てるShopify。「野菜をMOTTO」の試行錯誤:モンマルシェ株式会社 河野雄士さん

    [Store Interview, Part 2] Building and Growing ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." An in-depth look at our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its...

    [Store Interview, Part 2] Building and Growing ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." An in-depth look at our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its...

  • 【ストアインタビュー前編】 ECが主戦場でも、ECが目的ではない。「野菜をMOTTO」が貫くEC戦略:モンマルシェ株式会社 河野雄士さん

    [Store Interview, Part 1] Even When E-Commerce ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." Part 1 of our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its e-commerce...

    [Store Interview, Part 1] Even When E-Commerce ...

    テキサス・アユミ

    "Even when e-commerce is the main battlefield, e-commerce isn't the goal." Part 1 of our interview with Yuji Kono of Mon Marché, whose brand "Yasai wo MOTTO" grew its e-commerce...

1 of 3
  • Our Editorial Process

    For readers new to e-commerce and Shopify, we write our articles with care to explain difficult commerce and marketing terms, along with how everything works from building a store through to selling, as “gently,” “clearly,” and “accurately” as we can.

    Learn more 
  • About the information on this site

    The information published here is based on Tsun Inc.’s own experience and research. While we make every effort to publish information that is as “current” and “accurate” as possible, we cannot fully guarantee its contents. Tsun Inc. accepts no liability whatsoever for any damages arising from this site. If you find an error in the information published here, we would be grateful if you would contact Tsun Inc.