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

@brabos-ai/fnd-cli

v1.6.1

Published

CLI para download e atualização de templates FND

Readme

FND CLI

CLI para gerenciamento de templates FND com autenticação por device fingerprint.

Instalação

npm install -g @brabos-ai/fnd-cli

Comandos

fnd login

Autentica no sistema FND usando OTP (One-Time Password).

Funcionamento:

  1. Coleta fingerprint do dispositivo (hostname, username, MAC address, hardware ID)
  2. Hash do fingerprint localmente (SHA256)
  3. Envia OTP para o email cadastrado
  4. Valida OTP e recebe token JWT
  5. Armazena token e fingerprint em ~/.fnd/config.json

Exemplo:

$ fnd login
🔐 FND CLI - Autenticação

Coletando informações do dispositivo...
Dispositivo identificado:
  Hostname: DESKTOP-ABC123
  Usuário: joao
  Fingerprint: a1b2c3d4e5f6g7h8...

Email cadastrado: [email protected]
✓ Código enviado para seu email!

Digite o código OTP recebido: 123456

✓ Autenticação realizada com sucesso!
Dispositivo: DESKTOP-ABC123
Válido até: 18/12/2025 10:30:00

fnd checkout <type>

Baixa um template FND para o diretório atual.

Argumentos:

  • <type>: Tipo do template (ex: easyflow)

Opções:

  • -v, --version <version>: Versão específica (padrão: latest)

Exemplo:

$ fnd checkout easyflow
📥 FND CLI - Baixar Template

Template: easyflow
Versão: latest

Baixando template...
Versão disponível: v1.2.0
Extraindo arquivos...

✓ Template easyflow v1.2.0 baixado com sucesso!

Arquivos extraídos: 42

Próximos passos:
  1. Revise os arquivos do template
  2. Configure suas variáveis de ambiente
  3. Execute: npm install
  4. Para atualizar futuramente: fnd update

fnd update

Atualiza o template para a versão mais recente.

Pré-requisitos:

  • Estar em um diretório com template FND (arquivo .fnd-version presente)
  • Ter um repositório Git inicializado

Funcionamento:

  1. Valida autenticação e fingerprint
  2. Busca versão atual do arquivo .fnd-version
  3. Baixa manifest mais recente do backend
  4. Compara com manifest local (ou gera a partir dos arquivos)
  5. Cria branch update/v-X-Y-Z
  6. Aplica mudanças (adiciona/remove/atualiza arquivos)
  7. Cria commit estruturado

Exemplo:

$ fnd update
📦 FND CLI - Atualizar Template

Template atual: easyflow v1.2.0
Verificando atualizações...

Nova versão disponível: v1.3.0

Mudanças detectadas:
  + 3 arquivo(s) adicionado(s)
  - 1 arquivo(s) removido(s)
  ~ 5 arquivo(s) atualizado(s)

Criando branch: update/v-1-3-0...
Baixando arquivos atualizados...
  + docs/new-feature.md
  + src/utils/helper.ts
  + tests/helper.test.ts
  - deprecated/old-file.ts
  ~ src/index.ts
  ~ package.json
  ~ README.md
  ~ apps/backend/src/main.ts
  ~ apps/frontend/src/App.tsx

Criando commit...

✓ Template atualizado para v1.3.0!
Branch: update/v-1-3-0

Revisione as mudanças e faça merge quando estiver pronto.

Arquivos de Configuração

~/.fnd/config.json

Armazena credenciais de autenticação:

{
  "token": "eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9...",
  "deviceFingerprint": "a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6...",
  "email": "[email protected]"
}

.fnd-version

Armazena informações da versão do template no projeto:

{
  "templateType": "easyflow",
  "version": "1.2.0",
  "downloadedAt": "2025-12-18T10:30:00.000Z"
}

.fnd-manifest.json

Armazena manifest dos arquivos do template:

{
  "version": "1.2.0",
  "files": [
    {
      "path": "docs/plan.md",
      "hash": "abc123...",
      "size": 1024
    }
  ]
}

Segurança

Device Fingerprint

O CLI coleta as seguintes informações para criar o fingerprint do dispositivo:

  • Hostname: Nome do computador
  • Username: Nome do usuário do sistema
  • MAC Address: Endereço MAC da primeira interface de rede não-interna
  • Hardware ID:
    • Windows: Serial da placa-mãe (via WMIC)
    • macOS: Hardware UUID (via system_profiler)
    • Linux: Machine ID (/etc/machine-id)

O fingerprint é hasheado localmente usando SHA256 antes de ser enviado ao servidor.

Autenticação

  • Token JWT armazenado localmente em ~/.fnd/config.json
  • Token inclui claim do device fingerprint
  • Validação do fingerprint em cada requisição
  • OTP enviado por email com validade de 10 minutos

Rate Limiting

O backend implementa rate limiting para prevenir abuso:

  • Logins: 5 tentativas por hora
  • Downloads: 10 por dia
  • IPs únicos: Máximo 3 dispositivos por dia

Mensagens de erro informam o tempo de espera necessário.

Tratamento de Erros

| Código | Mensagem | Ação | |--------|----------|------| | 401 | "Sessão inválida. Execute fnd login novamente." | Fazer login novamente | | 404 | "Template/Email não encontrado." | Verificar tipo do template ou email | | 429 | "Limite excedido. Tente novamente em X minutos." | Aguardar tempo indicado | | Network | "Erro de conexão. Verifique sua internet." | Verificar conexão |

Variáveis de Ambiente

  • FND_API_URL: URL do backend (padrão: http://localhost:3000)

Desenvolvimento

# Instalar dependências
npm install

# Build
npm run build

# Watch mode
npm run dev

# Type checking
npm run typecheck

# Clean
npm run clean

Dependências

  • commander: Framework CLI
  • axios: Cliente HTTP
  • chalk: Output colorido
  • inquirer: Prompts interativos
  • adm-zip: Extração de arquivos ZIP
  • simple-git: Operações Git
  • crypto (built-in): Hashing SHA256
  • os (built-in): Informações do sistema