Skip to content

Commit f8f932d

Browse files
committed
Add improved onboarding and distribution
- Add multiple installation methods: cargo binstall, cargo install, curl script - Add shell completions command (bash/zsh/fish/powershell) - Add interactive `kto init` wizard for first-time setup - Add GitHub Actions release workflow with: - Test job (tests, fmt check, version verification) - Multi-platform builds (linux x64/arm64, macos x64/arm64) - Automatic GitHub releases with checksums - crates.io publishing - Security improvements: - install.sh requires checksum verification - install.sh uses safe tar extraction - Secret prompts use masked input - Update Cargo.toml with crates.io metadata and binstall config - Fix repository URL (devindudeman)
1 parent 88c2bc9 commit f8f932d

8 files changed

Lines changed: 661 additions & 22 deletions

File tree

.github/workflows/release.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
name: Release
2+
3+
on:
4+
push:
5+
tags:
6+
- 'v*'
7+
8+
env:
9+
CARGO_TERM_COLOR: always
10+
11+
jobs:
12+
# Run tests before building release artifacts
13+
test:
14+
name: Test
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Install Rust
20+
uses: dtolnay/rust-action@stable
21+
22+
- name: Run tests
23+
run: cargo test --all-features
24+
25+
- name: Check formatting
26+
run: cargo fmt --check
27+
28+
- name: Verify package
29+
run: cargo package --allow-dirty
30+
31+
- name: Verify version matches tag
32+
run: |
33+
CARGO_VERSION="v$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[0].version')"
34+
if [[ "$CARGO_VERSION" != "${{ github.ref_name }}" ]]; then
35+
echo "Error: Cargo.toml version ($CARGO_VERSION) does not match tag (${{ github.ref_name }})"
36+
exit 1
37+
fi
38+
39+
build:
40+
name: Build ${{ matrix.target }}
41+
needs: test
42+
runs-on: ${{ matrix.os }}
43+
strategy:
44+
fail-fast: false
45+
matrix:
46+
include:
47+
- target: x86_64-unknown-linux-gnu
48+
os: ubuntu-latest
49+
- target: aarch64-unknown-linux-gnu
50+
os: ubuntu-latest
51+
- target: x86_64-apple-darwin
52+
os: macos-latest
53+
- target: aarch64-apple-darwin
54+
os: macos-latest
55+
56+
steps:
57+
- uses: actions/checkout@v4
58+
59+
- name: Install Rust
60+
uses: dtolnay/rust-action@stable
61+
with:
62+
targets: ${{ matrix.target }}
63+
64+
- name: Install cross-compilation tools (Linux ARM)
65+
if: matrix.target == 'aarch64-unknown-linux-gnu'
66+
run: |
67+
sudo apt-get update
68+
sudo apt-get install -y gcc-aarch64-linux-gnu
69+
70+
- name: Build
71+
run: |
72+
if [[ "${{ matrix.target }}" == "aarch64-unknown-linux-gnu" ]]; then
73+
export CARGO_TARGET_AARCH64_UNKNOWN_LINUX_GNU_LINKER=aarch64-linux-gnu-gcc
74+
fi
75+
cargo build --release --features tui --target ${{ matrix.target }}
76+
77+
- name: Package
78+
shell: bash
79+
run: |
80+
cd target/${{ matrix.target }}/release
81+
tar czvf ../../../kto-${{ matrix.target }}.tar.gz kto
82+
cd ../../..
83+
84+
- name: Upload artifact
85+
uses: actions/upload-artifact@v4
86+
with:
87+
name: kto-${{ matrix.target }}
88+
path: kto-${{ matrix.target }}.tar.gz
89+
90+
release:
91+
name: Create Release
92+
needs: build
93+
runs-on: ubuntu-latest
94+
permissions:
95+
contents: write
96+
97+
steps:
98+
- uses: actions/checkout@v4
99+
100+
- name: Download all artifacts
101+
uses: actions/download-artifact@v4
102+
with:
103+
path: artifacts
104+
105+
- name: Prepare release assets
106+
run: |
107+
mkdir -p release
108+
for dir in artifacts/kto-*/; do
109+
cp "$dir"/*.tar.gz release/
110+
done
111+
cd release
112+
sha256sum *.tar.gz > checksums.txt
113+
114+
- name: Create Release
115+
uses: softprops/action-gh-release@v1
116+
with:
117+
files: |
118+
release/*.tar.gz
119+
release/checksums.txt
120+
generate_release_notes: true
121+
env:
122+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
123+
124+
publish-crate:
125+
name: Publish to crates.io
126+
needs: release
127+
runs-on: ubuntu-latest
128+
steps:
129+
- uses: actions/checkout@v4
130+
131+
- name: Install Rust
132+
uses: dtolnay/rust-action@stable
133+
134+
- name: Publish to crates.io
135+
run: cargo publish --token ${{ secrets.CARGO_REGISTRY_TOKEN }}

Cargo.lock

Lines changed: 10 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,31 @@
22
name = "kto"
33
version = "0.1.0"
44
edition = "2021"
5-
description = "A generic, flexible web change watcher"
5+
description = "A generic, flexible web change watcher with AI-powered analysis"
66
license = "MIT"
77
readme = "README.md"
8-
repository = "https://github.com/devinbernosky/kto"
8+
repository = "https://github.com/devindudeman/kto"
9+
homepage = "https://github.com/devindudeman/kto"
10+
keywords = ["web", "monitor", "change-detection", "cli", "ai"]
11+
categories = ["command-line-utilities", "web-programming"]
12+
authors = ["devindudeman"]
13+
14+
[package.metadata.binstall]
15+
pkg-url = "{ repo }/releases/download/v{ version }/{ name }-{ target }.tar.gz"
16+
bin-dir = "{ bin }{ binary-ext }"
17+
pkg-fmt = "tgz"
18+
19+
[package.metadata.binstall.overrides.x86_64-unknown-linux-gnu]
20+
pkg-url = "{ repo }/releases/download/v{ version }/kto-x86_64-unknown-linux-gnu.tar.gz"
21+
22+
[package.metadata.binstall.overrides.aarch64-unknown-linux-gnu]
23+
pkg-url = "{ repo }/releases/download/v{ version }/kto-aarch64-unknown-linux-gnu.tar.gz"
24+
25+
[package.metadata.binstall.overrides.x86_64-apple-darwin]
26+
pkg-url = "{ repo }/releases/download/v{ version }/kto-x86_64-apple-darwin.tar.gz"
27+
28+
[package.metadata.binstall.overrides.aarch64-apple-darwin]
29+
pkg-url = "{ repo }/releases/download/v{ version }/kto-aarch64-apple-darwin.tar.gz"
930

1031
[dependencies]
1132
# HTTP client (blocking, minimal)
@@ -30,6 +51,7 @@ zstd = "0.13"
3051

3152
# CLI
3253
clap = { version = "4", features = ["derive"] }
54+
clap_complete = "4" # Shell completions
3355
inquire = "0.7" # Interactive prompts
3456
ctrlc = "3" # Ctrl+C handler
3557
rand = "0.8" # Random number generation

README.md

Lines changed: 30 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -18,37 +18,49 @@ kto monitors web pages for changes and notifies you when something interesting h
1818
- **Background service** - Runs as systemd/launchd service or cron job
1919
- **Machine-readable output** - JSON output for scripting and automation
2020

21+
## Installation
22+
23+
```bash
24+
# Recommended: prebuilt binary (fast, no compile)
25+
cargo binstall kto
26+
27+
# From crates.io (requires Rust)
28+
cargo install kto
29+
30+
# Via install script
31+
curl -fsSL https://raw.githubusercontent.com/devindudeman/kto/main/install.sh | bash
32+
33+
# From source
34+
git clone https://github.com/devindudeman/kto
35+
cd kto && cargo install --path . --features tui
36+
```
37+
2138
## Quick Start
2239

2340
```bash
24-
# Install
25-
cargo install --path .
41+
# First-time setup (guided wizard)
42+
kto init
2643

27-
# Create your first watch
44+
# Or manually:
2845
kto new "https://news.ycombinator.com for AI news"
29-
30-
# Set up notifications
3146
kto notify set --ntfy my-alerts
32-
33-
# Install as background service
3447
kto service install
35-
36-
# Check status
37-
kto service status
3848
```
3949

40-
## Installation
50+
## Shell Completions
4151

42-
### From Source
4352
```bash
44-
git clone https://github.com/devinbernosky/kto
45-
cd kto
46-
cargo build --release --features tui
47-
cp target/release/kto ~/.local/bin/
53+
# Bash
54+
kto completions bash >> ~/.bashrc
55+
56+
# Zsh
57+
kto completions zsh >> ~/.zshrc
58+
59+
# Fish
60+
kto completions fish > ~/.config/fish/completions/kto.fish
4861
```
4962

50-
### Dependencies
51-
- Rust 1.70+
63+
## Dependencies
5264
- For JS rendering: Node.js + Playwright (`kto enable-js`)
5365
- For AI analysis: [Claude CLI](https://claude.ai/cli) (optional)
5466

0 commit comments

Comments
 (0)