Skip to content

Commit 20e7360

Browse files
committed
chore: initial project setup — README and CI/CD workflows
0 parents  commit 20e7360

5 files changed

Lines changed: 277 additions & 0 deletions

File tree

.gitattributes

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
* text=auto eol=lf

.github/workflows/ci.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- '**'
7+
pull_request:
8+
branches:
9+
- develop
10+
- main
11+
12+
permissions:
13+
contents: read
14+
15+
env:
16+
CARGO_TERM_COLOR: always
17+
18+
jobs:
19+
check:
20+
name: Check, Test & Clippy
21+
runs-on: ubuntu-latest
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Install Rust toolchain
26+
uses: dtolnay/rust-toolchain@stable
27+
28+
- name: Cache cargo registry
29+
uses: actions/cache@v4
30+
with:
31+
path: ~/.cargo/registry
32+
key: ${{ runner.os }}-cargo-registry-${{ hashFiles('**/Cargo.lock') }}
33+
34+
- name: Cache cargo index
35+
uses: actions/cache@v4
36+
with:
37+
path: ~/.cargo/git
38+
key: ${{ runner.os }}-cargo-index-${{ hashFiles('**/Cargo.lock') }}
39+
40+
- name: Cache cargo build
41+
uses: actions/cache@v4
42+
with:
43+
path: target
44+
key: ${{ runner.os }}-cargo-build-target-${{ hashFiles('**/Cargo.lock') }}
45+
46+
- name: Cargo fmt
47+
run: cargo fmt --check
48+
49+
- name: Cargo clippy
50+
run: cargo clippy --all-targets -- -D warnings
51+
52+
- name: Cargo test
53+
run: cargo test

