npm package: @santi_padi/anita-cli
Description: ANITA - Developer CLI for automating workflows
Author: santi_padi
Latest version: 0.1.1

```
     _    _   _ ___ _____  _
    / \  | \ | |_ _|_   _|/ \
   / _ \ |  \| || |  | | / _ \
  / ___ \| |\  || |  | |/ ___ \
 /_/   \_\_| \_|___| |_/_/   \_\
```

# ANITA CLI

![Node >= 20](https://img.shields.io/badge/node-%3E%3D20-brightgreen)
![TypeScript](https://img.shields.io/badge/TypeScript-5.5-blue)
![Internal Only](https://img.shields.io/badge/access-internal--only-red)

**ANITA** is an internal developer CLI tool built with **Node.js + Ink (React for the terminal)** that automates developer workflows: deployments, repository management, auth setup, GitHub operations, code validation, bug fixes, Slack monitoring, and more.

---

## Quick Start

```bash
# Install globally
npm install -g @internal/ANITA

# Set up authentication
bd auth setup

# See all commands
bd --help
```

---

## Commands

| Command | Description |
|---|---|
| `bd deploy` | Deploy a service to target environment |
| `bd repos` | List and manage organization repositories |
| `bd auth setup` | Set up authentication tokens |
| `bd github` | GitHub operations: PRs, issues, actions |
| `bd validate` | Run code validation: type-check, lint, tests |
| `bd fix` | LLM-powered bug fixer |
| `bd slack` | Slack operations: resume, watch, send |
| `bd logs` | Live-tail logs from a service |
| `bd ai` | Interactive AI chat powered by Claude |

### Examples

```bash
# Deploy to staging
bd deploy --env staging --service api

# List repos for an org
bd repos --org myorg

# Summarize missed Slack messages
bd slack --action resume --channel general

# Watch Slack for keywords
bd slack --action watch

# Run validation with auto-fix
bd validate --fix

# AI-powered bug fix
bd fix --file src/broken.ts

# Interactive AI chat
bd ai "explain this error"

# Live log tailing
bd logs --service api --env staging
```

---

## Configuration

Create a `.ANITArc.json` in your project root:

```json
{
  "githubOrg": "your-org",
  "defaultEnv": "staging",
  "slackWatchChannels": ["C01XXXXXX"],
  "slackKeywords": ["urgent", "blocker", "outage"],
  "llmModel": "claude-sonnet-4-20250514",
  "llmMaxTokens": 4096,
  "validatePaths": ["src/"],
  "deployTargets": {
    "api": {
      "url": "https://deploy.example.com/api",
      "headers": { "Authorization": "Bearer YOUR_KEY" }
    }
  },
  "logs": {
    "endpoint": "https://logs.example.com/tail",
    "filters": ["level:error"],
    "maxLines": 1000
  }
}
```

Supported config file formats: `.ANITArc`, `.ANITArc.json`, `.ANITArc.yaml`, `ANITA.config.ts`, `ANITA.config.js`

---

## Contributing: Adding a New Command

ANITA is designed to be infinitely extensible. To add a new command:

1. Create a folder: `src/commands/<your-command>/`
2. Create files:
   - `command.ts` — Clipanion command class
   - `index.tsx` — Ink UI component
   - `<name>.service.ts` — Business logic
   - `<name>.types.ts` — TypeScript types
   - `<name>.test.ts` — Tests
3. Register in `src/commands/registry.ts` — import and add to the `COMMANDS` array

### Architecture

```
src/
├── bin.tsx              # Entry point
├── commands/            # Each command = 1 folder
│   └── <name>/
│       ├── command.ts   # Clipanion definition
│       ├── index.tsx    # Ink UI
│       └── *.service.ts # Business logic
├── components/          # Reusable Ink components
├── hooks/               # React hooks for services
├── services/            # Shared API clients
├── config/              # Configuration loading
├── types/               # Shared type definitions
└── utils/               # Utilities (env, errors, logger)
```

**Key patterns:**
- **Services** are plain functions, framework-agnostic, throw domain errors
- **Hooks** bridge services and UI, manage loading/error/data state
- **Components** are pure presentational, never call services directly
- **Commands** wire everything together with Clipanion + Ink

---

## Development

```bash
# Install dependencies
npm install

# Development mode (watch)
npm run dev

# Build
npm run build

# Run tests
npm test

# Type-check
npm run typecheck

# Lint
npm run lint
```

---

## Tech Stack

- **CLI Framework:** Ink 5 + Clipanion 4
- **Language:** TypeScript 5.5+
- **Runtime:** Node.js >= 20
- **Build:** tsup
- **HTTP:** ky
- **GitHub:** Octokit
- **Slack:** @slack/web-api + @slack/socket-mode
- **LLM:** Anthropic Claude SDK
- **Secrets:** keytar (OS keychain)
- **Testing:** Vitest
- **Validation:** Zod