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

@grupopll/pll-jenkins

v1.1.0

Published

CLI interativo para gerenciar jobs Jenkins (list/pull/push)

Downloads

19

Readme

pll-jenkins

CLI interativo para gerenciar jobs Jenkins via terminal. Permite baixar (pull) e subir (push) jobs de uma pasta Jenkins diretamente para um repositório git, usando a branch atual como referência automática.


Dependências do sistema

Antes de instalar, certifique-se de ter os seguintes programas disponíveis no PATH:

| Dependência | Motivo | Instalação (Ubuntu/Debian) | |---|---|---| | Java (JRE) | Executa o jenkins-cli.jar | sudo apt install default-jre | | jq | Processa respostas JSON da API Jenkins | sudo apt install jq | | curl | Faz chamadas HTTP nos scripts shell | sudo apt install curl |

O jenkins-cli.jar já vem embutido no pacote — não é necessário baixar separadamente.


Instalação

npm install -g @grupopll/pll-jenkins

Após a instalação, o comando pll-jenkins estará disponível globalmente.


Configuração de credenciais

Na primeira execução de qualquer comando, o CLI irá pedir a URL, usuário e token do Jenkins e salvará automaticamente em ~/.pll-jenkins.json (com permissão restrita 600).

? URL do Jenkins (ex: https://jenkins.exemplo.com): https://seu-jenkins.com
? Usuário Jenkins: seu-usuario
? Token Jenkins: ********

Nas próximas execuções as credenciais são carregadas automaticamente, sem perguntar nada.

O token pode ser gerado em: https://seu-jenkins.com/user/<seu-usuario>/configureAPI Token


Uso

pll-jenkins <comando>

Comandos:
  list    Lista jobs e pastas no Jenkins
  pull    Baixa jobs do Jenkins para o repositório local
  push    Sobe jobs locais de volta para o Jenkins

pll-jenkins list

Lista a árvore de jobs e pastas a partir de uma pasta do Jenkins.

pll-jenkins list
? Pasta inicial (deixe vazio para raiz):

/
├── Meu-Projeto/
│   ├── main/
│   │   ├── [JOB] Auth-Request
│   │   └── [JOB] Pipeline-Deploy
│   └── uat/
│       └── [JOB] Auth-Request
└── Outro-Projeto/
    └── [JOB] Build

pll-jenkins pull

Baixa os jobs de uma pasta Jenkins para dentro do repositório git local, na pasta jenkins/.

cd meu-repo-git   # branch: main
pll-jenkins pull

Primeira execução: abre um seletor interativo para escolher o projeto raiz no Jenkins (ex: Meu-Projeto). A branch git atual é adicionada automaticamente ao caminho (Meu-Projeto/main).

? Selecionar projeto Jenkins:
  > Meu-Projeto/  (entrar)
    [Usar esta pasta]
    Outro-Projeto/  (entrar)

Após a seleção, o arquivo jenkins/.pll-jenkins é criado com o nome do projeto e os jobs são baixados:

meu-repo-git/
└── jenkins/
    ├── .pll-jenkins          ← salvo automaticamente
    ├── Auth-Request/
    │   └── config.xml
    └── Pipeline-Deploy/
        └── config.xml

Execuções seguintes: o projeto é lido automaticamente do jenkins/.pll-jenkins. Basta trocar de branch e rodar novamente:

git checkout uat
pll-jenkins pull   # baixa Meu-Projeto/uat automaticamente

pll-jenkins push

Sobe os jobs da pasta jenkins/ local de volta para o Jenkins, usando a branch atual para determinar o destino.

cd meu-repo-git   # branch: main
pll-jenkins push
Projeto      : Meu-Projeto  (lido de jenkins/.pll-jenkins)
Branch atual : main
Pasta Jenkins: Meu-Projeto/main
Origem local : /home/user/meu-repo-git/jenkins

? Push de "/home/user/meu-repo-git/jenkins" → Jenkins "Meu-Projeto/main". Confirmar? (Y/n)

Se a pasta Meu-Projeto/<branch> não existir no Jenkins, o CLI pergunta se deseja criá-la antes de fazer o push:

A pasta "Meu-Projeto/uat" não existe no Jenkins.
? Criar pasta "Meu-Projeto/uat" no Jenkins? (Y/n)
Criando pasta "Meu-Projeto/uat"...
Pasta criada com sucesso.

Fluxo típico por projeto

# 1. Clone o repositório
git clone [email protected]:sua-empresa/meu-projeto.git
cd meu-projeto

# 2. Baixe os jobs da branch main
pll-jenkins pull

# 3. Edite os config.xml conforme necessário
vim jenkins/Auth-Request/config.xml

# 4. Suba de volta para o Jenkins
pll-jenkins push

# 5. Trabalhe em outra branch
git checkout -b uat
pll-jenkins pull    # baixa Meu-Projeto/uat
pll-jenkins push    # sobe para Meu-Projeto/uat (cria se não existir)

Estrutura do repositório após o pull

meu-repo-git/
└── jenkins/
    ├── .pll-jenkins          ← não commitar (adicione ao .gitignore) ou commitar para fixar o projeto
    ├── NomeDoJob/
    │   └── config.xml
    └── OutroJob/
        └── config.xml

Dica: adicione jenkins/.pll-jenkins ao .gitignore se diferentes desenvolvedores usarem projetos Jenkins distintos, ou commite o arquivo para fixar o projeto para todo o time.


Credenciais salvas

| Arquivo | Conteúdo | |---|---| | ~/.pll-jenkins.json | { "url": "...", "user": "...", "token": "..." } |

Para redefinir as credenciais, apague o arquivo:

rm ~/.pll-jenkins.json

Solução de problemas

| Erro | Causa | Solução | |---|---|---| | Credenciais inválidas (401) | Token expirado ou incorreto | Gere um novo token no Jenkins e apague ~/.pll-jenkins.json | | Pasta não encontrada (404) | Pasta não existe no Jenkins | Verifique o nome ou use pll-jenkins list | | java: command not found | Java não instalado | sudo apt install default-jre | | jq: command not found | jq não instalado | sudo apt install jq | | jenkins/.pll-jenkins não encontrado | Pull ainda não foi feito | Execute pll-jenkins pull primeiro | | Não está em um repositório git | Pasta sem git | Execute dentro de um repositório git |