Learn about our RFC process, Open RFC meetings & more.Join in the discussion! »

@shopify/argo-admin-cli

0.1.5 • Public • Published

Argo Admin CLI

The Argo Admin CLI allows you to serve and build Argo Admin Extensions

Get started in one of two ways:

  1. Create an extension with Shopify CLI
  2. Manually clone the argo-admin-template, and following the set up steps in the README

Note: There is currently no instructions or other recommended way of using this library on its own (outside of Shopify CLI or argo-admin-template).

Local server

argo-admin-cli server

example

argo-admin-cli server --entry="index.tsx" --port=39351 --type="SUBSCRIPTION_MANAGEMENT"
# access server on localhost:39351 
Name Description Required
entry Entry file path of your script ☑️
port Local server port ☑️
type Extension type. See Available Extensions ☑️
env Local environment file. Cannot be named .env

Build

argo-admin-cli build

example

argo-admin-cli build --entry="index.tsx"

Built files are found in the build/ folder.

Name Description Required
entry Entry file path of your script ☑️
env Build environment file. Cannot be named .env

Environment variables

You can add environment variables to customize behavior for local development and on build. Here's an example walk-through of the process.

  1. Create an environment file for local development and for build.

    .env.client.local

    API_ENDPOINT=https://localhost:1234/api
    

    .env.client

    API_ENDPOINT=https://shopify.example.com/api
    

    Note: Don't name either file .env in your root folder as this is used by Shopify CLI.

  2. It is recommended you ignore your production environment file if you're using source control (like .gitignore if using Git)

  3. Add the files to your server and build scripts in package.json

    "server""argo-admin-cli server --entry=\"index.js\" --port=39351 --type=SUBSCRIPTION_MANAGEMENT --env=.env.client.local",
    "build""argo-admin-cli build --entry=\"index.js\" --env=.env.client"
  4. You can access your variables in your script via process.env.

    console.log(process.env.API_ENDPOINT);

Available extensions

  • SUBSCRIPTION_MANAGEMENT

Keywords

none

Install

npm i @shopify/[email protected]

Version

0.1.5

License

MIT

Unpacked Size

66.4 kB

Total Files

38

Last publish

Collaborators

  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar
  • avatar