npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

lojas-orion-cli

v3.2.1

Published

CLI para gerenciamento do ambiente de desenvolvimento Lojas Orion

Readme

Lojas Orion CLI

CLI para gerenciamento do ambiente de desenvolvimento Lojas Orion.

Node.js Platform


Instalacao

Pre-requisitos

Antes de instalar o CLI, certifique-se de ter:

| Requisito | Versao | Download | |-----------|--------|----------| | Node.js | 18+ | nodejs.org | | Git | 2.x+ | git-scm.com | | Java | 21+ | adoptium.net | | Docker Desktop | 4.x+ | docker.com |

Sobre o Docker Desktop

O Docker Desktop e obrigatorio para rodar os servicos (PostgreSQL, Redis, Auth, MDM).

Windows:

  • O instalador do Docker Desktop configura o WSL2 automaticamente
  • Nao e necessario instalar nenhuma distribuicao Linux manualmente
  • Apos instalar, reinicie o computador
  • Certifique-se de que o Docker Desktop esta configurado para:
    • Iniciar automaticamente com o Windows (Settings > General)
    • Usar WSL2 como backend (Settings > General > Use WSL 2 based engine)
    • Modo Linux Containers (padrao, nao alterar)

Mac/Linux:

  • Instale normalmente e inicie o Docker Desktop

Verificar instalacao:

docker --version
docker info

Instalar o CLI

npm install -g @dpsp/orion-cli

Verificar Instalacao

lojas-orion --version
lojas-orion check

Configuracao do GitLab

O CLI precisa de um Personal Access Token (PAT) do GitLab para clonar os repositorios.

Criar Personal Access Token

  1. Acesse: https://gitlab.com/-/user_settings/personal_access_tokens
  2. Clique em Add new token
  3. Nome: Lojas Orion Development
  4. Expiration: 90 dias ou mais
  5. Scopes (todos obrigatorios):
    • read_repository - para clonar repositorios
    • write_repository - para fazer push
    • read_api - para validar o token
  6. Clique em Create personal access token e copie o token (glpat-...)

Configurar Token (Opcional)

O token pode ser configurado antecipadamente via variavel de ambiente:

# Adicione ao seu .bashrc, .zshrc ou profile do PowerShell
export GITLAB_TOKEN="glpat-xxxxxxxxxxxxxxxxxx"

Ou salve em arquivo:

echo "glpat-xxxxxxxxxxxxxxxxxx" > ~/.gitlab-token

Nota: Se nao configurar antecipadamente, o lojas-orion setup pedira o token interativamente.


Uso Rapido

Apos instalacao, os comandos lojas-orion e orion ficam disponiveis globalmente.

# Ver ajuda
lojas-orion --help

# Verificar ambiente (Git, Java, Docker)
lojas-orion check

# Configurar projeto (clonar repos)
lojas-orion setup

# Iniciar servicos
lojas-orion up

# Ver status
lojas-orion status

Comandos Disponiveis

| Comando | Descricao | |---------|-----------| | check | Verifica pre-requisitos (Git, Java 21, Docker) | | setup | Configura ambiente inicial, clona repositorios | | up [servicos] | Inicia servicos Docker | | down | Para todos os servicos | | status | Mostra status dos servicos e repositorios | | logs <servico> | Exibe logs de um servico | | migrate | Executa migrations do banco | | update | Atualiza todos os repositorios (git pull) | | config | Gerencia configuracoes do CLI |


Fluxo Inicial Recomendado

# 1. Verificar se o ambiente esta ok
lojas-orion check

# 2. Configurar projeto (clonar repos)
lojas-orion setup

# 3. Iniciar infraestrutura
lojas-orion up --infra

# 4. Executar migrations
lojas-orion migrate

# 5. Iniciar servicos Java
lojas-orion up --services

# 6. Verificar status
lojas-orion status

Opcoes dos Comandos

lojas-orion check

lojas-orion check              # Verificacao completa
lojas-orion check --skip-java  # Pular verificacao de Java
lojas-orion check --skip-docker # Pular verificacao de Docker

lojas-orion setup

lojas-orion setup                    # Setup interativo
lojas-orion setup -d ~/projects/dpsp # Especificar diretorio
lojas-orion setup --skip-clone       # Apenas configurar credenciais
lojas-orion setup --skip-infra       # Nao iniciar Docker
lojas-orion setup -f                 # Forcar reconfiguracao

lojas-orion up

lojas-orion up              # Infra basica (postgres, redis, adminer)
lojas-orion up --infra      # Apenas infraestrutura
lojas-orion up --services   # Apenas servicos Java (auth, mdm, bff)
lojas-orion up --all        # Todos os servicos
lojas-orion up auth mdm     # Servicos especificos
lojas-orion up -b           # Rebuild das imagens
lojas-orion up -f           # Forcar recriacao dos containers

lojas-orion down

lojas-orion down           # Parar servicos
lojas-orion down -v        # Parar e remover volumes (APAGA DADOS!)
lojas-orion down -f        # Sem confirmacao

lojas-orion logs

