feat(cli): add cobra-based CLI with subcommands

Replace simple argument parsing with cobra to provide better CLI experience:

- Add 'execute' subcommand for running TypeScript files
- Add 'types' subcommand for printing TypeScript type declarations
- Add help text and error handling
- Update documentation with new usage examples

Add dependencies: github.com/spf13/cobra, github.com/spf13/pflag
This commit is contained in:
2026-01-29 20:07:35 -05:00
parent ccbe9cd7bf
commit 23730868b8
5 changed files with 73 additions and 25 deletions

View File

@@ -48,6 +48,12 @@ The project is cleanly separated into three packages:
go build ./cmd/poiesis
```
## CLI Options
- `[file]` - Path to TypeScript file to execute (optional)
- `--print-types` - Print TypeScript type declarations for all registered functions
- `--help` - Show help information
## Testing
```bash
@@ -58,8 +64,9 @@ golangci-lint run
## Usage
```bash
poiesis <typescript-file>
poiesis -print-types
poiesis execute [file] # Run TypeScript file
poiesis types # Print TypeScript type declarations
poiesis --help # Show help
```
## Function System