@aether-baas/cli
v3.2.0
Published
CLI oficial para gerenciar projetos Aether - Enterprise Ready com CI/CD
Readme
@aether-baas/cli
CLI oficial para gerenciar projetos Aether - Enterprise Ready com CI/CD
🚀 Instalação
# Instalação global
npm install -g @aether-baas/cli
# Ou via npx (sem instalação)
npx @aether-baas/cli <comando>📋 Comandos
Autenticação
# Login interativo
aether login
# Ver status da sessão
aether whoami
# Logout
aether logoutProjetos
# Vincular pasta a um projeto
aether link
# Ver configuração atual
aether config --show
# Configurar API URL (opcional)
aether config --api-url https://api.aether.appFunctions
# Fazer deploy de todas as functions
aether deploy
# Deploy em paralelo (mais rápido)
aether deploy --parallel
# Listar functions do projeto
aether list
# Ver logs
aether logs
# Executar function manualmente
aether invoke <nome-da-function>
# Deletar function
aether delete <nome-da-function>🔐 CI/CD (GitHub Actions, GitLab, etc.)
O CLI suporta autenticação via Service API Key para pipelines automatizados:
# .github/workflows/deploy.yml
name: Deploy Aether Functions
on:
push:
branches: [main]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Deploy to Aether
env:
AETHER_SERVICE_KEY: ${{ secrets.AETHER_SERVICE_KEY }}
AETHER_PROJECT_ID: ${{ secrets.AETHER_PROJECT_ID }}
run: npx @aether-baas/cli deployVariáveis de Ambiente
| Variável | Descrição |
|----------|-----------|
| AETHER_SERVICE_KEY | API Key do projeto (substitui login) |
| AETHER_PROJECT_ID | ID do projeto (substitui aether.json) |
| AETHER_API_URL | URL da API (opcional) |
📁 Estrutura do Projeto
my-project/
├── aether.json # Configuração do projeto
├── functions/ # Pasta das functions
│ ├── onNewUser.ts
│ ├── sendEmail.ts
│ └── processPayment.ts
└── ...aether.json
{
"projectId": "seu-project-id",
"functions": "functions"
}🔧 Configuração
Prioridade de Autenticação
AETHER_SERVICE_KEY(env var) - CI/CDAETHER_ACCESS_TOKEN(env var)- Token salvo via
aether login
Prioridade de Project ID
AETHER_PROJECT_ID(env var) - CI/CDaether.jsonna pasta atual- Projeto linkado via
aether link - Config global do CLI
📝 Exemplo de Function
// functions/onNewUser.ts
export default async function(context: AetherContext) {
const { data, db, push } = context;
// Salvar no banco
await db.collection('welcome_emails').create({
userId: data.userId,
sentAt: new Date()
});
// Enviar push notification
await push.send({
to: data.userId,
title: 'Bem-vindo!',
body: 'Obrigado por se cadastrar'
});
return { success: true };
}🆘 Suporte
📄 Licença
ISC © Aether BaaS
