2025-02-06 05:05:12 +08:00
|
|
|
# Buster CLI
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
The official command-line interface for Buster, built with TypeScript, Commander.js, and Ink for a beautiful terminal experience.
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
## Architecture
|
2025-02-06 05:05:12 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
This CLI is designed as a thin client that communicates with the Buster server API. It handles:
|
|
|
|
- File system operations (reading/writing YAML files)
|
|
|
|
- API communication
|
|
|
|
- Rich terminal UI using Ink (React for CLI)
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
## Development
|
2025-02-13 05:08:01 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
### Setup
|
2025-02-13 01:00:26 +08:00
|
|
|
|
|
|
|
```bash
|
2025-08-05 06:16:00 +08:00
|
|
|
# Install dependencies
|
|
|
|
pnpm install
|
2025-02-13 01:00:26 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
# Run in development mode
|
|
|
|
pnpm dev
|
2025-02-13 05:08:01 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
# Build the CLI
|
|
|
|
pnpm build
|
2025-02-13 01:00:26 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
# Run tests
|
|
|
|
pnpm test
|
2025-02-13 01:00:26 +08:00
|
|
|
```
|
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
### Commands
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
- `auth` - Authenticate with Buster
|
|
|
|
- `init` - Initialize a new Buster project
|
|
|
|
- `deploy` - Deploy models to Buster
|
|
|
|
- `parse` - Parse and validate YAML model files
|
|
|
|
- `config` - Manage Buster configuration
|
|
|
|
- `update` - Update CLI to the latest version
|
|
|
|
- `start` - Start Buster services
|
|
|
|
- `stop` - Stop Buster services
|
|
|
|
- `reset` - Reset Buster services and data
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
### Testing
|
2025-02-13 01:00:26 +08:00
|
|
|
|
2025-02-13 05:02:20 +08:00
|
|
|
```bash
|
2025-08-05 06:16:00 +08:00
|
|
|
# Run all tests
|
|
|
|
pnpm test
|
2025-02-13 05:02:20 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
# Run unit tests only
|
|
|
|
pnpm test:unit
|
2025-02-13 05:02:20 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
# Run integration tests
|
|
|
|
pnpm test:integration
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
# Watch mode
|
|
|
|
pnpm test:watch
|
2025-02-13 01:00:26 +08:00
|
|
|
```
|
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
### Building Binaries
|
2025-02-13 01:00:26 +08:00
|
|
|
|
|
|
|
```bash
|
2025-08-05 06:16:00 +08:00
|
|
|
# Build binaries for all platforms
|
|
|
|
pnpm build:binary
|
2025-02-26 03:34:51 +08:00
|
|
|
```
|
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
This creates standalone executables for Linux, macOS, and Windows using Bun's compile feature.
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
## Contributing
|
2024-11-26 02:46:48 +08:00
|
|
|
|
2025-08-05 06:16:00 +08:00
|
|
|
See [CLAUDE.md](./CLAUDE.md) for detailed development guidelines.
|