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:
11
README.md
11
README.md
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user