.github/workflows/release.yml

Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
permissions:
9+
contents: write
10+
11+
env:
12+
CARGO_TERM_COLOR: always
13+
14+
jobs:
15+
build:
16+
name: Build ${{ matrix.target }}
17+
runs-on: ${{ matrix.os }}
18+
strategy:
19+
fail-fast: false
20+
matrix:
21+
include:
22+
- target: x86_64-unknown-linux-musl
23+
os: ubuntu-latest
24+
archive: tar.gz
25+
use_cross: true
26+
- target: aarch64-unknown-linux-musl
27+
os: ubuntu-latest
28+
archive: tar.gz
29+
use_cross: true
30+
- target: x86_64-apple-darwin
31+
os: macos-latest
32+
archive: tar.gz
33+
use_cross: false
34+
- target: aarch64-apple-darwin
35+
os: macos-latest
36+
archive: tar.gz
37+
use_cross: false
38+
- target: x86_64-pc-windows-msvc
39+
os: windows-latest
40+
archive: zip
41+
use_cross: false
42+
43+
steps:
44+
- uses: actions/checkout@v4
45+
46+
- name: Install Rust toolchain
47+
uses: dtolnay/rust-toolchain@stable
48+
with:
49+
targets: ${{ matrix.target }}
50+
51+
- name: Install cross
52+
if: matrix.use_cross == true
53+
run: cargo install cross --locked
54+
55+
- name: Build release binary (cross)
56+
if: matrix.use_cross == true
57+
run: cross build --release --target ${{ matrix.target }}
58+
59+
- name: Build release binary
60+
if: matrix.use_cross == false
61+
run: cargo build --release --target ${{ matrix.target }}
62+
63+
- name: Package (unix)
64+
if: matrix.archive == 'tar.gz'
65+
run: |
66+
cd target/${{ matrix.target }}/release
67+
tar czf ../../../gitkit-${{ github.ref_name }}-${{ matrix.target }}.tar.gz gitkit
68+
cd ../../..
69+
70+
- name: Package (windows)
71+
if: matrix.archive == 'zip'
72+
shell: pwsh
73+
run: |
74+
cd target/${{ matrix.target }}/release
75+
Compress-Archive -Path gitkit.exe -DestinationPath ../../../gitkit-${{ github.ref_name }}-${{ matrix.target }}.zip
76+
cd ../../..
77+
78+
- name: Upload artifact
79+
uses: actions/upload-artifact@v4
80+
with:
81+
name: gitkit-${{ matrix.target }}
82+
path: gitkit-${{ github.ref_name }}-${{ matrix.target }}.*
83+
84+
github-release:
85+
name: Create GitHub Release
86+
needs: build
87+
runs-on: ubuntu-latest
88+
steps:
89+
- uses: actions/checkout@v4
90+
91+
- name: Download all artifacts
92+
uses: actions/download-artifact@v4
93+
with:
94+
path: artifacts
95+
merge-multiple: true
96+
97+
- name: Create release
98+
uses: softprops/action-gh-release@v2
99+
with:
100+
tag_name: ${{ github.ref_name }}
101+
generate_release_notes: true
102+
files: artifacts/*

.gitignore

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
/target
2+
Cargo.lock
3+
*.swp
4+
*.swo
5+
*~
6+
.DS_Store
7+
.env
8+
.vscode/
9+
.idea/
10+
*.log
11+
.kiro/
12+
.agents/
13+
.idea/
14+
skills-lock.json

README.md

Lines changed: 107 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,107 @@
1+
# gitkit
2+
3+
[![CI](https://github.com/JheisonMB/gitkit/actions/workflows/ci.yml/badge.svg)](https://github.com/JheisonMB/gitkit/actions/workflows/ci.yml)
4+
[![Release](https://github.com/JheisonMB/gitkit/actions/workflows/release.yml/badge.svg)](https://github.com/JheisonMB/gitkit/actions/workflows/release.yml)
5+
[![Crates.io](https://img.shields.io/crates/v/gitkit)](https://crates.io/crates/gitkit)
6+
[![License: MIT](https://img.shields.io/badge/license-MIT-blue.svg)](LICENSE)
7+
8+
Standalone CLI for configuring git repos — hooks, .gitignore, and .gitattributes. No Node.js, no Python, no runtime dependencies. One binary.
9+
10+
---
11+
12+
## Installation
13+
14+
### Quick install (recommended)
15+
16+
**Linux / macOS:**
17+
18+
```bash
19+
curl -fsSL https://raw.githubusercontent.com/JheisonMB/gitkit/main/install.sh | sh
20+
```
21+
22+
### Via cargo
23+
24+
```bash
25+
cargo install gitkit
26+
```
27+
28+
### GitHub Releases
29+
30+
Check the [Releases](https://github.com/JheisonMB/gitkit/releases) page for precompiled binaries (Linux x86_64, macOS x86_64/ARM64, Windows x86_64).
31+
32+
### Uninstall
33+
34+
```bash
35+
rm -f ~/.local/bin/gitkit
36+
```
37+
38+
---
39+
40+
## Quick Start
41+
42+
```bash
43+
# Install a built-in hook
44+
gitkit hooks init commit-msg conventional-commits
45+
46+
# Install a custom hook command
47+
gitkit hooks init pre-push "cargo test"
48+
49+
# List installed hooks
50+
gitkit hooks list
51+
52+
# Generate a .gitignore
53+
gitkit ignore add rust macos
54+
55+
# Apply line endings preset
56+
gitkit attributes init
57+
```
58+
59+
---
60+
61+
## Commands
62+
63+
| Command | Description |
64+
|---|---|
65+
| `gitkit hooks init <hook> <builtin\|command>` | Install a hook (built-in or custom command) |
66+
| `gitkit hooks list` | List installed hooks |
67+
| `gitkit hooks remove <hook>` | Remove a hook |
68+
| `gitkit hooks show <hook>` | Show hook content |
69+
| `gitkit ignore add <templates>` | Generate .gitignore via gitignore.io |
70+
| `gitkit ignore list` | List available templates |
71+
| `gitkit attributes init` | Apply line endings preset |
72+
73+
---
74+
75+
## Built-in Hooks
76+
77+
| Name | Hook | Description |
78+
|---|---|---|
79+
| `conventional-commits` | `commit-msg` | Validates Conventional Commits format |
80+
| `no-secrets` | `pre-commit` | Detects common secret patterns |
81+
| `branch-naming` | `pre-commit` | Validates branch name pattern |
82+
83+
---
84+
85+
## Global Flags
86+
87+
| Flag | Description |
88+
|---|---|
89+
| `--yes`, `-y` | Skip confirmation prompts |
90+
| `--force`, `-f` | Overwrite existing files |
91+
| `--dry-run` | Preview changes without applying |
92+
93+
---
94+
95+
## Tech Stack
96+
97+
| Concern | Crate |
98+
|---|---|
99+
| CLI parsing | `clap` (derive) |
100+
| Error handling | `anyhow` |
101+
| HTTP client | `ureq` |
102+
103+
---
104+
105+
## License
106+
107+
MIT

0 commit comments

Comments
 (0)