lojas-orion logs           # Menu interativo
lojas-orion logs auth      # Logs do Auth Service
lojas-orion logs auth -f   # Seguir logs em tempo real
lojas-orion logs auth -n 50 # Ultimas 50 linhas
lojas-orion logs auth -t   # Com timestamps

lojas-orion migrate

lojas-orion migrate            # Todas as migrations
lojas-orion migrate -s auth    # Apenas Auth Service
lojas-orion migrate --info     # Ver info sem executar
lojas-orion migrate --repair   # Reparar tabela de migrations
lojas-orion migrate --clean    # Limpar schemas (CUIDADO!)

lojas-orion update

lojas-orion update                 # Atualizar repositorios
lojas-orion update --rebase        # Usar rebase ao inves de merge
lojas-orion update --checkout-develop  # Mudar para branch develop

lojas-orion config

lojas-orion config           # Listar configuracoes
lojas-orion config list      # Listar configuracoes
lojas-orion config set       # Alterar configuracao
lojas-orion config path      # Mostrar caminho do arquivo
lojas-orion config reset     # Resetar tudo

Repositorios do Projeto

| Repositorio | Descricao | |-------------|-----------| | lojas-orion-auth | Servico de autenticacao (JWT, RBAC) | | lojas-orion-backoffice-bff | Backend for Frontend | | lojas-orion-backoffice-mdm | Master Data Management | | lojas-orion-backoffice-admin | Administracao do backoffice | | lojas-orion-backoffice-analytics | Analiticos e dashboards | | lojas-orion-backoffice-inventory | Gestao de estoque | | lojas-orion-backoffice-frontend | Frontend React | | lojas-orion-backoffice-infra | Docker Compose e infraestrutura |


Servicos Disponiveis

Infraestrutura

| Servico | Container | Porta | URL | |---------|-----------|-------|-----| | PostgreSQL | lojas-orion-postgres | 5632 | - | | Redis | lojas-orion-redis | 6379 | - | | Adminer | lojas-orion-adminer | 8098 | http://localhost:8098 |

Servicos Java

| Servico | Container | Porta | Swagger | |---------|-----------|-------|---------| | Auth | lojas-orion-auth | 8091 | http://localhost:8091/lojas-orion-auth/swagger-ui.html | | MDM | lojas-orion-mdm | 8093 | http://localhost:8093/backoffice/mdm/swagger-ui.html | | BFF | lojas-orion-bff | 8090 | http://localhost:8090/backoffice/bff/swagger-ui.html |


Configuracao

As configuracoes sao salvas de forma segura e persistente:

  • Windows: %APPDATA%/lojas-orion-cli-nodejs/Config/
  • Mac: ~/Library/Preferences/lojas-orion-cli-nodejs/
  • Linux: ~/.config/lojas-orion-cli-nodejs/

Use lojas-orion config path para ver o caminho exato.


Troubleshooting

Token GitLab invalido no setup

lojas-orion setup
Error: Token invalido (HTTP 401)

Solucao:

  1. Acesse https://gitlab.com/-/user_settings/personal_access_tokens
  2. Gere um novo token com scopes: read_repository, write_repository, read_api
  3. Execute lojas-orion setup -f novamente

Docker nao esta rodando

lojas-orion up
Error: Docker nao esta rodando

Solucao:

  • Windows/Mac: Inicie o Docker Desktop
  • Linux: Execute sudo systemctl start docker

Docker: "A specified logon session does not exist" (Windows)

error during connect: Get "...": open //./pipe/dockerDesktopLinuxEngine:
A specified logon session does not exist.

Causa: Problema com o credential store do Docker no Windows.

Solucao: O CLI corrige isso automaticamente. Se persistir:

# 1. Editar config do Docker
notepad $env:USERPROFILE\.docker\config.json

# 2. Remover a linha "credsStore" e salvar

# 3. Reiniciar Docker Desktop

Docker: Containers nao iniciam no Windows

Verifique:

  1. Docker Desktop esta rodando (icone na bandeja do sistema)
  2. Esta no modo Linux Containers (clicar direito no icone > "Switch to Linux containers")
  3. WSL2 esta habilitado (Settings > General > "Use WSL 2 based engine")

Se nada funcionar:

# Reiniciar servico Docker completamente
wsl --shutdown
# Fechar Docker Desktop
# Reabrir Docker Desktop

Java nao encontrado

lojas-orion check
x Java nao encontrado

Solucao:

  • Windows: winget install EclipseAdoptium.Temurin.21.JDK
  • Mac: brew install openjdk@21
  • Linux: sdk install java 21-tem (via SDKMAN)

Desenvolvimento

Build local

# Clonar repositorio
git clone https://gitlab.com/grupo-dpsp/torre-lojas/orion-pdv/lojas-orion-cli.git

# Instalar dependencias
cd lojas-orion-cli
npm install

# Linkar globalmente para testes
npm link

# Testar
lojas-orion --version

Publicar nova versao

# Patch (2.0.0 -> 2.0.1)
./scripts/publish.sh patch

# Minor (2.0.0 -> 2.1.0)
./scripts/publish.sh minor

# Major (2.0.0 -> 3.0.0)
./scripts/publish.sh major

Autor

Wilher Teixeira - [email protected]


Links Uteis