Discuss and resolve questions on Liquid, JavaScript, themes, sales channels, and site speed enhancements.
I've installed Shopify CLI to try theme app extension. But I am working remotely from my PC to Ubuntu 18.04 dev server. When I run Shopify login, CLI gives me a URL to paste on the browser. But the redirect URI in this URL starts with 127.0.0.1. The link showed the login screen but it failed after I clicked my account.
Even I can login, I am not sure if I can scaffold a theme app extension since my app is not created with CLI.
I understand that Shopify wants to push all themes to upgrade to OS 2.0. My app is Python / Django. Now the CLI is installed with rbenv and >= Ruby 2.7. And it requires local development. Can you give me a less opinionated choice or workaround?
My app just uploads 4 liquid files to the theme. And the liquid files are using theme sections to make customizations.
Solved! Go to the solution
This is an accepted solution.
Just use python built-in webbrowser module to visit the link.
Did you figure this out? I'm trying to do the exact same thing. I have ubuntu VM on AWS with no browser. Thanks!
I ended up creating a tunnel for port 3456 using Putty:
Do you use the command "shopify login"? If so , how does this solve the browser issue? Could you please explain it a bit further?
Run ssh -N -L localhost:3456:localhost:3456 <username>@<ip of your cli server>
Worked for me without using "-N". If you want to ssh tunnel the dev server also just use "ssh -L localhost:3456:localhost:3456 -L localhost:9292:localhost:9292 <user>@<server_ip>"
Is it still ok to use a Tunnel in Putty? I try the same way for CLI 3.x running npm run dev. Copy the login link to the browser. Chrome tells me log in successfully. But the CLI exits on its own. Anyone is trying CLI on a remote server?
Could you explain how to have the Shopify CLI open the that particular text editor? When I enter Shopify login, a text browser opens automatically in the text editor, so I can't solve the captcha, which requires javascript. Does python's browser solve the captcha issue?
This is not correct and shouldn't be an accepted solution. The question indicates, that they are working remotely (which probably indicates SSH tunnel). The Python webbrowser module does not help, when going to the link from remote terminal. The login page still redirects to 127.0.0.1.
I was able to figure this out thanks to a post here: https://blog.klaudsol.com/how-to-run-shopify-cli-in-aws-cloud-9/
I was able to authenticate a Shopify partner account on "Ubuntu 22.04.3 LTS" AWS EC2 instance. Steps below:
1. Install Node.js and npm. I used Node Version Manager (Option 3 here)
2. Install Shopify CLI with theme: npm install -g @Shopify /cli @Shopify /theme
3. Check if it is installed: shopify version
4. Chose a folder and build app: npm init @Shopify /app@latest
5. Shopify App structure created successfully, and at this point you need to initiate a login to Shopify partner account and authenticate. Because I am creating an extension app I run: npm run shopify app generate extension
6. Wait for the "Auto-open timed out" message to appear after the banner:
To run this command, log in to Shopify Partners.
Press any key to open the login page on your browser
Auto-open timed out. Open the login page: Log in to Shopify Partners ( http://accounts.shopify.com/oauth/authorize?client_id=.... )
7. Copy the full URL in the brackets after "Log in to Shopify Partners" text
8. Paste it in a browser on your local PC (preferably in a window already logged in to a Shopify partner account)
9. You will get a "This site can’t be reached 127.0.0.1 refused to connect." page. Copy the generated URL. It needs to have a URL starting with "http://127.0.0.1:3456/?code=...." . BTW generating the code did not work from the first time for me.
10. Open a new SSH session to your AWS EC2 instance. Paste the full URL in a wget command. Like: wget 'http://127.0.0.1:3456/?code=' . Do not forget the single quotes around the link.
11. Done. At the first SSH session screen you can see the authentication process finalizing.
This method worked for me. Thanks a lot!
This is the way.
Thanks to everyone who participated in our AMA with 2H Media: Marketing Your Shopify St...
By Jacqui Sep 6, 2024The Hydrogen Visual Editor is now available to merchants in Shopify Editions | Summer '...
By JasonH Sep 2, 2024Note: Customizing your CSS requires some familiarity with CSS and HTML. Before you cust...
By JasonH Aug 12, 2024