npm package: @involvex/dis-cli
Description: A CLI for Discord
Author: involvex
Latest version: 0.0.4

# Involvex Discord CLI

A compact, terminal-first Discord client built with Bun, React (Ink), and Giggles. It provides a TUI for quick interactions with Discord, supports OAuth2 and QR login flows, and focuses on a lightweight, developer-friendly experience.

> [!note]
> This project targets Bun as the runtime. If you don't have Bun installed, see https://bun.sh for installation instructions.

## Highlights

- Terminal UI using React + Ink
- Discord integration via `discord.js` and `@discordjs/*` libraries
- OAuth2 + QR-code login support
- Fast developer loop with `bun run dev`

## Quick Start

Prerequisites

- Bun (recommended)
- Node toolchain only if Bun is unavailable (this repo is configured for Bun)

Install dependencies

```bash
bun install
```

Run in development (watch)

```bash
bun run dev
```

Build

```bash
bun run build
```

Run the built CLI

```bash
bun run start
```

Formatting, linting, and typecheck

```bash
bun run format
bun run lint
bun run lint:fix
bun run typecheck
```

## Authentication

The app uses OAuth2 for authentication and includes utilities for QR-code login. Look at the authentication helpers in the `src/auth/` folder to see login flow details.

## Project Structure

- [src/index.tsx](src/index.tsx) — App entry and menu
- [src/commands/](src/commands/) — CLI command screens (login, message, help, about, version)
- [src/services/discordClient.ts](src/services/discordClient.ts) — Discord client wrapper and lifecycle
- [src/config/loader.ts](src/config/loader.ts) — Configuration persistence
- [src/hooks/useDiscordState.ts](src/hooks/useDiscordState.ts) — App state helpers and authentication hooks
- [src/components/](src/components/) — Reusable TUI components (QR code, menu, select input)

## Key Scripts

Taken from `package.json`:

- `bun run dev` — development (watch) mode
- `bun run build` — build the CLI to `dist/`
- `bun run start` — run the built CLI
- `bun run format` — format code with Prettier
- `bun run lint` / `bun run lint:fix` — ESLint checks and auto-fix
- `bun run typecheck` — TypeScript check

## Where to look first

- App bootstrap: [src/index.tsx](src/index.tsx)
- Discord integration: [src/services/discordClient.ts](src/services/discordClient.ts)
- Auth + token management: [src/auth/](src/auth)

## Development notes

- Use the `StateProvider` and `useDiscordState` hook for accessing auth and user state in components.
- Keep TUI components small and focused to leverage Ink's rendering performance.
- When adding commands/screens, place them under `src/commands/` and wire into `src/index.tsx`.

## Security and credentials

Store secrets (Discord client ID/secret, redirect URIs) in environment variables or in a local config managed by `src/config/loader.ts`. Do NOT commit secrets to the repository.

## Next steps

- Add tests and CI for lint/typecheck/build steps
- Add more UI screens (server list, channel browser, message history)

---

If you'd like, I can now:

- commit `README.md` to a branch, or
- run `bun run dev` to verify the dev server (if Bun is installed), or
- expand sections (installation, architecture diagram, examples).

Tell me which you'd prefer.