diff --git a/cli/.cursor/rules/global.mdc b/cli/.cursor/rules/global.mdc new file mode 100644 index 000000000..231a78757 --- /dev/null +++ b/cli/.cursor/rules/global.mdc @@ -0,0 +1,39 @@ +--- +description: +globs: +alwaysApply: true +--- +# CLAUDE.md + +This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository. + +## Build Commands +- Build: `cargo build` +- Release build: `cargo build --release` +- Run tests: `cargo test` +- Run specific test: `cargo test test_name` +- Run tests in file: `cargo test --test filename` +- Run package tests: `cargo test -p ` +- Format: `cargo fmt` +- Lint: `cargo clippy` + +## Code Style Guidelines +- **Imports**: Group by std, external crates, internal modules; alphabetical order +- **Formatting**: 4-space indentation (standard Rust) +- **Error Handling**: Use `thiserror` for error types, `anyhow` for general propagation +- **Naming**: Follow Rust conventions (`snake_case` for variables/functions, `PascalCase` for types) +- **Types**: Define custom error types with descriptive messages +- **Dependencies**: Use workspace dependencies with `{ workspace = true }` +- **Testing**: Place in separate `/tests` directory; use `tempfile` for test directories +- **Never log secrets or sensitive data** + +## Project Info +- CLI for managing semantic models in Buster +- Uses semantic versioning (PR title conventions for bumps) + - Major: PR title with "BREAKING CHANGE" or "major", or PR with "major" label + - Minor: PR title with "feat", "feature", or "minor", or PR with "minor" label + - Patch: Default for all other PRs +- Cross-project references supported +- Config defined in `buster.yml` +- File and tag exclusions for deployment +- Row limit of 5000 is enforced for database queries by default \ No newline at end of file diff --git a/cli/.gitignore b/cli/.gitignore index 0386d1060..6e288a039 100644 --- a/cli/.gitignore +++ b/cli/.gitignore @@ -13,8 +13,7 @@ Cargo.lock # MSVC Windows builds of rustc generate these, which store debugging information *.pdb -Makefile .vscode/ -/prds +/prds/completed diff --git a/cli/Makefile b/cli/Makefile new file mode 100644 index 000000000..08514cacb --- /dev/null +++ b/cli/Makefile @@ -0,0 +1,9 @@ +install: build + mkdir -p $(HOME)/.local/bin + cp cli/target/release/buster-cli $(HOME)/.local/bin/buster-local + grep -q '/.local/bin' $(HOME)/.zshrc || echo 'export PATH="$$HOME/.local/bin:$$PATH"' >> $(HOME)/.zshrc + @echo "Run 'source ~/.zshrc' to update your current shell" + +build: + cargo build --release -p buster-cli +