Prerequisites
- Rust: Install via rustup
- Node.js: Version 18 or higher
- pnpm: This project uses
pnpmfor Node.js package management
Package Manager: Use
pnpm instead of npm for all Node.js operations in this repository.Quick Start
Development Build
Build the CLI in development mode:target/debug/gws.
Run Without Installing
You can run the CLI directly without installing:-- is passed to the gws binary.
Install Locally
Install from source to makegws available system-wide:
~/.cargo/bin/gws (ensure ~/.cargo/bin is in your PATH).
Linting
Run Clippy with strict warnings:Build Artifacts
Debug Builds
Development builds are unoptimized for faster compilation:- Output:
target/debug/gws - Includes debug symbols
- No optimizations applied
- Fast compilation time
Release Builds
Production builds are optimized for performance:- Output:
target/release/gws - Full optimizations enabled
- Stripped debug symbols
- Slower compilation, faster runtime
Distribution Builds
The project includes a custom profile forcargo-dist:
- Inherits from
releaseprofile - Applies thin LTO (Link-Time Optimization)
- Used for npm package distribution
Project Structure
Rust Workspace
The project is configured inCargo.toml:
npm Package
The npm package wraps the Rust binary and is configured inpackage.json:
Local Development Setup
1. Clone the Repository
2. Install Dependencies
@changesets/clifor version managementlefthookfor git hooks
3. Build the CLI
4. Authenticate
Set up authentication for testing:5. Test a Command
Development Workflow
Make Changes
- Edit source files in
src/ - Run
cargo buildto compile - Test changes with
cargo run -- <command>
Check for Errors
Format Code
Working with Dependencies
Add a Dependency
Update Dependencies
Check for Outdated Crates
Troubleshooting
Build Fails with Missing Dependencies
Ensure you have the latest Rust toolchain:Linker Errors on macOS
Install Xcode Command Line Tools:Linker Errors on Linux
Install build essentials:Environment Variables
During development, you can use a.env file for configuration:
.env files automatically via dotenvy.
Next Steps
- Learn how to write and run tests: Testing
- Understand contribution requirements: Contributing
- Explore the architecture: Architecture